From dafb47ba3457a4c9b69fe5517aa66d07895ad547 Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Tue, 28 Aug 2018 10:43:25 +0300 Subject: [PATCH] Imported Upstream version 3.0.5 --- .prev-version | 2 +- .tarball-version | 2 +- .version | 2 +- AUTHORS | 2 +- ChangeLog | 7140 +- ChangeLog-2012 | 3453 +- GNUmakefile | 4 +- INSTALL | 322 +- Makefile.am | 67 +- Makefile.in | 5885 +- NEWS | 778 +- PACKAGING | 2 +- README | 4 +- README-alpha | 30 + README-release | 100 - THANKS | 39 +- TODO | 107 +- aclocal.m4 | 525 +- .../{darwin11.4.0.valgrind => Darwin.valgrind} | 2 +- build-aux/Linux.valgrind | 48 + build-aux/Makefile.in | 1532 - build-aux/announce-gen | 38 +- build-aux/compile | 13 +- build-aux/config.guess | 886 +- build-aux/config.rpath | 18 +- build-aux/config.sub | 413 +- build-aux/cross-options.pl | 74 +- build-aux/depcomp | 46 +- build-aux/do-release-commit-and-tag | 16 +- build-aux/gendocs.sh | 148 +- build-aux/git-version-gen | 38 +- build-aux/gitlog-to-changelog | 187 +- build-aux/gnu-web-doc-update | 44 +- build-aux/gnupload | 14 +- build-aux/install-sh | 397 +- build-aux/javacomp.sh.in | 4 +- build-aux/javaexec.sh.in | 4 +- build-aux/{Makefile.am => local.mk} | 16 +- build-aux/mdate-sh | 14 +- build-aux/missing | 18 +- build-aux/move-if-change | 83 + build-aux/prefix-gnulib-mk | 238 + build-aux/test-driver | 41 +- build-aux/texinfo.tex | 5278 +- build-aux/update-b4-copyright | 2 +- build-aux/update-copyright | 17 +- build-aux/useless-if-before-free | 17 +- build-aux/vc-list-files | 14 +- build-aux/ylwrap | 34 +- cfg.mk | 134 +- configure | 8347 +- configure.ac | 91 +- data/Makefile.am | 30 - data/Makefile.in | 1643 - data/README | 4 +- data/bison.m4 | 599 +- data/c++-skel.m4 | 3 +- data/c++.m4 | 430 +- data/c-like.m4 | 31 +- data/c-skel.m4 | 3 +- data/c.m4 | 632 +- data/glr.c | 795 +- data/glr.cc | 225 +- data/java-skel.m4 | 2 +- data/java.m4 | 130 +- data/lalr1.cc | 1277 +- data/lalr1.java | 742 +- data/local.mk | 45 + data/location.cc | 235 +- data/m4sugar/foreach.m4 | 4 +- data/m4sugar/m4sugar.m4 | 21 +- data/stack.hh | 111 +- data/variant.hh | 360 + data/xslt/bison.xsl | 2 +- data/xslt/xml2dot.xsl | 28 +- data/xslt/xml2text.xsl | 49 +- data/xslt/xml2xhtml.xsl | 147 +- data/yacc.c | 628 +- djgpp/Makefile.maint | 2 +- djgpp/README.in | 2 +- djgpp/config.bat | 2 +- djgpp/config.sed | 2 +- djgpp/config.site | 2 +- djgpp/config_h.sed | 2 +- djgpp/djunpack.bat | 2 +- djgpp/local.mk | 27 + djgpp/subpipe.c | 2 +- djgpp/subpipe.h | 2 +- djgpp/testsuite.sed | 2 +- doc/Doxyfile.in | 2349 +- doc/Makefile.am | 155 - doc/Makefile.in | 2014 - doc/bison.1 | 89 +- doc/bison.help | 80 + doc/bison.info | 9671 +- doc/bison.texi | 2625 +- doc/bison.x | 7 +- doc/common.x | 4 - doc/fdl.texi | 6 +- doc/figs/example-reduce.eps | 95 +- doc/figs/{example-reduce.dot => example-reduce.gv} | 0 doc/figs/example-reduce.pdf | Bin 7992 -> 7939 bytes doc/figs/example-reduce.png | Bin 7812 -> 6784 bytes doc/figs/example-reduce.txt | 13 + doc/figs/example-shift.eps | 53 +- doc/figs/{example-shift.dot => example-shift.gv} | 0 doc/figs/example-shift.pdf | Bin 7317 -> 7342 bytes doc/figs/example-shift.png | Bin 4625 -> 5323 bytes doc/figs/example-shift.txt | 12 + doc/figs/example.eps | 415 +- doc/figs/{example.dot => example.gv} | 0 doc/figs/example.pdf | Bin 11698 -> 11916 bytes doc/figs/example.png | Bin 41163 -> 43018 bytes doc/figs/example.txt | 2 + doc/figs/example.y | 4 - doc/gpl-3.0.texi | 8 +- doc/local.mk | 186 + doc/refcard.tex | 3 +- doc/stamp-vti | 8 +- doc/version.texi | 8 +- etc/Makefile.in | 1530 - etc/README | 38 - etc/bench.pl.in | 831 +- etc/local.mk | 16 + examples/Makefile.in | 1710 - examples/calc++/Makefile.am | 93 - examples/calc++/Makefile.in | 2154 - examples/calc++/calc++-driver.cc | 38 - examples/calc++/calc++-driver.hh | 42 - examples/calc++/calc++-parser.cc | 1080 - examples/calc++/calc++-parser.hh | 287 - examples/calc++/calc++-parser.stamp | 0 examples/calc++/calc++-parser.yy | 75 - examples/calc++/calc++-scanner.cc | 2086 - examples/calc++/calc++-scanner.ll | 90 - examples/calc++/calc++.cc | 18 - examples/calc++/{test => calc++.test} | 32 +- examples/calc++/calc.stamp | 0 examples/calc++/local.mk | 85 + examples/calc++/location.hh | 181 - examples/calc++/position.hh | 172 - examples/calc++/stack.hh | 141 - examples/extexi | 244 +- examples/local.mk | 46 + examples/mfcalc/local.mk | 40 + etc/Makefile.am => examples/mfcalc/mfcalc.test | 15 +- examples/rpcalc/local.mk | 40 + examples/{Makefile.am => rpcalc/rpcalc.test} | 37 +- examples/test | 82 + lib/Makefile.am | 55 - lib/Makefile.in | 3605 - {build-aux/snippet => lib}/_Noreturn.h | 0 lib/abitset.c | 236 +- lib/abitset.h | 3 +- lib/alignof.h | 50 + lib/alloca.in.h | 6 +- {build-aux/snippet => lib}/arg-nonnull.h | 4 +- lib/argmatch.c | 12 +- lib/argmatch.h | 12 +- lib/asnprintf.c | 4 +- lib/basename-lgpl.c | 4 +- lib/basename.c | 4 +- lib/bbitset.h | 32 +- lib/binary-io.c | 34 + lib/binary-io.h | 47 +- lib/bitrotate.h | 7 +- lib/bitset.c | 13 +- lib/bitset.h | 61 +- lib/bitset_stats.c | 81 +- lib/bitset_stats.h | 3 +- lib/bitsetv-print.c | 4 +- lib/bitsetv-print.h | 3 +- lib/bitsetv.c | 8 +- lib/bitsetv.h | 3 +- {build-aux/snippet => lib}/c++defs.h | 95 +- lib/c-ctype.c | 394 +- lib/c-ctype.h | 454 +- lib/c-strcase.h | 4 +- lib/c-strcasecmp.c | 4 +- lib/c-strcaseeq.h | 7 +- lib/c-strncasecmp.c | 4 +- lib/calloc.c | 4 +- lib/cloexec.c | 6 +- lib/cloexec.h | 6 +- lib/close-stream.c | 4 +- lib/close.c | 8 +- lib/closeout.c | 20 +- lib/closeout.h | 4 +- lib/concat-filename.c | 73 + lib/concat-filename.h | 41 + lib/config.charset | 8 +- lib/config.in.h | 439 +- lib/dirname-lgpl.c | 4 +- lib/dirname.c | 4 +- lib/dirname.h | 14 +- lib/dosname.h | 9 +- lib/dup-safer-flag.c | 4 +- lib/dup-safer.c | 4 +- lib/dup2.c | 107 +- lib/ebitset.c | 657 +- lib/ebitset.h | 3 +- lib/errno.in.h | 8 +- lib/error.c | 60 +- lib/error.h | 18 +- lib/exitfail.c | 4 +- lib/exitfail.h | 4 +- lib/fatal-signal.c | 4 +- lib/fatal-signal.h | 4 +- lib/fcntl.c | 123 +- lib/fcntl.in.h | 31 +- lib/fd-hook.c | 6 +- lib/fd-hook.h | 6 +- lib/fd-safer-flag.c | 4 +- lib/fd-safer.c | 4 +- lib/filename.h | 54 + lib/float+.h | 4 +- lib/float.c | 4 +- lib/float.in.h | 10 +- lib/fopen-safer.c | 4 +- lib/fopen.c | 6 +- lib/fpending.c | 35 +- lib/fpending.h | 15 +- lib/fprintf.c | 4 +- lib/fpucw.h | 10 +- lib/frexp.c | 4 +- lib/frexpl.c | 4 +- lib/fseterr.c | 12 +- lib/fseterr.h | 4 +- lib/fstat.c | 72 +- lib/get-errno.c | 3 +- lib/get-errno.h | 2 +- lib/getdelim.c | 135 - lib/getdtablesize.c | 62 +- lib/getline.c | 27 - lib/getopt-cdefs.in.h | 67 + lib/getopt-core.h | 96 + lib/getopt-ext.h | 77 + lib/getopt-pfx-core.h | 59 + lib/getopt-pfx-ext.h | 71 + lib/getopt.c | 1440 +- lib/getopt.in.h | 242 +- lib/getopt1.c | 179 +- lib/getopt_int.h | 91 +- lib/getprogname.c | 191 + lib/{strnlen1.h => getprogname.h} | 32 +- lib/gettext.h | 20 +- lib/glthread/lock.c | 186 +- lib/glthread/lock.h | 80 +- lib/glthread/threadlib.c | 4 +- lib/gnulib.mk | 1108 +- lib/hard-locale.c | 72 + lib/{strtoul.c => hard-locale.h} | 16 +- lib/hash.c | 12 +- lib/hash.h | 8 +- lib/intprops.h | 268 +- lib/inttypes.in.h | 24 +- lib/isnan.c | 22 +- lib/isnand-nolibm.h | 4 +- lib/isnand.c | 4 +- lib/isnanf-nolibm.h | 4 +- lib/isnanf.c | 4 +- lib/isnanl-nolibm.h | 4 +- lib/isnanl.c | 4 +- lib/iswblank.c | 26 - lib/itold.c | 4 +- lib/lbitset.c | 758 +- lib/lbitset.h | 3 +- lib/ldexpl.c | 4 +- lib/libiberty.h | 5 +- lib/limits.in.h | 74 + lib/local.mk | 58 + lib/localcharset.c | 106 +- lib/localcharset.h | 4 +- lib/lstat.c | 100 + lib/main.c | 10 +- lib/malloc.c | 4 +- lib/malloca.c | 105 + lib/malloca.h | 127 + lib/math.c | 1 + lib/math.in.h | 240 +- lib/mbchar.c | 37 - lib/mbchar.h | 357 - lib/mbrtowc.c | 78 +- lib/mbschr.c | 52 - lib/mbsinit.c | 38 +- lib/mbsrchr.c | 49 - lib/mbswidth.c | 4 +- lib/mbswidth.h | 4 +- lib/mbuiter.c | 3 - lib/mbuiter.h | 229 - lib/memchr.c | 4 +- lib/minmax.h | 60 + lib/msvc-inval.c | 10 +- lib/msvc-inval.h | 8 +- lib/msvc-nothrow.c | 8 +- lib/msvc-nothrow.h | 6 +- lib/obstack.c | 372 +- lib/obstack.h | 792 +- lib/obstack_printf.c | 4 +- lib/open.c | 35 +- lib/pathmax.h | 8 +- lib/perror.c | 4 +- lib/pipe-safer.c | 4 +- lib/pipe2-safer.c | 4 +- lib/pipe2.c | 19 +- lib/printf-args.c | 4 +- lib/printf-args.h | 4 +- lib/printf-frexp.c | 4 +- lib/printf-frexp.h | 4 +- lib/printf-frexpl.c | 4 +- lib/printf-frexpl.h | 4 +- lib/printf-parse.c | 6 +- lib/printf-parse.h | 4 +- lib/printf.c | 4 +- lib/progname.c | 4 +- lib/progname.h | 4 +- lib/quote.h | 4 +- lib/quotearg.c | 204 +- lib/quotearg.h | 40 +- lib/raise.c | 8 +- lib/rawmemchr.c | 4 +- lib/realloc.c | 4 +- lib/ref-add.sin | 4 +- lib/ref-del.sin | 4 +- lib/sched.in.h | 21 +- lib/sig-handler.h | 18 +- lib/sigaction.c | 6 +- lib/signal.in.h | 28 +- lib/signbitd.c | 4 +- lib/signbitf.c | 4 +- lib/signbitl.c | 4 +- lib/sigprocmask.c | 6 +- lib/size_max.h | 4 +- lib/snprintf.c | 4 +- lib/spawn-pipe.c | 20 +- lib/spawn-pipe.h | 6 +- lib/spawn.in.h | 8 +- lib/spawn_faction_addclose.c | 4 +- lib/spawn_faction_adddup2.c | 4 +- lib/spawn_faction_addopen.c | 4 +- lib/spawn_faction_destroy.c | 4 +- lib/spawn_faction_init.c | 4 +- lib/spawn_int.h | 4 +- lib/spawnattr_destroy.c | 4 +- lib/spawnattr_init.c | 4 +- lib/spawnattr_setflags.c | 4 +- lib/spawnattr_setsigmask.c | 4 +- lib/spawni.c | 6 +- lib/spawnp.c | 4 +- lib/sprintf.c | 4 +- lib/stat-time.c | 3 + lib/stat-time.h | 252 + lib/stat-w32.c | 421 + lib/stat-w32.h | 37 + lib/stat.c | 421 +- lib/stdbool.in.h | 10 +- lib/stddef.in.h | 62 +- lib/stdint.in.h | 798 +- lib/stdio--.h | 4 +- lib/stdio-impl.h | 54 +- lib/stdio-safer.h | 4 +- lib/stdio.in.h | 63 +- lib/stdlib.in.h | 70 +- lib/stpcpy.c | 4 +- lib/strchrnul.c | 4 +- lib/strdup.c | 4 +- lib/streq.h | 4 +- lib/strerror-override.c | 4 +- lib/strerror-override.h | 6 +- lib/strerror.c | 7 +- lib/strerror_r.c | 152 +- lib/string.in.h | 58 +- lib/stripslash.c | 4 +- lib/strndup.c | 4 +- lib/strnlen.c | 4 +- lib/strnlen1.c | 35 - lib/strtol.c | 433 - lib/strverscmp.c | 100 +- lib/sys_stat.in.h | 188 +- lib/sys_types.in.h | 51 +- lib/sys_wait.in.h | 10 +- lib/time.in.h | 132 +- lib/timevar.c | 42 +- lib/timevar.def | 3 +- lib/timevar.h | 6 +- lib/unistd--.h | 4 +- lib/unistd-safer.h | 4 +- lib/unistd.c | 1 + lib/unistd.in.h | 162 +- lib/unitypes.in.h | 4 +- lib/uniwidth.in.h | 4 +- lib/uniwidth/cjk.h | 4 +- lib/uniwidth/width.c | 176 +- lib/unlink.c | 97 + lib/unlocked-io.h | 4 +- lib/unsetenv.c | 4 +- lib/vasnprintf.c | 261 +- lib/vasnprintf.h | 4 +- lib/vbitset.c | 315 +- lib/vbitset.h | 3 +- lib/verify.h | 141 +- lib/vfprintf.c | 4 +- lib/vsnprintf.c | 4 +- lib/vsprintf.c | 4 +- lib/w32spawn.h | 25 +- lib/wait-process.c | 12 +- lib/wait-process.h | 4 +- lib/waitpid.c | 4 +- {build-aux/snippet => lib}/warn-on-use.h | 4 +- lib/wchar.in.h | 62 +- lib/wctype.in.h | 47 +- lib/wcwidth.c | 4 +- lib/xalloc-die.c | 4 +- lib/xalloc-oversized.h | 54 +- lib/xalloc.h | 42 +- lib/xconcat-filename.c | 41 + lib/xmalloc.c | 14 +- lib/xmemdup0.c | 4 +- lib/xmemdup0.h | 4 +- lib/xsize.h | 7 +- lib/xstrndup.c | 4 +- lib/xstrndup.h | 6 +- lib/yyerror.c | 2 +- m4/00gnulib.m4 | 22 +- m4/absolute-header.m4 | 102 + m4/alloca.m4 | 6 +- m4/asm-underscore.m4 | 7 +- m4/assert.m4 | 2 +- m4/bison-i18n.m4 | 3 +- m4/c-working.m4 | 4 +- m4/calloc.m4 | 22 +- m4/close-stream.m4 | 2 +- m4/close.m4 | 14 +- m4/closeout.m4 | 2 +- m4/codeset.m4 | 3 +- m4/config-h.m4 | 2 +- m4/configmake.m4 | 13 +- m4/cxx.m4 | 35 +- m4/dirname.m4 | 2 +- m4/double-slash-root.m4 | 2 +- m4/dup2.m4 | 95 +- m4/eealloc.m4 | 31 + m4/environ.m4 | 2 +- m4/errno_h.m4 | 2 +- m4/error.m4 | 2 +- m4/exponentd.m4 | 2 +- m4/exponentf.m4 | 2 +- m4/exponentl.m4 | 22 +- m4/extensions.m4 | 59 +- m4/extern-inline.m4 | 77 +- m4/fatal-signal.m4 | 2 +- m4/fcntl-o.m4 | 13 +- m4/fcntl.m4 | 59 +- m4/fcntl_h.m4 | 2 +- m4/flex.m4 | 8 +- m4/float_h.m4 | 36 +- m4/fopen.m4 | 10 +- m4/fpending.m4 | 90 +- m4/fpieee.m4 | 6 +- m4/fprintf-posix.m4 | 2 +- m4/frexp.m4 | 17 +- m4/frexpl.m4 | 6 +- m4/fseterr.m4 | 2 +- m4/fstat.m4 | 29 +- m4/getdelim.m4 | 88 - m4/getdtablesize.m4 | 49 +- m4/getline.m4 | 96 - m4/getopt.m4 | 31 +- m4/getprogname.m4 | 43 + m4/gettext.m4 | 39 +- m4/glibc21.m4 | 2 +- m4/gnulib-common.m4 | 181 +- m4/gnulib-comp.m4 | 200 +- m4/{strtoul.m4 => hard-locale.m4} | 9 +- m4/host-cpu-c-abi.m4 | 456 + m4/iconv.m4 | 116 +- m4/include_next.m4 | 60 +- m4/intlmacosx.m4 | 6 +- m4/intmax_t.m4 | 2 +- m4/inttypes-pri.m4 | 2 +- m4/inttypes.m4 | 3 +- m4/inttypes_h.m4 | 2 +- m4/isnan.m4 | 2 +- m4/isnand.m4 | 2 +- m4/isnanf.m4 | 17 +- m4/isnanl.m4 | 49 +- m4/iswblank.m4 | 41 - m4/javacomp.m4 | 116 +- m4/javaexec.m4 | 6 +- m4/largefile.m4 | 23 +- m4/ldexp.m4 | 2 +- m4/ldexpl.m4 | 10 +- m4/lib-ld.m4 | 163 +- m4/lib-link.m4 | 4 +- m4/lib-prefix.m4 | 129 +- m4/libunistring-base.m4 | 2 +- m4/limits-h.m4 | 31 + m4/localcharset.m4 | 2 +- m4/locale-fr.m4 | 31 +- m4/locale-ja.m4 | 39 +- m4/locale-zh.m4 | 39 +- m4/lock.m4 | 14 +- m4/longlong.m4 | 2 +- m4/lstat.m4 | 76 + m4/m4.m4 | 6 +- m4/malloc.m4 | 17 +- m4/malloca.m4 | 15 + m4/math_h.m4 | 17 +- m4/mbchar.m4 | 13 - m4/mbiter.m4 | 14 - m4/mbrtowc.m4 | 117 +- m4/mbsinit.m4 | 2 +- m4/mbstate_t.m4 | 2 +- m4/mbswidth.m4 | 2 +- m4/memchr.m4 | 33 +- m4/minmax.m4 | 44 + m4/mmap-anon.m4 | 2 +- m4/mode_t.m4 | 2 +- m4/msvc-inval.m4 | 2 +- m4/msvc-nothrow.m4 | 2 +- m4/multiarch.m4 | 2 +- m4/nls.m4 | 8 +- m4/nocrash.m4 | 9 +- m4/non-recursive-gnulib-prefix-hack.m4 | 32 + m4/obstack-printf.m4 | 2 +- m4/obstack.m4 | 35 + m4/off_t.m4 | 2 +- m4/open-cloexec.m4 | 21 + m4/open.m4 | 8 +- m4/pathmax.m4 | 6 +- m4/perror.m4 | 20 +- m4/pipe2.m4 | 2 +- m4/po.m4 | 11 +- m4/posix_spawn.m4 | 22 +- m4/printf-frexp.m4 | 2 +- m4/printf-frexpl.m4 | 2 +- m4/printf-posix-rpl.m4 | 2 +- m4/printf.m4 | 295 +- m4/progtest.m4 | 6 +- m4/pthread_rwlock_rdlock.m4 | 163 + m4/quote.m4 | 2 +- m4/quotearg.m4 | 2 +- m4/raise.m4 | 14 +- m4/rawmemchr.m4 | 2 +- m4/realloc.m4 | 15 +- m4/sched_h.m4 | 51 +- m4/setenv.m4 | 12 +- m4/sig_atomic_t.m4 | 2 +- m4/sigaction.m4 | 2 +- m4/signal_h.m4 | 2 +- m4/signalblocking.m4 | 2 +- m4/signbit.m4 | 32 +- m4/size_max.m4 | 2 +- m4/snprintf-posix.m4 | 2 +- m4/snprintf.m4 | 12 +- m4/spawn-pipe.m4 | 2 +- m4/spawn_h.m4 | 12 +- m4/sprintf-posix.m4 | 2 +- m4/ssize_t.m4 | 2 +- m4/stat-time.m4 | 83 + m4/stat.m4 | 111 +- m4/stdbool.m4 | 64 +- m4/stddef_h.m4 | 10 +- m4/stdint.m4 | 127 +- m4/stdint_h.m4 | 2 +- m4/stdio_h.m4 | 35 +- m4/stdlib_h.m4 | 20 +- m4/stpcpy.m4 | 2 +- m4/strchrnul.m4 | 2 +- m4/strdup.m4 | 2 +- m4/strerror.m4 | 22 +- m4/strerror_r.m4 | 4 +- m4/string_h.m4 | 16 +- m4/strndup.m4 | 9 +- m4/strnlen.m4 | 2 +- m4/strverscmp.m4 | 2 +- m4/sys_socket_h.m4 | 2 +- m4/sys_stat_h.m4 | 20 +- m4/sys_types_h.m4 | 40 +- m4/sys_wait_h.m4 | 2 +- m4/threadlib.m4 | 50 +- m4/time_h.m4 | 41 +- m4/timevar.m4 | 3 +- m4/unistd-safer.m4 | 2 +- m4/unistd_h.m4 | 18 +- m4/unlink.m4 | 132 + m4/unlocked-io.m4 | 2 +- m4/vasnprintf.m4 | 2 +- m4/vfprintf-posix.m4 | 2 +- m4/vsnprintf-posix.m4 | 2 +- m4/vsnprintf.m4 | 12 +- m4/vsprintf-posix.m4 | 2 +- m4/wait-process.m4 | 2 +- m4/waitpid.m4 | 2 +- m4/warn-on-use.m4 | 2 +- m4/warnings.m4 | 86 +- m4/wchar_h.m4 | 29 +- m4/wchar_t.m4 | 2 +- m4/wctype_h.m4 | 9 +- m4/wcwidth.m4 | 28 +- m4/wint_t.m4 | 48 +- m4/xalloc.m4 | 2 +- m4/xsize.m4 | 2 +- m4/xstrndup.m4 | 2 +- maint.mk | 213 +- po/LINGUAS | 1 + po/Makefile.in.in | 84 +- po/Makevars | 21 +- po/POTFILES.in | 1 - po/bison.pot | 531 +- po/ca.gmo | Bin 0 -> 25299 bytes po/ca.po | 1202 + po/da.gmo | Bin 6586 -> 24335 bytes po/da.po | 1160 +- po/de.gmo | Bin 25774 -> 25266 bytes po/de.po | 628 +- po/el.gmo | Bin 13804 -> 31476 bytes po/el.po | 883 +- po/eo.gmo | Bin 24681 -> 24388 bytes po/eo.po | 759 +- po/es.gmo | Bin 7565 -> 25347 bytes po/es.po | 1329 +- po/et.gmo | Bin 24317 -> 24240 bytes po/et.po | 855 +- po/fi.gmo | Bin 26311 -> 25947 bytes po/fi.po | 702 +- po/fr.gmo | Bin 26282 -> 25770 bytes po/fr.po | 649 +- po/ga.gmo | Bin 16195 -> 26407 bytes po/ga.po | 887 +- po/hr.gmo | Bin 25528 -> 18214 bytes po/hr.po | 637 +- po/id.gmo | Bin 11705 -> 9482 bytes po/id.po | 616 +- po/it.gmo | Bin 6849 -> 6600 bytes po/it.po | 584 +- po/ja.gmo | Bin 7620 -> 6621 bytes po/ja.po | 584 +- po/ms.gmo | Bin 10427 -> 13540 bytes po/ms.po | 803 +- po/nb.gmo | Bin 6743 -> 6482 bytes po/nb.po | 582 +- po/nl.gmo | Bin 12815 -> 25172 bytes po/nl.po | 1026 +- po/pl.gmo | Bin 26134 -> 25632 bytes po/pl.po | 674 +- po/pt.gmo | Bin 1819 -> 24613 bytes po/pt.po | 1035 +- po/pt_BR.gmo | Bin 6479 -> 25194 bytes po/pt_BR.po | 1163 +- po/ro.gmo | Bin 6957 -> 6698 bytes po/ro.po | 586 +- po/ru.gmo | Bin 13922 -> 11659 bytes po/ru.po | 614 +- po/sr.gmo | Bin 24319 -> 31454 bytes po/sr.po | 646 +- po/sv.gmo | Bin 24723 -> 24483 bytes po/sv.po | 641 +- po/tr.gmo | Bin 6793 -> 25099 bytes po/tr.po | 1274 +- po/uk.gmo | Bin 33796 -> 32944 bytes po/uk.po | 685 +- po/vi.gmo | Bin 27541 -> 27173 bytes po/vi.po | 749 +- po/zh_CN.gmo | Bin 6273 -> 23247 bytes po/zh_CN.po | 920 +- po/zh_TW.gmo | Bin 23624 -> 23246 bytes po/zh_TW.po | 656 +- runtime-po/LINGUAS | 2 + runtime-po/Makefile.in.in | 84 +- runtime-po/Makevars | 23 +- runtime-po/ast.gmo | Bin 1329 -> 1393 bytes runtime-po/ast.po | 27 +- runtime-po/bison-runtime.pot | 30 +- runtime-po/ca.gmo | Bin 0 -> 1408 bytes runtime-po/ca.po | 63 + runtime-po/da.gmo | Bin 1281 -> 1345 bytes runtime-po/da.po | 27 +- runtime-po/de.gmo | Bin 1360 -> 1424 bytes runtime-po/de.po | 27 +- runtime-po/el.gmo | Bin 1558 -> 1622 bytes runtime-po/el.po | 27 +- runtime-po/eo.gmo | Bin 1275 -> 1343 bytes runtime-po/eo.po | 39 +- runtime-po/es.gmo | Bin 527 -> 1409 bytes runtime-po/es.po | 86 +- runtime-po/et.gmo | Bin 1286 -> 1350 bytes runtime-po/et.po | 27 +- runtime-po/fi.gmo | Bin 1364 -> 1428 bytes runtime-po/fi.po | 27 +- runtime-po/fr.gmo | Bin 1309 -> 1370 bytes runtime-po/fr.po | 56 +- runtime-po/ga.gmo | Bin 1337 -> 1462 bytes runtime-po/ga.po | 58 +- runtime-po/gl.gmo | Bin 1368 -> 1459 bytes runtime-po/gl.po | 37 +- runtime-po/hr.gmo | Bin 1426 -> 1521 bytes runtime-po/hr.po | 34 +- runtime-po/hu.gmo | Bin 1342 -> 1406 bytes runtime-po/hu.po | 27 +- runtime-po/ia.gmo | Bin 0 -> 1341 bytes runtime-po/ia.po | 62 + runtime-po/id.gmo | Bin 1406 -> 1470 bytes runtime-po/id.po | 27 +- runtime-po/it.gmo | Bin 1360 -> 1424 bytes runtime-po/it.po | 27 +- runtime-po/ja.gmo | Bin 1532 -> 1596 bytes runtime-po/ja.po | 27 +- runtime-po/ky.gmo | Bin 1595 -> 1659 bytes runtime-po/ky.po | 27 +- runtime-po/lt.gmo | Bin 1420 -> 1484 bytes runtime-po/lt.po | 27 +- runtime-po/lv.gmo | Bin 1450 -> 1514 bytes runtime-po/lv.po | 27 +- runtime-po/ms.gmo | Bin 1375 -> 1439 bytes runtime-po/ms.po | 27 +- runtime-po/nb.gmo | Bin 1315 -> 1379 bytes runtime-po/nb.po | 27 +- runtime-po/nl.gmo | Bin 1288 -> 1352 bytes runtime-po/nl.po | 27 +- runtime-po/pl.gmo | Bin 1477 -> 1541 bytes runtime-po/pl.po | 27 +- runtime-po/pt.gmo | Bin 1376 -> 1416 bytes runtime-po/pt.po | 60 +- runtime-po/pt_BR.gmo | Bin 1300 -> 1364 bytes runtime-po/pt_BR.po | 27 +- runtime-po/ro.gmo | Bin 1379 -> 1443 bytes runtime-po/ro.po | 27 +- runtime-po/ru.gmo | Bin 1709 -> 1773 bytes runtime-po/ru.po | 27 +- runtime-po/sl.gmo | Bin 1425 -> 1489 bytes runtime-po/sl.po | 27 +- runtime-po/sq.gmo | Bin 1314 -> 1378 bytes runtime-po/sq.po | 27 +- runtime-po/sr.gmo | Bin 1749 -> 1813 bytes runtime-po/sr.po | 27 +- runtime-po/sv.gmo | Bin 1263 -> 1327 bytes runtime-po/sv.po | 27 +- runtime-po/th.gmo | Bin 2269 -> 2333 bytes runtime-po/th.po | 27 +- runtime-po/tr.gmo | Bin 1347 -> 1411 bytes runtime-po/tr.po | 31 +- runtime-po/uk.gmo | Bin 1794 -> 1858 bytes runtime-po/uk.po | 27 +- runtime-po/vi.gmo | Bin 1521 -> 1640 bytes runtime-po/vi.po | 41 +- runtime-po/zh_CN.gmo | Bin 1239 -> 1381 bytes runtime-po/zh_CN.po | 42 +- runtime-po/zh_TW.gmo | Bin 1311 -> 1375 bytes runtime-po/zh_TW.po | 27 +- src/AnnotationList.c | 12 +- src/AnnotationList.h | 10 +- src/InadequacyList.c | 4 +- src/InadequacyList.h | 12 +- src/LR0.c | 73 +- src/LR0.h | 4 +- src/Makefile.am | 117 - src/Makefile.in | 1935 - src/Sbitset.c | 4 +- src/Sbitset.h | 84 +- src/assoc.c | 7 +- src/assoc.h | 12 +- src/closure.c | 50 +- src/closure.h | 6 +- src/complain.c | 414 +- src/complain.h | 174 +- src/conflicts.c | 452 +- src/conflicts.h | 2 +- src/derives.c | 23 +- src/derives.h | 2 +- src/files.c | 157 +- src/files.h | 17 +- src/flex-scanner.h | 15 +- src/getargs.c | 385 +- src/getargs.h | 39 +- src/gram.c | 139 +- src/gram.h | 44 +- src/graphviz.c | 7 +- src/graphviz.h | 4 +- src/ielr.c | 13 +- src/ielr.h | 6 +- src/lalr.c | 209 +- src/lalr.h | 2 +- src/local.mk | 125 + src/location.c | 84 +- src/location.h | 27 +- src/main.c | 20 +- src/muscle-tab.c | 577 +- src/muscle-tab.h | 111 +- src/named-ref.c | 2 +- src/named-ref.h | 6 +- src/nullable.c | 88 +- src/nullable.h | 3 +- src/output.c | 563 +- src/output.h | 6 +- src/parse-gram.c | 2592 +- src/parse-gram.h | 296 +- src/parse-gram.y | 676 +- src/print-xml.c | 260 +- src/print-xml.h | 2 +- src/print.c | 294 +- src/print.h | 2 +- src/print_graph.c | 96 +- src/print_graph.h | 3 +- src/reader.c | 263 +- src/reader.h | 10 +- src/reduce.c | 153 +- src/reduce.h | 4 +- src/relation.c | 40 +- src/relation.h | 5 +- src/scan-code-c.c | 2 +- src/scan-code.c | 1721 +- src/scan-code.h | 31 +- src/scan-code.l | 446 +- src/scan-gram-c.c | 2 +- src/scan-gram.c | 2977 +- src/scan-gram.h | 3 +- src/scan-gram.l | 573 +- src/scan-skel-c.c | 2 +- src/scan-skel.c | 1447 +- src/scan-skel.h | 3 +- src/scan-skel.l | 275 +- src/state.c | 57 +- src/state.h | 32 +- src/symlist.c | 164 +- src/symlist.h | 55 +- src/symtab.c | 760 +- src/symtab.h | 224 +- src/system.h | 37 +- src/tables.c | 588 +- src/tables.h | 3 +- src/uniqstr.c | 31 +- src/uniqstr.h | 77 +- tests/Makefile.am | 107 - tests/Makefile.in | 1610 - tests/actions.at | 614 +- tests/atlocal.in | 54 +- tests/bison.in | 17 +- tests/c++.at | 819 +- tests/calc.at | 175 +- tests/conflicts.at | 598 +- tests/cxx-type.at | 18 +- tests/existing.at | 2138 +- tests/glr-regression.at | 240 +- tests/headers.at | 54 +- tests/input.at | 1147 +- tests/java.at | 258 +- tests/javapush.at | 882 + tests/local.at | 482 +- tests/local.mk | 133 + tests/named-refs.at | 82 +- tests/output.at | 182 +- tests/package.m4 | 4 +- tests/push.at | 12 +- tests/reduce.at | 169 +- tests/regression.at | 295 +- tests/sets.at | 142 +- tests/skeletons.at | 15 +- tests/synclines.at | 95 +- tests/testsuite | 179955 +++++++++++------- tests/testsuite.at | 18 +- tests/torture.at | 38 +- tests/types.at | 275 + 863 files changed, 197354 insertions(+), 139650 deletions(-) create mode 100644 README-alpha delete mode 100644 README-release rename build-aux/{darwin11.4.0.valgrind => Darwin.valgrind} (95%) create mode 100644 build-aux/Linux.valgrind delete mode 100644 build-aux/Makefile.in rename build-aux/{Makefile.am => local.mk} (69%) create mode 100755 build-aux/move-if-change create mode 100755 build-aux/prefix-gnulib-mk delete mode 100644 data/Makefile.am delete mode 100644 data/Makefile.in create mode 100644 data/local.mk create mode 100644 data/variant.hh create mode 100644 djgpp/local.mk delete mode 100644 doc/Makefile.am delete mode 100644 doc/Makefile.in create mode 100644 doc/bison.help delete mode 100644 doc/common.x rename doc/figs/{example-reduce.dot => example-reduce.gv} (100%) create mode 100644 doc/figs/example-reduce.txt rename doc/figs/{example-shift.dot => example-shift.gv} (100%) create mode 100644 doc/figs/example-shift.txt rename doc/figs/{example.dot => example.gv} (100%) create mode 100644 doc/figs/example.txt delete mode 100644 doc/figs/example.y create mode 100644 doc/local.mk delete mode 100644 etc/Makefile.in delete mode 100644 etc/README create mode 100644 etc/local.mk delete mode 100644 examples/Makefile.in delete mode 100644 examples/calc++/Makefile.am delete mode 100644 examples/calc++/Makefile.in delete mode 100644 examples/calc++/calc++-driver.cc delete mode 100644 examples/calc++/calc++-driver.hh delete mode 100644 examples/calc++/calc++-parser.cc delete mode 100644 examples/calc++/calc++-parser.hh delete mode 100644 examples/calc++/calc++-parser.stamp delete mode 100644 examples/calc++/calc++-parser.yy delete mode 100644 examples/calc++/calc++-scanner.cc delete mode 100644 examples/calc++/calc++-scanner.ll delete mode 100644 examples/calc++/calc++.cc rename examples/calc++/{test => calc++.test} (80%) delete mode 100644 examples/calc++/calc.stamp create mode 100644 examples/calc++/local.mk delete mode 100644 examples/calc++/location.hh delete mode 100644 examples/calc++/position.hh delete mode 100644 examples/calc++/stack.hh mode change 100644 => 100755 examples/extexi create mode 100644 examples/local.mk create mode 100644 examples/mfcalc/local.mk rename etc/Makefile.am => examples/mfcalc/mfcalc.test (79%) mode change 100644 => 100755 create mode 100644 examples/rpcalc/local.mk rename examples/{Makefile.am => rpcalc/rpcalc.test} (63%) mode change 100644 => 100755 create mode 100755 examples/test delete mode 100644 lib/Makefile.am delete mode 100644 lib/Makefile.in rename {build-aux/snippet => lib}/_Noreturn.h (100%) create mode 100644 lib/alignof.h rename {build-aux/snippet => lib}/arg-nonnull.h (88%) rename {build-aux/snippet => lib}/c++defs.h (71%) create mode 100644 lib/concat-filename.c create mode 100644 lib/concat-filename.h create mode 100644 lib/filename.h delete mode 100644 lib/getdelim.c delete mode 100644 lib/getline.c create mode 100644 lib/getopt-cdefs.in.h create mode 100644 lib/getopt-core.h create mode 100644 lib/getopt-ext.h create mode 100644 lib/getopt-pfx-core.h create mode 100644 lib/getopt-pfx-ext.h create mode 100644 lib/getprogname.c rename lib/{strnlen1.h => getprogname.h} (52%) create mode 100644 lib/hard-locale.c rename lib/{strtoul.c => hard-locale.h} (64%) delete mode 100644 lib/iswblank.c create mode 100644 lib/limits.in.h create mode 100644 lib/local.mk create mode 100644 lib/lstat.c create mode 100644 lib/malloca.c create mode 100644 lib/malloca.h delete mode 100644 lib/mbchar.c delete mode 100644 lib/mbchar.h delete mode 100644 lib/mbschr.c delete mode 100644 lib/mbsrchr.c delete mode 100644 lib/mbuiter.c delete mode 100644 lib/mbuiter.h create mode 100644 lib/minmax.h create mode 100644 lib/stat-time.c create mode 100644 lib/stat-time.h create mode 100644 lib/stat-w32.c create mode 100644 lib/stat-w32.h delete mode 100644 lib/strnlen1.c delete mode 100644 lib/strtol.c create mode 100644 lib/unlink.c rename {build-aux/snippet => lib}/warn-on-use.h (97%) create mode 100644 lib/xconcat-filename.c create mode 100644 m4/absolute-header.m4 create mode 100644 m4/eealloc.m4 delete mode 100644 m4/getdelim.m4 delete mode 100644 m4/getline.m4 create mode 100644 m4/getprogname.m4 rename m4/{strtoul.m4 => hard-locale.m4} (54%) create mode 100644 m4/host-cpu-c-abi.m4 delete mode 100644 m4/iswblank.m4 create mode 100644 m4/limits-h.m4 create mode 100644 m4/lstat.m4 create mode 100644 m4/malloca.m4 delete mode 100644 m4/mbchar.m4 delete mode 100644 m4/mbiter.m4 create mode 100644 m4/minmax.m4 create mode 100644 m4/non-recursive-gnulib-prefix-hack.m4 create mode 100644 m4/obstack.m4 create mode 100644 m4/open-cloexec.m4 create mode 100644 m4/pthread_rwlock_rdlock.m4 create mode 100644 m4/stat-time.m4 create mode 100644 m4/unlink.m4 create mode 100644 po/ca.gmo create mode 100644 po/ca.po create mode 100644 runtime-po/ca.gmo create mode 100644 runtime-po/ca.po create mode 100644 runtime-po/ia.gmo create mode 100644 runtime-po/ia.po delete mode 100644 src/Makefile.am delete mode 100644 src/Makefile.in create mode 100644 src/local.mk delete mode 100644 tests/Makefile.am delete mode 100644 tests/Makefile.in create mode 100644 tests/javapush.at create mode 100644 tests/local.mk create mode 100644 tests/types.at diff --git a/.prev-version b/.prev-version index 1effb00..b0f2dcb 100644 --- a/.prev-version +++ b/.prev-version @@ -1 +1 @@ -2.7 +3.0.4 diff --git a/.tarball-version b/.tarball-version index 860487c..eca690e 100644 --- a/.tarball-version +++ b/.tarball-version @@ -1 +1 @@ -2.7.1 +3.0.5 diff --git a/.version b/.version index bf868c6..eca690e 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.7.12-4996 +3.0.5 diff --git a/AUTHORS b/AUTHORS index fa4b171..b0ddb15 100644 --- a/AUTHORS +++ b/AUTHORS @@ -24,7 +24,7 @@ and nasty bugs. ----- -Copyright (C) 1998-2013 Free Software Foundation, Inc. +Copyright (C) 1998-2015, 2018 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. diff --git a/ChangeLog b/ChangeLog index e2093bd..f8d699b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,96 +1,4125 @@ +2018-05-27 Akim Demaille + + version 3.0.5 + * NEWS: Record release date. + +2018-05-27 Akim Demaille + + bison: style: indentation fixes + * src/parse-gram.y: here. + +2018-05-27 Akim Demaille + + regen + +2018-05-27 Akim Demaille + + bison: please address sanitizer + * src/parse-gram.y (add_param): Asan does not like that the second + argument of strspn is not 0-terminated. + +2018-05-27 Akim Demaille + + C++: style: fix indentation + * data/variant.hh (b4_symbol_variant): De-indent, as the callers are + indented. + +2018-05-27 Akim Demaille + + NEWS: update + +2018-05-27 Akim Demaille + + C++: style: prefer `unsigned` to `unsigned int` + * data/c++.m4: here. + +2018-05-27 Akim Demaille + + C++: style: space before paren + * data/c++.m4, data/lalr1.cc: here. + +2018-05-27 Akim Demaille + + C++: fix -Wdeprecated warnings + For instance on test 99: + + In file included from @@.cc:56: + @@.hh:409:26: error: definition of implicit copy constructor for + 'stack_symbol_type' is deprecated because it + has a user-declared copy assignment operator + [-Werror,-Wdeprecated] + stack_symbol_type& operator= (const stack_symbol_type& that); + ^ + + Reported by Derek Clegg. + https://lists.gnu.org/archive/html/bison-patches/2018-05/msg00036.html + + * configure.ac (warn_tests): Add -Wdeprecated. + * data/lalr1.cc (stack_symbol_type): Add an explicit copy ctor. + We cannot rely on the explicit default implementation (`= default`) + as we support C++ 98. + +2018-05-27 Akim Demaille + + tests: fix -Wdeprecated warning + With recent compilers: + + input.yy:49:5: error: definition of implicit copy assignment + operator for 'Object' is deprecated because + it has a user-declared destructor + [-Werror,-Wdeprecated] + ~Object () + ^ + input.yy:130:35: note: in implicit copy assignment operator for + 'Object' first required here + { yylhs.value.as< Object > () = yystack_[0].value.as< Object > (); } + + * tests/c++.at (Object): Add missing assignment operator. + +2018-05-19 Akim Demaille + + maint: update syntax-check exclusions + sc_two_space_separator_in_usage complains about bootstrap: + + two_space_separator_in_usage + /Users/akim/src/gnu/bison/bootstrap:905: --aux-dir $build_aux\ + /Users/akim/src/gnu/bison/bootstrap:906: --doc-base $doc_base\ + /Users/akim/src/gnu/bison/bootstrap:907: --lib $gnulib_name\ + /Users/akim/src/gnu/bison/bootstrap:908: --m4-base $m4_base/\ + /Users/akim/src/gnu/bison/bootstrap:909: --source-base $source_base/\ + /Users/akim/src/gnu/bison/bootstrap:910: --tests-base $tests_base\ + /Users/akim/src/gnu/bison/bootstrap:911: --local-dir $local_gl_dir\ + maint.mk: help2man requires at least two spaces between an option and its description + + * cfg.mk: Exclude bootstrap from this check. + +2018-05-19 Akim Demaille + + autoconf: update + * submodules/autoconf: Update to latest master. + No difference on the M4 files we use. + +2018-05-19 Akim Demaille + + regen + +2018-05-12 Akim Demaille + + Update copyright years + Run `make update-copyright`. + +2018-05-12 Nate Guerin + + Add a missing word in the documentation + Small patch adds the word 'to' to the documentation. + +2018-05-12 Akim Demaille + + Examples: improve C++ style + * examples/variant.yy: Prefer vector to list. + Remove useless inline. + +2018-05-12 Akim Demaille + + Avoid compiler warnings + At least GCC 7.3, with -O1 or -O2 (but not -O0 or -O3) generates + warnings with -Wnull-dereference when using yyformat: it fails to see + yyformat cannot be null. + + Reported by Frank Heckenbach, https://savannah.gnu.org/patch/?9620. + + * configure.ac: Use -Wnull-dereference if supported. + * data/glr.c, data/lalr1.cc, data/yacc.c: Define yyformat in such + a way that GCC cannot not see that yyformat is defined. + Using `default: abort();` also addresses the issue, but forces + the inclusion of `stdlib.h`, which we avoid. + +2018-05-10 Akim Demaille + + C++: fix uses of `inline` + Sometimes `inline` would be used in *.cc files on symbols that are not + exported (useless but harmless), and sometimes on exported symbols + such as the constructor of syntax_error (harmful: linking fails). + + Reported several times, including: + + - by Dennis T + http://lists.gnu.org/archive/html/bug-bison/2016-03/msg00002.html + - by Frank Heckenbach + https://savannah.gnu.org/patch/?9616 + + * data/c++.m4 (b4_inline): New: expands to `inline` or nothing. + Use it where appropriate. + * data/lalr1.cc: Use it where appropriate. + + * tests/c++.at (Syntax error as exception): Put the scanner in another + compilation unit to exercise the constructor of syntax_error. + +2018-05-10 Akim Demaille + + C++: remove useless `inline` in CC files + * data/glr.cc, data/lalr1.cc: Remove `inline` from implementations + that are not in headers. + +2018-05-10 Akim Demaille + + C++: remove useless `inline` on templates + Templates are implicitly `inline`. + + * data/c++.m4, data/lalr1.cc: Remove `inline` from templates. + +2018-05-08 Akim Demaille + + style: don't use std::endl + * data/lalr1.cc, doc/bison.texi, etc/bench.pl.in, examples/variant.yy, + * tests/actions.at, tests/atlocal.in, tests/c++.at, tests/headers.at, + * tests/local.at, tests/types.at: + Don't use std::endl, it flushes uselessly, and is considered bad + style. + +2018-05-08 Akim Demaille + + doc: wrap + * README-hacking: Refill paragraphs. + +2018-05-08 Akim Demaille + + gnulib: update + * README-hacking: Commit before bootstrapping. + * bootstrap.conf: gnulib_mk is no longer defined by bootstrap. + * bootstrap, gnulib, lib/.gitignore, m4/.gitignore: Update/regen. + +2018-05-08 Akim Demaille + + tests: we might need to find gnulib headers + 315. calc.at:596: testing Calculator ... + ++ cat + ++ test x = x1 + ++ set +x + bison/tests/calc.at:596: bison -fno-caret -o calc.c calc.y + ++ bison -fno-caret -o calc.c calc.y + ++ set +x + bison/tests/calc.at:596: $BISON_C_WORKS + stderr: + stdout: + ++ set +x + bison/tests/calc.at:596: $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS + ++ ccache clang-mp-6.0 -Qunused-arguments -O3 -g -Wall -Wextra -Wno-sign-compare -Wcast-align -Wdocumentation -Wformat -Wpointer-arith -Wwrite-strings -Wbad-function-cast -Wshadow -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wmissing-declarations -Wmissing-prototypes -Wundef -pedantic -Wsign-compare -fno-color-diagnostics -Wno-keyword-macro -Werror -Ibison/_build/6s/lib -DNDEBUG -isystem /opt/local/include -I/opt/local/include -L/opt/local/lib -o calc calc.c bison/_build/6s/lib/libbison.a -lintl -Wl,-framework -Wl,CoreFoundation + stderr: + In file included from calc.y:198: + bison/_build/6s/lib/unistd.h:592:11: fatal error: 'getopt-pfx-core.h' file not found + # include + ^~~~~~~~~~~~~~~~~~~ + 1 error generated. + stdout: + bison/tests/calc.at:596: exit code was 1, expected 0 + 315. calc.at:596: 315. Calculator (calc.at:596): FAILED (calc.at:596) + + * tests/atlocal.in (CPPFLAGS): Find gnulib's headers. + +2018-05-08 Akim Demaille + + getargs: rename argument to avoid gnulib's renaming + With Clang 6.0: + + CC src/bison-getargs.o + bison/src/getargs.c:67:12: error: parameter 'option' not found in the + function declaration [-Werror,-Wdocumentation] + * \param option option being decoded. + ^~~~~~ + bison/src/getargs.c:67:12: note: did you mean 'rpl_option'? + + * src/getargs.c: Don't use `option` as a documentation argument. + +2017-09-22 Paul Eggert + + Capitalize "Polish" when it's a proper adjective + +2017-09-17 Paul Eggert + + Adjust to recent Gnulib changes + +2017-09-17 Paul Eggert + + autoconf: update + +2017-09-17 Paul Eggert + + gnulib: update + +2015-08-12 Akim Demaille + + gnulib: update + +2015-08-12 Akim Demaille + + lalr1, yacc: use the default location as initial error location + Currently lalr1.cc makes an out-of-bound access when trying to read @1 + in rules with an empty rhs (i.e., when there is no @1) that raises an + error (YYERROR). + + glr.c already gracefully handles this by using @$ as initial location + for the errors. Let's do that in yacc.c and lalr1.cc. + + * data/lalr1.cc, data/yacc.c: Use @$ to initialize the error location. + * tests/actions.at: Check that case. + +2015-08-12 Akim Demaille + + style: formatting and comment changes + * data/glr.c: Avoid empty lines. + * data/lalr1.cc: Use the same comments as in glr.c and yacc.c. + +2015-08-12 Akim Demaille + + c++: style: use "unsigned", not "unsigned int" + This style appears to be more traditional, at least in C++. + For instance in the standard, [facets.examples]. + There are occurrences using "unsigned int" too though. + + * data/lalr1.cc, data/location.cc, data/stack.hh: here. + +2015-08-12 Akim Demaille + + c++: style: remove useless "inline" and fix space issues + * data/lalr1.cc, data/c++.m4: Formatting changes. + * data/stack.hh: Remove useless "inline". + Add documentation. + * data/location.cc: Prefer {} for empty bodies. + +2015-08-12 Akim Demaille + + tests: beware of additional warnings from GCC 5 + * tests/synclines.at (AT_SYNCLINES_COMPILE): Avoid warnings about + unused functions. + +2015-08-12 Akim Demaille + + tests: beware that clang warns about "#define private public" + We use this trick to write some test about internal details. But + since we use -Werror, clang++ 3.6 dies issueing a warning about it. + + * configure.ac (warn_tests): Disable this warning. + +2015-08-12 Akim Demaille + + tests: update our Valgrind suppression files + * build-aux/linux-gnu.valgrind, build-aux/darwin11.4.0.valgrind: Rename as... + * build-aux/Linux.valgrind, build-aux/Darwin.valgrind: these. + * build-aux/Linux.valgrind: Add suppression clause. + * configure.ac: Update. + * tests/local.mk: Use it. + +2015-03-03 Akim Demaille + + doc: improve html and pdf rendering + * doc/bison.texi: Help html conversion to understand where the + function names end. + Beware of PDF width. + +2015-03-03 Akim Demaille + + doc: fixes in the C++ part + Reported by Askar Safin. + + http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00018.html + http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00019.html + + * doc/bison.texi (Split Symbols): Fix access to token types. + yylval is a pointer, so use ->. + Fix coding style issues: space before paren. + +2015-02-10 Akim Demaille + + tests: be robust to platforms that support UTF-8 even with LC_ALL=C + Because musl supports UTF-8 with LC_ALL=C, gcc produces: + + input.y: In function ‘yyparse’: + + instead of: + + input.y: In function 'yyparse': + + Reported by Ferdinand Thiessen. + http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00001.html + + * tests/synclines.at (AT_SYNCLINES_COMPILE): Skip syncline tests when + we can't trust error messages issued about a function body. + +2015-02-10 Akim Demaille + + tests: java: avoid recent Java features + Tests 463 and 464 fail with Java 1.4 compilers. + + Reported by Michael Felt. + + + * tests/javapush.at: Use StringBuffer instead of StringBuilder. + +2015-01-26 Akim Demaille + + tests: c++: fix symbol lookup issue + Sun C 5.13 SunOS_sparc 2014/10/20 reports errors on tests 430-432. + + Reported by Dennis Clarke. + + + * tests/c++.at (Variants): Be sure to emit operator<< before using it: + use "%code top" rather than "%code". + Prefer std::vector to std::list. + Do not define anything in std::, to avoid undefined behavior. + +2015-01-23 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2015-01-23 Akim Demaille + + version 3.0.4 + * NEWS: Record release date. + +2015-01-23 Akim Demaille + + gnulib: update + +2015-01-23 Akim Demaille + + build: re-enable compiler warnings, and fix them + There are warnings (-Wextra) in generated C++ code: + + ltlparse.cc: In member function 'ltlyy::parser::symbol_number_type + ltlyy::parser::by_state::type_get() const': + ltlparse.cc:452:33: warning: enumeral and non-enumeral type in + conditional expression + return state == empty_state ? empty_symbol : yystos_[state]; + + Reported by Alexandre Duret-Lutz. + + It turns out that -Wall and -Wextra were disabled because of a stupid + typo. + + * configure.ac: Fix the stupid typo. + * data/lalr1.cc, src/AnnotationList.c, src/InadequacyList.c, + * src/ielr.c, src/print.c, src/scan-code.l, src/symlist.c, + * src/symlist.h, src/symtab.c, src/tables.c, tests/actions.at, + * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at, + * tests/named-refs.at, tests/torture.at: + Fix warnings, mostly issues about variables used only with assertions, + which are disabled with -DNDEBUG. + +2015-01-22 Akim Demaille + + tests: c++: fix a C++03 conformance issue + This fixes test 241 on xLC: + + "input.y", line 42.11: 1540-0274 (S) The name lookup for "report" did not find a declaration. + "input.y", line 42.11: 1540-1292 (I) Static declarations are not considered for a function call if the function is not qualified. + + where report is: + + static void + report (std::ostream& yyo, int ival, float fval) + { + yyo << "ival: " << ival << ", fval: " << fval; + } + + and line 42 is: + + %printer { report (yyo, $$, $$); } ; + + It turns out that indeed this function must not be declared static, + . Let's put it into an + anonymous namespace. + + Reported by Thomas Jahns. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html + + * tests/actions.at (Qualified $$ in actions): Don't use "static", + prefer anonymous namespace. + +2015-01-20 Akim Demaille + + tests: fix a title + * tests/conflicts.at: De-overquote. + +2015-01-20 Akim Demaille + + c++: reserve 200 slots in the parser's stack + This is consistent with what is done with yacc.c and glr.c. Because + it also avoids that the stack needs to be resized very soon, it should + help keeping tests about destructors more reliable. + + Indeed, if the stack is created too small, very soon the C++ library + needs to enlarge it, which means creating a new one, copying the + elements from the initial one onto it, and then destroy the elements + of the initial stack: that would be a spurious call to a destructor. + + Reported by Thomas Jahns. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html + + * data/stack.hh (stack::stack): Reserve 200 slots. + * tests/c++.at: Remove traces of stack expansions. + +2015-01-20 Akim Demaille + + tests: be more robust to unrecognized synclines, and try to recognize xlc + Reported by Thomas Jahns. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html + + * tests/synclines.at (AT_SYNCLINES_COMPILE): Rename as... + (_AT_SYNCLINES_COMPILE): this. + Try to recognize xlc locations. + (AT_SYNCLINES_COMPILE): New. Skips the test if we can't read the + synclines. + +2015-01-20 Akim Demaille + + tests: fix C++ conformance + Reported by Thomas Jahns. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00059.html + + * tests/c++.at (Exception safety): Add missing include. + Don't use const_iterator for erase. + +2015-01-18 Akim Demaille + + build: fix some warnings + Reported by John Horigan. + http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00034.html + + * src/graphviz.c, src/symtab.h: Address compiler warnings. + +2015-01-16 Akim Demaille + + build: avoid infinite recursions on include_next + On MacOS X 10.5 PPC with Apple's GCC 4.0.1: + + % uname -a + Darwin aria.cielonegro.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:0 + 1 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh + % gcc --version + powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493) + Copyright (C) 2005 Free Software Foundation, Inc. + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + building in place enters into an infinite recursion on "#include_next": + + % gmake V=1 + [snip] + depbase=`echo lib/math.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ + gcc -std=gnu99 -I. -Ilib -I. -I./lib -g -O2 -MT lib/math.o -MD -MP -MF $depbase.Tpo -c -o lib/math.o lib/math.c &&\ + mv -f $depbase.Tpo $depbase.Po + In file included from lib/math.h:27, + from lib/math.h:27, + from lib/math.h:27, + from lib/math.h:27, + [snip] + from lib/math.h:27, + from lib/math.h:27, + from lib/math.c:3: + lib/math.h:27:23: error: #include nested too deeply + Makefile:3414: recipe for target 'lib/math.o' failed + gmake[2]: *** [lib/math.o] Error 1 + + Using -I./lib instead of -Ilib fixes the problem. + + Reported by Pho. + + + * Makefile.am (AM_CPPFLAGS): Use -I./lib instead of -Ilib. + +2015-01-16 Akim Demaille + + doc: minor fixes + * doc/bison.texi: Fix warnings about colon in reference names. + * data/bison.m4, src/files.h: Fix comments. + * doc/Doxyfile.in: update. + +2015-01-15 Akim Demaille + + gnulib: strtoul is considered obsolete and now useless + * bootstrap.conf: here. + +2015-01-15 Akim Demaille + + c++: avoid warnings when destructors don't use $$ + * data/c++.m4: here. + +2015-01-15 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2015-01-15 Akim Demaille + + version 3.0.3 + * NEWS: Record release date. + +2015-01-15 Akim Demaille + + gnulib: update + +2015-01-13 Akim Demaille + + tests: split a large test case into several smaller ones + * tests/conflicts.at (AT_CONSISTENT_ERRORS_CHECK): Move AT_SETUP/AT_CLEANUP + into it, so that we don't skip non Java tests following a test case in Java. + +2015-01-12 Akim Demaille + + package: a bit of trouble shooting indications + * README-hacking: here. + +2015-01-12 Akim Demaille + + doc: liby's main arms the internationalization + Reported by Nicolas Bedon. + + + * doc/bison.texi (Yacc Library): Document the call the setlocale. + +2015-01-09 Akim Demaille + + bison: avoid warnings from static code analysis + A static analysis tool reports that some callers of symbol_list_n_get + might get NULL and not handle it properly. This is not the case, yet + we can suppress this pattern. + + Reported by Mike Sullivan. + + + * src/symlist.c (symbol_list_n_get): Actually it is never called + to return 0. Enforce this postcondition via aver. + (symbol_list_n_type_name_get): Simplify accordingly. In particular, + discards a (translated) useless error message. + * src/symlist.h: Adjust documentation. + * src/scan-code.l: Style change. + +2015-01-09 Akim Demaille + + c++: fix the use of destructors when variants are enabled + When using variants, destructors generate invalid code. + + Reported by Michael Catanzaro. + + * data/c++.m4 (~basic_symbol): b4_symbol_foreach works on yysym: + define it. + * tests/c++.at (Variants): Check it. + +2015-01-08 Akim Demaille + + style: tests: simplify the handling of some C++ tests + * tests/c++.at: here. + (Doxygen): Pass %define, so that files such as position.hh etc. + are generated, instead of putting everything into input.hh. + +2015-01-08 Akim Demaille + + c++: symbols can be empty, so use it + The previous patches ensure that symbols (symbol_type and + stack_symbol_type) can be empty, cleared, and their emptiness can be + checked. Therefore, yyempty, which codes whether yyla is empty or + not, is now useless. + + In C skeletons (e.g., yacc.c), the fact that the lookahead is empty is + coded by "yychar = YYEMPTY", which is exactly what this patch + restores, since yychar/yytoken corresponds to yyla.type. + + * data/lalr1.cc (yyempty): Remove. + Rather, depend on yyla.empty (). + +2015-01-08 Akim Demaille + + c++: variants: don't leak the lookahead in error recovery + During error recovery, when discarding the lookeahead, we don't + destroy it, which is caught by parse.assert assertions. + + Reported by Antonio Silva Correia. + With an analysis and suggested patch from Michel d'Hooge. + + + * tests/c++.at (Variants): Strengthen the test to try syntax errors + with discarded lookahead. + +2015-01-08 Akim Demaille + + c++: provide a means to clear symbols + The symbol destructor is currently the only means to clear a symbol. + Unfortunately during error recovery we might have to clear the + lookahead, which is a local variable (yyla) that has not yet reached + its end of scope. + + Rather that duplicating the code to destroy a symbol, or rather than + destroying and recreating yyla, let's provide a means to clear a + symbol. + + Reported by Antonio Silva Correia, with an analysis from Michel d'Hooge. + + + * data/c++.m4, data/lalr1.cc (basis_symbol::clear, by_state::clear) + (by_type::clear): New. + (basic_symbol::~basic_symbol): Use clear. + +2015-01-08 Akim Demaille + + c++: clean up the handling of empty symbols + * data/c++.m4, data/lalr1.cc (yyempty_): Remove, replaced by... + (empty_symbol, by_state::empty_state): these. + (basic_symbol::empty): New. + +2015-01-08 Akim Demaille + + c++: comment and style changes + * data/c++.m4, data/lalr1.cc: More documentation. + Tidy. + * tests/c++.at (string_cast): Rename as... + (to_string): this C++11 name. + +2015-01-07 Akim Demaille + + c++: variants: comparing addresses of typeid.name() is undefined + Instead of storing and comparing pointers to names of types, store + pointers to the typeids, and compares the typeids. + Reported by Thomas Jahns. + + + * data/variant.hh (yytname_): Replace with... + (yytypeid_): this. + +2015-01-05 Akim Demaille + + c++: locations: complete the API and fix comments + There are no support for += between locations, and some comments are wrong. + Reported by Alexandre Duret-Lutz. + + * data/location.cc: Fix. + * doc/bison.texi: Document. + * tests/c++.at: Check. + +2015-01-05 Akim Demaille + + build: do not clean figure sources in make clean + "make clean && make" fails in in-tree builds. + + * doc/local.mk (CLEANDIRS): Replace with... + (CLEANFILES): this safer list of files to clean. + +2015-01-05 Akim Demaille + + build: don't try to generate docs when cross-compiling + When cross-compiling don't run the generated bison to update the docs. + Reported by Aaro Koskinen. + + + * configure.ac (CROSS_COMPILING): New. + * doc/local.mk: Use it. + +2015-01-04 Akim Demaille + + package: fix a reporter's name + * THANKS, build-aux/git-log-fix: s/Bernd Edligner/Bernd Edlinger/. + +2015-01-04 Akim Demaille + + %union: fix the support for named %union + Bison supports a union tag, for obscure reasons. But it does a poor + job at it, especially since Bison 3.0. + Reported by Stephen Cameron and Tobias Frost. + + It did not ensure that the name was not given several times. An easy + way to do this is to make the %union tag be handled as a %define + variable, as they cannot be defined several times. + + Since Bison 3.0, the synclines were wrongly placed, resulting in + invalid code. Addressing this issue, because of the way the union tag + was stored (as a code muscle), would have been tedious. Unless we + rather define the %union tag as a %percent variable, whose synclines + are easier to manipulate. + + So replace the b4_union_name muscle by the api.value.union.name + %define variable, document, and check. + + * data/bison.m4: Make sure that api.value.union.name has a keyword value. + * data/c++.m4: Make sure that api.value.union.name is not defined. + * data/c.m4 (b4_union_name): No longer use it, use api.value.union.name. + * doc/bison.texi (%define Summary): Document it. + * src/parse-gram.y (union_name): No longer define b4_uion_name, but + api.value.union.name. + * tests/input.at (Redefined %union name): New. + * tests/synclines.at (%union name syncline): New. + * tests/types.at: Check named %unions. + +2015-01-04 Akim Demaille + + package: bump to 2015 + Which also requires: + + * gnulib: Update. + +2014-12-31 Akim Demaille + + flex: don't trust YY_USER_INIT + Reported by Bernd Edlinger and others. + + * src/scan-gram.l: here. + +2014-12-31 Akim Demaille + + yacc.c: fix broken union when api.value.type=union and %defines are used + Reported by Rich Wilson. + + * data/c.m4 (b4_symbol_type_register): Append to b4_union_members, + not b4_user_union_members. + The latter invokes the former, but it is the former which is reinitialized + to empty by b4_value_type_setup_union. + * tests/types.at: Check it. + + This reveals another bug, this time in the case of glr.c parsers. + + * data/glr.c: Generate the header file before the implementation file, + to be sure that the setup is run before what depends on it. + +2014-12-31 Akim Demaille + + doc: fix missing xref + Reported by xolodho. + + * doc/bison.texi (Printer Decl): here. + +2014-12-29 Akim Demaille + + gnulib: update + +2014-02-03 Akim Demaille + + location: remove some ugly debugging code traces + * data/location.cc: here. + +2014-02-03 Akim Demaille + + build: use abort to pacify compiler errors + clang, with -DNDEBUG and -Werror fails on some functions that might + lack a return. This is because aver is just another assert, discarded + with -DNDEBUG. So use abort. + + * src/muscle-tab.c, src/scan-skel.l: here. + +2014-02-03 Akim Demaille + + package: bump to 2014 + * AUTHORS, ChangeLog-2012, Makefile.am, NEWS, PACKAGING, README, + * README-alpha, README-hacking, THANKS, TODO, bootstrap.conf, + * build-aux/darwin11.4.0.valgrind, build-aux/local.mk, + * build-aux/update-b4-copyright, + * build-aux/update-package-copyright-year, cfg.mk, configure.ac, + * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4, + * data/c-like.m4, data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc, + * data/java-skel.m4, data/java.m4, data/lalr1.cc, data/lalr1.java, + * data/local.mk, data/location.cc, data/stack.hh, data/variant.hh, + * data/xslt/bison.xsl, data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl, + * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint, + * djgpp/README.in, djgpp/config.bat, djgpp/config.sed, + * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat, + * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h, + * djgpp/testsuite.sed, doc/bison.texi, doc/local.mk, doc/refcard.tex, + * etc/README, etc/bench.pl.in, etc/local.mk, + * examples/calc++/calc++.test, examples/calc++/local.mk, + * examples/extexi, examples/local.mk, examples/mfcalc/local.mk, + * examples/mfcalc/mfcalc.test, examples/rpcalc/local.mk, + * examples/rpcalc/rpcalc.test, examples/test, examples/variant.yy, + * lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c, + * lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h, + * lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c, + * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c, + * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h, + * lib/local.mk, lib/main.c, lib/timevar.c, lib/timevar.def, + * lib/timevar.h, lib/vbitset.c, lib/vbitset.h, lib/yyerror.c, + * m4/bison-i18n.m4, m4/c-working.m4, m4/cxx.m4, m4/flex.m4, + * m4/timevar.m4, src/AnnotationList.c, src/AnnotationList.h, + * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c, src/LR0.h, + * src/Sbitset.c, src/Sbitset.h, src/assoc.c, src/assoc.h, + * src/closure.c, src/closure.h, src/complain.c, src/complain.h, + * src/conflicts.c, src/conflicts.h, src/derives.c, src/derives.h, + * src/files.c, src/files.h, src/flex-scanner.h, src/getargs.c, + * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c, + * src/graphviz.h, src/ielr.c, src/ielr.h, src/lalr.c, src/lalr.h, + * src/local.mk, src/location.c, src/location.h, src/main.c, + * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c, + * src/named-ref.h, src/nullable.c, src/nullable.h, src/output.c, + * src/output.h, src/parse-gram.c, src/parse-gram.y, src/print-xml.c, + * src/print-xml.h, src/print.c, src/print.h, src/print_graph.c, + * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c, + * src/reduce.h, src/relation.c, src/relation.h, src/scan-code.h, + * src/scan-code.l, src/scan-gram.h, src/scan-gram.l, src/scan-skel.h, + * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c, + * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h, + * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h, + * tests/actions.at, tests/atlocal.in, tests/bison.in, tests/c++.at, + * tests/calc.at, tests/conflicts.at, tests/cxx-type.at, + * tests/existing.at, tests/glr-regression.at, tests/headers.at, + * tests/input.at, tests/java.at, tests/javapush.at, tests/local.at, + * tests/local.mk, tests/named-refs.at, tests/output.at, tests/push.at, + * tests/reduce.at, tests/regression.at, tests/sets.at, + * tests/skeletons.at, tests/synclines.at, tests/testsuite.at, + * tests/torture.at, tests/types.at: + here. + +2014-01-03 Paul Eggert + + doc: specify documentation encoding + * doc/bison.texi: Add '@documentencoding UTF-8'; needed since the + manual contains UTF-8 characters. This will cause the .info files + to contain UTF-8 quotes and the like, which should be OK nowadays. + Add @documentlanguage while we're at it. + +2013-12-09 Akim Demaille + + package: install the examples + Currently, we do not install the various examples extracted from the + documentation. Let's do it, as they are useful starting points. + + * configure.ac: When --enable-gcc-warnings is set, enable ENABLE_GCC_WARNINGS. + * examples/extexi: No longer issue synclines by default. + * examples/local.mk: Except if ENABLE_GCC_WARNINGS. + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk: Install the example files. + +2013-12-09 Akim Demaille + + package: install README and the like in docdir + * Makefile.am: here. + +2013-12-09 Akim Demaille + + diagnostics: fix the order of multiple declarations reports + On + + %token FOO "foo" + %printer {} "foo" + %printer {} FOO + + we report + + /tmp/foo.yy:2.10-11: error: %printer redeclaration for FOO + %printer {} "foo" + ^^ + /tmp/foo.yy:3.10-11: previous declaration + %printer {} FOO + ^^ + + * src/symtab.c (locations_sort): New. + Use it. + * tests/input.at (Invalid Aliases): Stress the order of diagnostics. + +2013-12-09 Akim Demaille + + symbol: provide an easy means to compare them in source order + * src/symtab.c (symbols_sort): New. + (user_token_number_redeclaration): Taken from here. + +2013-12-05 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-12-05 Akim Demaille + + version 3.0.2 + * NEWS: Record release date. + +2013-12-05 Akim Demaille + + gnulib: update + * gnulib: here. + +2013-12-04 Akim Demaille + + output: do not generate source files when late errors are caught + Reported by Alexandre Duret-Lutz as "second problem" in: + http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html + + * bootstrap.conf: We need the "unlink" module. + * src/files.h, src/files.c (unlink_generated_sources): New. + * src/output.c: Use it. + * tests/output.at: Check the case of late errors. + +2013-12-04 Akim Demaille + + output: record what generated files are source or report files + * src/files.h, src/files.c (output_file_name_check): Take an additional + argument to record whether a file is a source or report file. + * src/files.c (generated_file): New. + (file_names, file_names_count): Replace with... + (generated_files, generated_files_size): these. + * src/scan-skel.l: Adjust. + +2013-12-04 Akim Demaille + + output: do not generate source files when early errors are caught + Reported by Alexandre Duret-Lutz as "second problem" in: + http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html + + One problem is that some errors are caught early, before the + generation of output files, while others can only be detected + afterwards (since, for instance, skeletons can raise errors + themselves). + + This will be addressed in two steps: early errors do not generate + source files at all, while later errors will remove the files that + have already been generated. + + * src/scan-skel.l (yyout): Open to /dev/null when there are errors. + * tests/output.at (AT_CHECK_FILES): Factored out of... + (AT_CHECK_OUTPUT): this. + Fuse the "SHELLIO" argument in the "FLAGS" one. + Use $5 to denote the expected exit status. + Add a test case for early errors. + +2013-11-26 Akim Demaille + + xml: also use "%empty" with html output + * data/xslt/xml2xhtml.xsl: No longer issue an Epsilon, display as in + dot and text formats. + +2013-11-26 Akim Demaille + + style: formatting changes + * src/print-xml.c: here. + +2013-11-26 Akim Demaille + + xml: also display %empty for empty right-hand sides + * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl: Display %empty where needed. + +2013-11-26 Akim Demaille + + reports: display %empty in the generated pointed-rules + * src/print.c (print_core): Use %empty for empty rules. + * src/print_graph.c (print_core): Ditto. + * tests/conflicts.at, tests/output.at, tests/reduce.at: Adjust + expectations. + +2013-11-26 Akim Demaille + + news: YYERROR vs variants + +2013-11-18 Akim Demaille + + style: scope reduction in lalr.cc + * src/lalr.c: Shorten variable scopes. + (lookahead_tokens_print): Use the same variable name in two loops + iterating over the same structure. + +2013-11-15 Akim Demaille + + lalr1.cc: formatting changes + * data/lalr1.cc: Fix indentation. + +2013-11-15 Akim Demaille + + lalr1.cc: fix the support of YYERROR with variants + When variant are enabled, the yylhs variable (the left-hand side of + the rule being reduced, i.e. $$ and @$) is explicitly destroyed when + YYERROR is called. This is because before running the user code, $$ + is initialized, so that the user can properly use it. + + However, when quitting yyparse, yylhs is also reclaimed by the C++ + compiler: the variable goes out of scope. + + Instead of trying to be too smart, let the compiler do its job: reduce + the scope of yylhs to exactly the reduction. This way, whatever the + type of scope exit (regular, exception, return, goto...) this variable + will be properly reclaimed. + + Reported by Paolo Simone Gasparello. + + + * data/lalr1.cc (yyparse): Reduce the scope of yylhs. + * tests/c++.at: We now pass this test. + +2013-11-15 Akim Demaille + + tests: check $$'s destruction with variant, YYERROR, and no error recovery + When variant are enabled, the yylhs variable (the left-hand side of + the rule being reduced, i.e. $$ and @$) is explicitly destroyed when + YYERROR is called. This is because before running the user code, $$ + is initialized, so that the user can properly use it. + + However, when quitting yyparse, yylhs is also reclaimed by the C++ + compiler: the variable goes out of scope. + + This was not detected by the test suite because (i) the Object tracker + was too weak, and (ii) the problem does not show when there is error + recovery. + + Reported by Paolo Simone Gasparello. + + + * tests/c++.at (Exception safety): Improve the objects logger to make + sure that we never destroy twice an object. + Also track copy-constructors. + Use a set instead of a list. + Display the logs before running the function body, this is more + useful in case of failure. + Generalize to track with and without error recovery. + +2013-11-15 Akim Demaille + + tests: simplify useless obfuscation + * tests/c++.at: $$ is not special for M4, there is no need to "escape" + it. + +2013-11-14 Akim Demaille + + skeletons: use better names when computing a "goto" + * data/glr.c (yyLRgotoState): Name the symbol argument yysym, instead + of yylhs. + * data/lalr1.cc (yy_lr_goto_state_): Likewise. + * data/lalr1.java (yy_lr_goto_state_): New, modeled after the previous + two routines. + Use it. + +2013-11-12 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-11-12 Akim Demaille + + version 3.0.1 + * NEWS: Record release date. + +2013-11-12 Akim Demaille + + aver: it is no longer "protected against NDEBUG" + Apply the same rules for aver as for assert: no side effects, + especially not important ones. + + * src/AnnotationList.c, src/muscle-tab.c: Adjust aver uses to resist + to -DNDEBUG. + +2013-11-08 Akim Demaille + + parsers: rename YY_NULL as YY_NULLPTR to avoid conflicts with Flex + Flex also defines YY_NULL (to 0). Avoid gratuitous conflicts. + + * data/c.m4 (b4_null_define): Rename YY_NULL as YY_NULLPTR. + + * data/glr.c, data/lalr1.cc, data/location.cc, data/variant.hh, + * data/yacc.c, src/parse-gram.c, tests/actions.at, tests/c++.at, + * tests/cxx-type.at, tests/glr-regression.at, tests/headers.at, + * tests/push.at, tests/regression.at: + Adjust. + +2013-11-05 Akim Demaille + + build: use Automake 1.14's non-recursive Makefile features + * configure.ac: Require Automake 1.14. + * examples/calc++/local.mk, examples/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk, tests/local.mk: Use %D% and %C%. + +2013-11-05 Akim Demaille + + build: restore maintainer-push-check + * tests/local.mk: here. + +2013-11-05 Akim Demaille + + c++: use __attribute__((__pure__)) to avoid warnings + Building C++ parsers with -Wsuggest-attribute=const and + -Wsuggest-attribute=noreturn triggers warning in generated code. + + * data/lalr1.cc: Call b4_attribute_define. + (debug_stream, debug_level): Flag as pure. + * tests/headers.at (Several parsers): There are now more YY macros + that "leak". + +2013-11-05 Akim Demaille + + skeletons: update the handling of compiler attributes + * data/c.m4 (b4_attribute_define): Instead of defining __attribute__, + define YY_ATTRIBUTE conditionally. + (YY_ATTRIBUTE_PURE, YY_ATTRIBUTE_UNUSED, _Noreturn): New. + Use them. + * data/glr.c: Use them. + +2013-11-05 Akim Demaille + + gnulib: update + +2013-10-24 Akim Demaille + + style: use /* ... */ comments + * src/complain.c: Here. + +2013-10-24 Akim Demaille + + tests: skip C++ tests that are too demanding for some compilers + Some tests now fail when compiled with G++ 4.3 or 4.4 on MacPorts. + + * tests/local.at (AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR): New. + * tests/c++.at (Exception safety): Use it. + +2013-10-22 Akim Demaille + + install: do not install yacc.1 when --disable-yacc + * configure.ac (ENABLE_YACC): New conditional. + (YACC_SCRIPT, YACC_LIBRARY): Remove. + * lib/local.mk, src/local.mk: Use the former instead of the latter. + * doc/local.mk: Use ENABLE_YACC to avoid installing yacc.1. + +2013-10-22 Akim Demaille + + style: avoid tabs + * src/scan-code.l: here. + +2013-10-22 Akim Demaille + + c++: fix generated doxygen comments + * configure.ac: Enable -Wdocumentation if supported. + * data/lalr1.cc: Fix comments. + +2013-10-22 Akim Demaille + + fix: uniqstr are already pointers + * src/uniqstr.c (uniqstr_assert): Remove incorrect double indirection, + and now useless cast. + +2013-10-22 Paul Eggert + + bison: pacify Sun C 5.12 + * src/scan-code.l (show_sub_message): + Redo initializations to work around a bogus Sun C 5.12 warning. + (parse_ref): Remove unreachable code that Sun C 5.12 complains about. + * src/uniqstr.h (uniqstr_vsprintf): Use + _GL_ATTRIBUTE_FORMAT_PRINTF (...) instead of __attribute__ + ((__format__ (__printf__, ...))). Otherwise, Sun C 5.12 + complains about an unknown attribute. + +2013-10-22 Paul Eggert + + maint: git now ignores rpcalc + * examples/rpcalc/.gitignore: Ignore rpcalc. + +2013-10-22 Paul Eggert + + build: examples/calc++/calc++ requires flex + * configure.ac (FLEX_CXX_WORKS): New AM_CONDITIONAL. + * examples/calc++/local.mk (examples/calc++/calc++): + Build if FLEX_CXX_WORKS, not BISON_CXX_WORKS. + +2013-10-22 Paul Eggert + + maint: mention help2man, texinfo, apt-get + * README-hacking: Add help2man, texinfo. + Describe how to add packages if you're using Debian. + +2013-10-22 Paul Eggert + + maint: git now ignores .log and .trs files + * .gitignore: Add *.log, *.trs. + +2013-10-21 Akim Demaille + + tests: fix incorrect object construction + Reported by Ken Moffat. + http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00009.html + + * tests/c++.at (Exception safety): Here. + +2013-10-16 Akim Demaille + + glr: allow spaces between "%?" and "{" in predicates + Reported by Rici Lake. + http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00004.html + http://stackoverflow.com/questions/19330171/ + + * src/scan-gram.l: Do not try to be too smart when diagnosing invalid + directives. + * tests/glr-regression.at (Predicates): New test. + +2013-10-16 Akim Demaille + + diagnostics: "-Werror -Wno-error=foo" must not emit errors + Currently "-Werror -Wno-error=foo" still turns "foo" warnings into errors. + Reported by Alexandre Duret-Lutz. + See http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html. + + * src/complain.c (errority, errority_flag): New. + (complain_init): Initialize the latter. + (warning_argmatch): Extract the loop iterating on the flag's bits. + Set and unset errority_flag here. + (warnings_argmatch): -Wno-error is not the same as -Wno-error=everything: + we must remember if category foo was explicitly turned in an error/warning + via -W(no-)error=foo. + (warning_severity): Use errority_flag. + + * tests/input.at (Symbols): Just check --yacc, not -Wyacc, that's the + job of tests on -W. + (-Werror is not affected by -Wnone and -Wall): Rename as... + (-Werror combinations): this. + Tests more combinations of -W, -W(no-)error, and -W(no-)error=foo. + * tests/local.at (AT_BISON_CHECK_WARNINGS): Don't expect -Werror + to turn runs that issue warnings into runs with errors, as the + warnings might be enforced as warnings by -Wno-error=foo, in which + case -Werror does not change anything. + + * doc/bison.texi (Bison Options): Try to be clearer about how + -W(no-)error and -W(no-)error=foo interact. + +2013-10-16 Akim Demaille + + comment changes + * src/complain.h, src/complain.c: More documentation, more comments. + +2013-10-04 Andreas Schwab + + location: fix EOF check + * location.c (location_caret): Use int, not char, for values from + getc. + +2013-09-19 Akim Demaille + + style: variant: remove empty line + * data/variant.hh (b4_symbol_constructor_define_): Remove + stray eol. + +2013-09-19 Akim Demaille + + glr: more assertions + * data/glr.c (yyaddDeferredAction, yyglrShiftDefer, yypdumpstack): + More assertions. + +2013-09-19 Akim Demaille + + glr: shorten scopes + * data/glr.c (yyglrReduce): Define yyflag with its value. + +2013-09-19 Akim Demaille + + glr: formatting changes + * data/glr.c: here. + +2013-09-19 Akim Demaille + + glr: better use of tracing macros + * data/glr.c (yydestroyGLRState): Use YY_SYMBOL_PRINT instead of + yy_symbol_print. + +2013-09-19 Akim Demaille + + examples: improve the output of the "variant" example + * examples/variant.yy: Improve the printing of lists. + +2013-09-19 Akim Demaille + + variant: remove useless assertion + * data/variant.hh (move): Remove precondition assertion which is + ensured by the first call of the body (this precondition is also one + of "build"). + +2013-09-19 Akim Demaille + + tests: remove stray debugging traces + * tests/atlocal.in: Remove traces. + Be ready to remove conftest.dSYM generated on OS X. + +2013-09-04 Akim Demaille + + tests: do not use grep -q + Reported by Daniel Galloway. + http://lists.gnu.org/archive/html/bug-bison/2013-08/msg00020.html + + * tests/java.at: Ignore grep's output instead. + +2013-08-25 Paul Eggert + + build: don't require flex for ordinary builds + * configure.ac (LEX): Don't fail if this is lex, as flex is not + required for ordinary builds. Instead, issue a warning and + substitute a no-op LEX. Reported by Michael Felt in + . + +2013-08-25 Paul Eggert + + maint: update .gitignore + * .gitignore: Add *.eps, *.o, *.pdf, *.png, *.stamp, *~, + .deps, .dirstamp. Needed to suppress unwanted chatter from + 'git status' after a bootstrap build. + +2013-08-24 Paul Eggert + + build: port to pre-5.8.7 perl + * examples/local.mk (extract): Omit -f from perl options. + This doesn't work with perl versions before 5.8.7 + that are configured without USE_SITECUSTOMIZE. + Reported by Michael Felt in + . + +2013-08-01 Akim Demaille + + tests: minor change to make it easier to test other skeletons + * tests/c++.at (Variants): Pass the skeleton as argument. + +2013-08-01 Valentin Tolmer + + uniqstr: fix assertion + * src/uniqstr.c (uniqstr_assert): Really make sure str is a uniqstr, + not just whether some uniqstr with the same content was registered. + +2013-08-01 Akim Demaille + + build: ship the ASCII art figures + We don't ship the *.txt files that are used to build the info + file. + Reported by Colin Daley. + + * doc/figs/example.txt: New. + * doc/local.mk (bison.info): Depend on the txt files. + And ship them. + +2013-08-01 Akim Demaille + + doc: prefer the ".gv" extension to ".dot" + See http://marc.info/?l=graphviz-devel&m=129418103126092 for the + motivation (basically, some word processor now uses *.dot). + + * doc/figs/example-reduce.dot: Rename as... + * doc/figs/example-reduce.gv: this. + * doc/figs/example-shift.dot: Rename as... + * doc/figs/example-shift.gv: this. + * doc/figs/example.dot: Rename as... + * doc/figs/example.gv: this. + * doc/local.mk: Adjust. + +2013-07-25 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-07-25 Akim Demaille + + version 3.0 + * NEWS: Record release date. + +2013-07-25 Akim Demaille + + regen + +2013-07-25 Akim Demaille + + news: prepare 3.0 + * NEWS (3.0): Reorder. + +2013-07-25 Akim Demaille + + tests: fix invalid assignment when using variants in C++11 + * tests/c++.at (Exception safety): In variant mode $$ is an instance + of Object. Assigning YY_NULL in C++98 is incorrect, but behaves ok, + as it assigns YY_NULL=0 using Object::operator= (char v). It is wrong + in C++11 as there is operator for "$$ = nullptr". + +2013-07-25 Akim Demaille + + yacc: beware of "uninitialized uses" warnings + Again some issues with the fact that yylval is reported by GCC as + possibly not initialized in some cases. Here, the case at hand is the + %destructor. + + I am still not convinced that it is worth going all the trouble of + using pragmas to disable temporarily some warnings, instead of just + initializing the looking symbol once for all, but that's what Paul + voted for, see + . + + * data/c.m4 (b4_attribute_define): Define + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, + YY_INITIAL_VALUE here, as we will need them in the generation of the + destructor function, which is defined in yacc.c before yyparse, which + was in charge of defining these macros. + * data/yacc.c (b4_declare_scanner_communication_variables): Simplify: + trying to factor the definitions of the case pure and impure is + too complex. + Actually, it is not even clear that this macro should really exist, + as even the calls are complex. + Be careful not to issue a lone ";", as this is a statement, and C90 + forbids declarations after statements ; so write + "YY_INITIAL_VALUE(Decl;)", not "YY_INITIAL_VALUE(Decl);". + +2013-07-25 Akim Demaille + + gnulib: update + +2013-07-03 Akim Demaille + + tests: skip C++ tests if we can't compile a simple program + There are possible conflicts between gnulib replacement functions (in + ) and their C++ wrappers (in ). Trying to address + these in configure seems too hard, and I don't know how to fix the issue + in gnulib. Cowardly avoid the problem by skipping C++ tests when this + happens. + Reported by Stefano Lattarini. + http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00001.html + + * tests/atlocal.in (BISON_CXX_WORKS): Also set it to "skip" if we can't + compile a simple program using . + * tests/local.at: Comment changes. + +2013-07-03 Akim Demaille + + tests: fix 'find' portability issues + Reported by Stefano Lattarini. + http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00000.html + + * tests/output.at (AT_CHECK_OUTPUT): Use Perl instead. + +2013-06-24 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-06-24 Akim Demaille + + version 2.7.91 + * NEWS: Record release date. + +2013-06-24 Akim Demaille + + NEWS: prepare for 2.7.91 + * NEWS (2.7.91): Java push parsers. + +2013-06-24 Akim Demaille + + java: rename YYMORE as YYPUSH_MORE for consistency with C + http://lists.gnu.org/archive/html/bison-patches/2013-06/msg00008.html + + * data/lalr1.java, doc/bison.texi, tests/javapush.at: + s/YYMORE/YYPUSH_MORE. + +2013-06-21 Akim Demaille + + tests: fix Java push failure when running with BISON_USE_PUSH_FOR_PULL + * tests/javapush.at (Trivial Push Parser with api.push-pull verification): + When push for pull is enabled, there is one such function generated. + +2013-06-21 Akim Demaille + + style: minor changes in the Java tests + * tests/java.at (AT_CHECK_JAVA_GREP): Ignore the exit status. + * tests/javapush.at (AT_CHECK_JAVA_GREP): Be more alike the previous + one. + Formating changes. + Remove stray debugging "jj" file. + +2013-06-21 Akim Demaille + + java: push: do not reset the error counter + * data/lalr1.java (parse): here, when in push-pull is in "both" mode. + This breaks the test suite, for instance + make check TESTSUITEFLAGS='-d 388 BISON_USE_PUSH_FOR_PULL=1'. + More generally make maintainer-push-check. + +2013-06-14 Akim Demaille + + build: add Valgrind suppression file for GNU/Linux + * build-aux/linux-gnu.valgrind: New. + * build-aux/local.mk: Ship it. + * configure.ac: Use it. + +2013-06-13 Dennis Heimbigner + + java: add push-parser support + * data/lalr1.java: Capture the declarations as m4 macros to avoid + duplication. When push parsing, the declarations occur at the class + instance level rather than within the parse() function. + + Change the way that the parser state is initialized. For + push-parsing, the parse state declarations are moved to + "push_parse_initialize()", which is called on the first invocation of + "push_parse()". The %initial-action code is also inserted after the + invocation of "push_parse_initialize()". + + The body of the parse loop is modified to return values at appropriate + points when doing push parsing. In order to make push parsing work, + it is necessary to divide YYNEWSTATE into two states: YYNEWSTATE and + YYGETTOKEN. On the first call to push_parse(), the state is + YYNEWSTATE. On all later entries, the state is set to YYGETTOKEN. The + YYNEWSTATE switch arm falls through into YYGETTOKEN. YYGETTOKEN + indicates that a new token is potentially needed. Normally, with a + pull parser, this new token would be obtained by calling "yylex()". In + the push parser, the value YYMORE is returned to the caller. On the + next call to push_parse(), the parser will return to the YYGETTOKEN + state and continue operation. + + * tests/javapush.at: New test file for java push parsing. + * tests/testsuite.at: Use it. + * tests/local.mk: Adjust. + * doc/bison.texi (Java Push Parser Interface): New. + +2013-06-11 Akim Demaille + + build: ship all the files, even if the C++ compiler is broken + * examples/calc++/local.mk: Be sure to ship calc++.test even if + the current C++ compiler is not sufficient to run the tests. + +2013-06-05 Dennis Heimbigner + + style: comment changes in Java skeleton + * data/lalr1.java: Here. + +2013-06-03 Akim Demaille + + tests: fix a G++ warning + * tests/c++.at: Use YY_NULL instead of 0 for the null pointer. + And formatting changes. + +2013-06-03 Akim Demaille + + build: fix a warning from clang + * src/muscle-tab.c: Declare local functions static. + +2013-05-30 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-05-30 Akim Demaille + + version 2.7.90 + * NEWS: Record release date. + +2013-05-30 Akim Demaille + + style: syntax-check fixes + * data/yacc.c, src/Sbitset.c, src/Sbitset.h, src/muscle-tab.h, + * src/output.c, src/parse-gram.y, src/reader.c, src/symtab.c, + * src/uniqstr.c, src/uniqstr.h: Fix space before parens. + * cfg.mk (_space_before_paren_exempt): Add needed exceptions. + +2013-05-30 Akim Demaille + + xml: use %empty in the text output + * data/xslt/xml2text.xsl: here. + +2013-05-30 Akim Demaille + + build: locally disable new GCC warnings that fail on Flex generated code + * configure.ac: here. + +2013-05-30 Akim Demaille + + fix a memory leak + * src/print-xml.c (num_escape_bufs): New. + (print_xml): Be sure to release all the escape_bufs. + +2013-05-30 Akim Demaille + + regen + +2013-05-30 Akim Demaille + + build: be sure to include config.h first in the generated parser + Using %code for config.h is wrong, as some headers will already have + been included by Bison. In some cases, e.g., glibc's string.h, this + results in some declaration not being made for lack of definition of + _GNU_SOURCE, which is performed by config.h. + + * src/parse-gram.y: here. + +2013-05-29 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: post-release administrivia + version 2.7.1 + regen + +2013-05-29 Petr Machata + + drop unused options --raw, -n, -e, --include and -I + * --raw appears to be ignored. It was marked as obsolete in the + commit ec3bc39, and documented as no longer supported as of 1.29 + (2001-09-07). Support for %raw appears to have been dropped in + e9955c83 on 2002-06-11, but --raw was kept around. Maybe it's time + to drop it as well? + + * Commit e9955c83 dropped support for %no-parser as well, and + converted it to option. --no-parser was later dropped in 728c4be2 + on 2007-08-12, but -n was kept around, probably as an omission. All + three are documented as removed since 2.3b (2008-05-27). + + * -e existed for a single day in 2001. It was introduced in eeeb962b + on 2001-11-27. The handling was removed in c7925b99 on 2001-11-28, + but "e" was kept in the list of short options. Probably an + omission. + + * --include appears to be dead code. The option sets a variable, but + that variable is not used anywhere. It was added in f6bd5427 on + 2001-11-26 as a %-directive, with comments that it's not yet + implemented. It was converted to a command-line option later, but + doesn't seem to ever have been actually implemented. + +2013-05-28 Akim Demaille + + gnulib: update + +2013-04-22 Akim Demaille + + diagnostics: always point to the first directive + Some directives cannot be used several times (e.g., a given symbol may + only have a single printer). In case of repeated definitions, an + error is issued for the second definition, yet it is not discarded, + and becomes the definition used for the rest of the file. + + This is not consistent with the idea that multiple definitions are not + allowed: discard any repeated directive. + + * src/symtab.c (symbol_type_set, symbol_code_props_set) + (semantic_type_code_props_set, symbol_class_set, symbol_translation): + Discard repeated directives. + * tests/input.at (Default %printer and %destructor redeclared) + (Per-type %printer and %destructor redeclared): Update expectations. + +2013-04-22 Akim Demaille + + tests: factor test for printer/desctructor redefined + * tests/input.at (Default %printer and %destructor redeclared): + Introduce AT_TEST to factor. + +2013-04-22 Akim Demaille + + diagnostics: use appropriate location for useless precedence/associativity + * src/symtab.c (symbol_precedence_set): Use prec_location, not + location (which is the first occurrence of the symbol, possibly just + %token). + Also, as redefinitions are not allowed, keep the first values, not + the subsequent ones. + * tests/conflicts.at, tests/existing.at, tests/regression.at: Adjust. + +2013-04-22 Akim Demaille + + tests: factor duplicate expected warnings + * tests/existing.at: Instead of "t ? abc : aBc", write "a(t?b:B)c". + +2013-04-19 Akim Demaille + + tests: enable -Wsign-compare and fix corresponding warnings + -Wsign-compare was disabled for bison's own code, following gnulib's + approach. However, the generated parsers should not trigger such + warnings. + + Reported by Efi Fogel. + http://lists.gnu.org/archive/html/help-bison/2013-04/msg00018.html + + See also http://stackoverflow.com/questions/16101062 for the weird + "-(unsigned)i" piece of code. + + * configure.ac (warn_tests): Enable -Wsign-compare. + * data/location.cc (position::add_): New. + (position::lines, position::columns): Use it. + * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): Fix signedness issues. + +2013-04-18 Akim Demaille + + muscle: check more cases of %define variables with code values + * data/bison.m4 (b4_percent_define_check_kind): Fix overquotation. + (api.location.type, api.position.type): Check they have code values here. + * data/c++.m4 (api.location.type): No longer checked here. + (parser_class_name): Check it here. + * data/java.m4 (api.value.type, init_throws, lex_throws, parser_class_name) + (throws, annotations, extends, implements): Check they have code values. + * doc/bison.texi: Fix every incorrect occurrence of %define. + Document the additional syntax for %define: code values. + Document the additional syntax for -D/-F: string and code values. + * tests/calc.at, tests/headers.at, tests/input.at, tests/java.at, + * tests/local.at: Fix dependencies. + +2013-04-18 Akim Demaille + + regen + +2013-04-18 Akim Demaille + + parser: do not convert $ and @ in code values of %define variables + * src/parse-gram.y (value: "{...}"): Just strip the braces, but pass + the value as is. + +2013-04-18 Akim Demaille + + parser: no longer use the "braceless" non-terminal + The purpose of this symbol was only to factor function calls. As a + result the actions were indeed simpler, but the grammar was somewhat + uselessly obfuscated. Get rid of this symbol, but introduce functions + to simplify dependencies. + + There is no (intended) changes of behavior here. + + * src/parse-gram.y (strip_braces, translate_code( + (translate_code_braceless): New. + (braceless): Remove, use "{...}" instead, and one of the previous + functions depending on the context. + (STRING, "%{...%}", EPILOGUE): Declare as , instead of , + the difference between both is useless (well, I couldn't make sense of + it, even after having read the initial commit that introduced them). + (%union): Remove the now useless "chars" type. + Adjust the printers. + * src/scan-gram.l: Adjust. + +2013-04-18 Akim Demaille + + regen + +2013-04-18 Akim Demaille + + style: avoid %{...%} in our parser + * src/parse-gram.y (%{...%}): Split in %code and %code requires. + * src/location.h: Add missing includes for self containedness. + +2013-04-18 Akim Demaille + + style: use %code for local function declarations in our parser + * src/parse-gram.y (version_check, gram_error, char_name, lloc_default): + Move their prototypes from %{...%} to %code. + (YYLLOC_DEFAULT, YY_LOCATION_PRINT): Move from %{...%} to %code. + (current_lhs): Move its implementation to the epilogue. + +2013-04-16 Akim Demaille + + regen + +2013-04-16 Akim Demaille + + muscle: check the kind of api.prefix, api.location.type + * data/bison.m4: Check api.prefix. + * data/c++.m4: Check api.location.type. + * doc/bison.texi: Fix uses of api.value.type, api.prefix, api.location.type. + Document {...} values for %define. + * src/parse-gram.y: Fix use of api.prefix. + * tests/calc.at: Fix uses of api.location.type. + * tests/input.at: Check api.prefix, and api.location.type. + +2013-04-15 Akim Demaille + + maint: post-release administrivia + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * cfg.mk (old_NEWS_hash): Auto-update. + +2013-04-15 Akim Demaille + + version 2.7.1 + * NEWS: Record release date. + +2013-04-15 Akim Demaille + + regen + +2013-04-15 Akim Demaille + + muscle: enforce definition syntax for keyword variables + * src/muscle-tab.c (muscle_percent_define_get_kind) + (muscle_percent_define_check_kind): New. + (muscle_percent_define_default): Variables with a default value are + of "keyword" kind. + (muscle_percent_define_flag_if, muscle_percent_define_check_values): + Check that the variable is of keyword kind. + * data/bison.m4: Likewise, but in M4. That is to say... + (b4_percent_define_default): Define the kind when the variable is undefined. + (b4_percent_define_check_kind): Use a better error message. + (_b4_percent_define_check_values, _b4_percent_define_check_values): + Former "enum" variables should be defined using the keyword syntax. + * doc/bison.texi: Update. + A couple of fixes. + * tests/input.at (%define keyword variables): New. + +2013-04-15 Akim Demaille + + muscle: let -D/-F support the three kinds of %define variable values + See http://lists.gnu.org/archive/html/bison-patches/2013-04/msg00012.html + + * src/getargs.c (getargs): Recognize {value} and "value" for -D and -F. + +2013-04-15 Akim Demaille + + muscle: minor refactoring + * src/muscle-tab.c (muscle_percent_define_default): Reduce the scopes. + +2013-04-15 Akim Demaille + + muscle: minor simplification which uncovers a missing warning + * src/muscle-tab.c (muscle_percent_define_ensure): Discover the virtues + of || to factor conditionals. + * NEWS: As api.pure is no longer flagged as "used" by accident, + we now have warnings for useless definitions. + * tests/calc.at: So remove api.pure settings when running C++ tests, + since C++ skeletons use a pure interface. + +2013-04-15 Akim Demaille + + muscle: factor the field retrieval + * src/muscle-tab.c (muscle_percent_define_get_raw): New. + Use it where appropriate. + (location_decode): No longer fetch the value from the table, + take the value as argument. + +2013-04-15 Akim Demaille + + muscle: factor the handling of used variables + * src/muscle-tab.c (muscle_percent_define_use): New, corresponding + to b4_percent_define_use. + Use it where appropriate. + +2013-04-15 Akim Demaille + + muscle: factor the computation of variable names + * src/muscle-tab.c (muscle_name): New. + Use it. + Propagate "uniqstr" as value type instead of plain "char const *". + 2013-04-15 Akim Demaille - version 2.7.1 - * NEWS: Record release date. + muscle: factor the kind check in M4 + * data/bison.m4 (b4_percent_define_check_kind): New. + Use it to check api.token.prefix. + * data/c++.m4: Check the kind of api.namespace. + * doc/bison.texi: Update a reference to former 'namespace' variable. + * tests/input.at ("%define" code variables): Check api.namespace. + +2013-04-15 Akim Demaille + + muscle: factor conditionals on defined %define variables + * data/bison.m4 (b4_percent_define_ifdef_): New. + Use it where appropriate. + +2013-04-11 Akim Demaille + + api.token.prefix: use code values + * data/bison.m4: Remove useless (and incorrect: m4_* instead of b4_*) + default assignment to api.token.prefix. + Check that api.token.prefix is assigned code. + * tests/input.at (%define code variables): New test. + * NEWS, doc/bison.texi, tests/c++.at, tests/calc.at, + * tests/java.at, tests/local.at: Adjust to use braces. + +2013-04-11 Akim Demaille + + c++: fix several issues with locations + Reported by Daniel Frużyński. + http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html + + * data/location.cc (position::columns, position::lines): Check for + underflow. + Fix some weird function signatures. + (location): Accept signed integers as arguments where appropriate. + Add operator- and operator+=. + * doc/bison.texi (C++ position, C++ location): Various fixes + and completion. + * tests/c++.at (C++ Locations): New tests. + +2013-04-11 Akim Demaille + + muscles: be sure that %code snippets are not glue together on a single line + Recently "braceless" in the parser was changed so that an eol was no + longer added to the value. This is not correct when a %code is used + multiple times, because the syncline of the next snippet might be + appended to the last (and not ended) line of the previous snippet. + + * src/muscle-tab.h (muscle_grow): Make it private. + * src/muscle-tab.c (muscle_grow): Accept a fourth argument: a required + terminator. + Adjust callers. + * tests/input.at (Multiple %code): New. + +2013-04-11 Akim Demaille + + style: fix comments + * tests/actions.at: Fix incorrect "prototype". + +2013-04-10 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + glr.cc: fix a clang warning + maint: update copyright years + build: fix VPATH issue + build: avoid clang's colored diagnostics in the test suite + tests: please clang and use ".cc", not ".c", for C++ input + gnulib: update + skeletons: avoid empty switch constructs + lalr1.cc: fix compiler warnings + yacc.c: do not use __attribute__ unprotected + tests: style changes + +2013-04-09 Akim Demaille + + api.value.type: use keyword/brace values + Suggested by Joel E. Denny. + http://lists.gnu.org/archive/html/bison-patches/2013-03/msg00016.html + + * data/bison.m4 (b4_percent_define_get_kind): New. + (b4_variant_flag): Check that api.value.type is defined as the 'variant' + keyword value. + * data/c.m4 (_b4_value_type_setup_keyword): New. + (b4_value_type_setup): Use it to simplify reading. + Use b4_define_silent. + Decode api.value.type, including its type. + (b4_value_type_define): Likewise. + * data/c++.m4 (b4_value_type_declare): Adjust the decoding of api.value.type, + taking its kind into account. + * doc/bison.texi: Adjust all the examples to the new syntax. + * NEWS: Ditto. + * tests/types.at: Adjust + +2013-04-09 Akim Demaille + + api.value.type: diagnose guaranteed failure with --yacc + Instead of generating invalid C code, generate an error when --yacc and + '%define api.value.type union' are used together. + + * data/bison.m4: Issue an error in this case. + * tests/types.at (%yacc vs. %define api.value.type union): New, check this + error. + * doc/bison.texi (Type Generation): Document it. + * tests/output.at: Check that '-o y.tab.c' and '-y' behave equally + wrt generated file names. + * NEWS (Use of YACC='bison -y'): New. + Promote the use of 'bison -o y.tab.c'. + +2013-04-09 Akim Demaille + + doc: style changes + * doc/bison.texi (Destructor Decl, Printer Decl): Group series of %token + and %type together. + +2013-04-09 Akim Demaille + + doc: display locations in error as recommended by GNU Coding Standards + * doc/bison.texi (Actions and Locations): here. + +2013-04-09 Akim Demaille + + doc: api.value.type union + * doc/bison.texi (Type Generation): New section. + (Multi-function Calc): Convert to use api.value.type=union. + +2013-04-09 Akim Demaille + + doc: move the section about "%union" where types are discussed + * doc/bison.texi (Union Decl): Move to... + (Defining Language Semantics): here. + +2013-04-09 Akim Demaille + + doc: deprecate #define YYSTYPE in favor of %define api.value.type + * doc/bison.texi: Convert examples with YYSTYPE to use api.value.type. + Deprecate YYSTYPE. + +2013-04-09 Akim Demaille + + value type: accept "->" in type tags + Provide a means to dereference pointers when defining tags. One + example could be: + + %code requires + { + typedef struct ListElementType + { + union value + { + int intVal; + float floatVal; + char* charptrVal; + } value; + + struct ListElementType* next; + } ListElementType; + } + + %union + { + ListElementType* list; + } + + %token value.charptrVal> STRING + %token value.intVal> INTEGER + %token value.floatVal> REAL + %type ElementList LiteralType + + * src/scan-code.l, src/scan-gram.l: Accept "->" in tags. + * tests/types.at: Add more test cases to cover this case. + +2013-04-09 Akim Demaille + + style: simplify the scanning of type tags + * src/scan-gram.l: Remove the rule for simple tags: the "complex" case + subsumes it. It was more efficient, but duplicated the code for a + negligible benefit. + +2013-04-09 Akim Demaille + + api.value.type: implement proper support, check, and document + * data/c.m4 (b4_symbol_type_register, b4_type_define_tag) + (b4_symbol_value_union, b4_value_type_setup_union) + (b4_value_type_setup_variant, b4_value_type_setup): + New. + (b4_value_type_define): Use it to set up properly the type. + Handle the various possible values of api.value.type. + * data/c++.m4 (b4_value_type_declare): Likewise. + * data/lalr1.cc (b4_value_type_setup_variant): Redefine. + + * tests/types.at: New. + Exercise all the C/C++ skeletons with different types of + api.value.type values. + * tests/local.mk, tests/testsuite.at: Use it. + + * doc/bison.texi (%define Summary): Document api.value.type. + * NEWS: Advertise it, together with api.token.constructor. + +2013-04-09 Akim Demaille + + m4: allow the definition of side-effect only macros + * data/bison.m4 (b4_divert_kill, b4_define_silent): New. + * data/c.m4: Comment change. + +2013-04-09 Akim Demaille + + variant: fix inconsistent quotation + * data/variant.hh (b4_char_sizeof): De-overquote. + (b4_value_type_declare): De-underquote. + +2013-04-09 Akim Demaille + + m4: style changes in error messages + * data/bison.m4: Use $0 to denote the current macro's name. + +2013-04-08 Akim Demaille + + glr.cc: fix a clang warning + * data/glr.cc (b4_epilogue): Be sure to end with an end-of-line, + so that the file does end with one. + +2013-04-08 Akim Demaille + + maint: update copyright years + Run "make update-copyright". + +2013-04-08 Akim Demaille + + build: fix VPATH issue + * Makefile.am (update-b4-copyright, update-package-copyright-year): Fix + path to build-aux. + +2013-04-08 Akim Demaille + + build: avoid clang's colored diagnostics in the test suite + The syncline tests, which try to recognize compiler diagnostics, + are confused by escapes for colors. + + * configure.ac (warn_tests): New, to factor the warnings for both + C and C++ tests. + Add -fno-color-diagnostics to it. + * tests/local.at (AT_TEST_TABLES_AND_PARSE): Do not remove glue + together compiler flags. + +2013-04-08 Akim Demaille + + tests: please clang and use ".cc", not ".c", for C++ input + When fed with foo.c, clang++ 3.2 answers: + + clang: error: treating 'c' input as 'c++' when in C++ mode, + this behavior is deprecated + + * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use *.cc and *.hh + for C++. + +2013-04-08 Akim Demaille + + gnulib: update + +2013-04-08 Akim Demaille + + skeletons: avoid empty switch constructs + Reported by Rob Conde. + http://lists.gnu.org/archive/html/bug-bison/2013-03/msg00003.html + + * data/c.m4 (b4_symbol_actions): Rename as... + (_b4_symbol_actions): this. + (b4_symbol_actions): New wrapper. + Do not emit empty switches. + Adjust all b4_symbol_actions callers. + +2013-04-08 Akim Demaille + + lalr1.cc: fix compiler warnings + Reported by Rob Conde. + http://lists.gnu.org/archive/html/bug-bison/2013-03/msg00003.html + + * data/stack.hh (operator=, stack(const stack&)): Make this class + uncopyable, i.e., "undefine" these operators: make them private and + don't implement them. + (clear): New. + * data/lalr1.cc: Use it instead of an assignment. + (parser): Make this class uncopyable. + +2013-04-08 Akim Demaille + + yacc.c: do not use __attribute__ unprotected + Reported by Victor Khomenko. + http://lists.gnu.org/archive/html/bug-bison/2013-04/msg00001.html + + * data/glr.c (YYUSE, __attribute__): Fuse their definition into... + * data/c.m4 (b4_attribute_define): this new macro. + * data/yacc.c, data/glr.c: Use it. + +2013-04-05 Akim Demaille + + api.namespace: demonstrate and use {...} values instead of "..." values + * tests/c++.at, tests/input.at: Use "%define api.namespace {foo}" instead + of using quotes. + * tests/local.at (AT_SETUP_STRIP, AT_NAME_PREFIX): Recognize uses of + braces instead of quotes. + * doc/bison.texi: Use braces for api.namespace's values. + +2013-04-05 Akim Demaille + + grammar: do not add a \n at the end of blocks of code + Now that we use "braceless" (which is {...} blocks of code with + initial and final braces stripped) to denote "short" values (such as + api.namespaces), the added end-of-line is a nuisance. As a matter of + fact, this extra-safety was useless, as every expansion of "braceless" + (aka, "user code") is followed by an end of line. + + * src/parse-gram.y, src/parse-gram.c (braceless): Instead of replacing + the final brace by \n, just delete the brace. + +2013-04-04 Akim Demaille + + regen + +2013-04-04 Akim Demaille + + grammar: record the kind of %define variable values + Provide a means to tell the difference between "keyword" values (e.g., + %define api.pull both), "string" values (e.g., %define file.name + "foo"), and "code" values (e.g., %define api.namespace {calc}). + + Suggested by Joel E. Denny. + http://lists.gnu.org/archive/html/bison-patches/2013-03/msg00016.html + + * src/muscle-tab.h, src/muscle-tab.c (muscle_kind, muscle_kind_new) + (muscle_kind_string): New. + (muscle_percent_define_insert): Take the kind as new argument. + Insert it in the muscle table. + Adjust callers. + * src/getargs.c: Adjust callers. + * src/parse-gram.y: Ditto. + (content.opt): Remove, replaced by... + (value): this new non-terminal, whose semantics value is stored + in the new "value" union member. + Provide a printer. + Support values in braces in additions to keyword and string values. + + fuse me + +2013-04-04 Akim Demaille + + style: fix comments + * src/muscle-tab.c (muscle_percent_define_ensure): Update obsolete + comments. + +2013-04-04 Akim Demaille + + regen + +2013-04-04 Akim Demaille + + grammar: style changes + * src/parse-gram.y (PARAM_TYPE): Remove useless typedef guard. + There's a header guard. + Use 'yyo' with %printer. + Use a consistent style for %union one-liners. + +2013-04-04 Akim Demaille + + grammar: split %union to group together related aspects + * src/parse-gram.y (INT): Fuse the %type and %token declaration. + Move its %union right before its introduction. + (%union): Split in several %unions, right before their use. + +2013-04-04 Akim Demaille + + muscle: refactor + * src/muscle-tab.c (muscle_lookup, muscle_entry_new): New. + (muscle_insert, muscle_grow, muscle_find_const, muscle_find): Use them. + +2013-04-03 Akim Demaille + + style: comment changes + * src/muscle-tab.c: Move the documentation of public functions to... + * src/muscle-tab.h: here. + Fix comment consistency issues. + +2013-04-03 Akim Demaille + + muscle: minor refactoring + * src/muscle-tab.h (MUSCLE_INSERT_C_STRING): Use MUSCLE_INSERT_STRING. + +2013-03-06 Akim Demaille + + regen + +2013-03-06 Valentin Tolmer + + gram: correct token numbering in precedence declarations + In a precedence declaration, when tokens are declared with a litteral + character (e.g., 'a') or with a identifier (e.g., B), Bison behaved + differently: the litteral tokens would be numbered first, and then the + other ones, leading to the following grammar: + + %right A B 'c' 'd' + + being numbered as such: 'c' 'd' A B. + + * src/parse-gram.y (symbol.prec): Set the symbol number when reading the + symbols. + * tests/conflicts.at (Token declaration order: literals vs. identifiers): + New. + +2013-03-04 Akim Demaille + + maint: update autoconf submodule + * submodules/autoconf: Up to master. + No significant changes in the files we use (m4sugar.m4 and foreach.m4). + +2013-03-04 Akim Demaille + + diagnostics: no longer include the yacc category in -Wall + It would be a pity to warn the users against Bison features... + http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00107.html + + * src/complain.h, src/complain.c (Wall): Disable Wyacc. + (Weverything): New (hidden so far) category which really denotes all + the categories (what used to be Wall). + (warnings_args, warnings_types): Adjust. + (warning_argmatch): Now !none = Weverything and conversely, no longer Wall. + * NEWS, doc/bison.texi, src/getargs.c: Adjust the documentation. + * tests/input.at (-Werror is not affected by -Wnone and -Wall): Adjust + by not using a -Wyacc type of warning. + +2013-03-04 Akim Demaille + + grammar: no longer detect and cure missing semicolon at end of actions + Bison 3.0 is already breaking backward compatibility with other + features. It is an appropriate time to drop this feature. Note that + it was disabled when --yacc is passed. See + http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00102.html + + Basically, revert e8cd1ad655bcc704b06fb2f191dc3ac1df32b796. + + * src/scan-code.l (braces_level, need_semicolon, in_cpp): Remove. + Remove every rule needed to detect and add missing semicolon. + * tests/actions.at (Fix user actions without a trailing semicolon): + Remove. + * NEWS: Adjust. + +2013-03-04 Akim Demaille + + build: stop using bison -y + * Makefile.am (YACC): Pass -o y.tab.c, so that ylwrap is happy, and + yet we don't pass --yacc to bison. + (AM_YFLAGS): Disable Yacc warnings. + +2013-02-23 Akim Demaille + + c++: rename b4_semantic_type_declare as b4_value_type_declare + This is to match the names used in C and api.value.type, even if the + parser actually defines semantic_type. + + * data/c++.m4 (b4_semantic_type_declare): Rename as... + (b4_value_type_declare): this. + * data/variant.hh: Likewise. + +2013-02-23 Akim Demaille + + news: typo + * NEWS: here. + +2013-02-23 Akim Demaille + + style: space changes in the tests + * tests/local.at: here. + +2013-02-22 Akim Demaille + + style: formatting changes in the doc + * doc/bison.texi: Use @file where appropriate. + +2013-02-19 Akim Demaille + + tests: fix invalid C++11 code + * tests/c++.at (Object): Somehow instances of Object were assigned + YY_NULL, which is 0 most of the time (that case passes), but is + nullptr in C++11, and there is nothing in Object to support such an + assignment (failure). Use 0 as value, and provide the needed + assignment operator. + Also, use a more natural order within the class definition. + +2013-02-19 Akim Demaille + + tests: fix failures with G++ 4.8 in Flex scanner + * configure.ac (WARN_NO_NULL_CONVERSION_CXXFLAGS): Rename as... + (FLEX_SCANNER_CXXFLAGS): this. + Pass -Wno-zero-as-null-pointer-constant to G++ if it supports it. + * examples/calc++/local.mk: Adjust. + +2013-02-19 Akim Demaille + + regen + +2013-02-19 Akim Demaille + + gnulib: update + +2013-02-19 Akim Demaille + + style: rename variant private members + * data/variant.hh (buffer, tname, as_, raw, align_me): Rename as... + (yybuffer_, yytname_,yyas_, yyraw, yyalign_me): these. + +2013-02-19 Akim Demaille + + style: space changes + * data/variant.hh: Be sure to leave a space before arguments in function + calls. + +2013-02-19 Akim Demaille + + variant: fix G++ 4.4 warnings + The changes by Théophile Ranquet about type punning issues need + to be extend to in-place new to please G++ 4.4.7. + + * data/variant.hh (variant::as_): New, factors the casts that avoid + compiler warnings. + (as, build): Use them. + +2013-02-18 Akim Demaille + + news: spell fixes + * NEWS: here. + +2013-02-18 Akim Demaille + + diagnostics: factor and enhance messages about duplicate rule directives + When reporting a duplicate directive on a rule, point to its first + occurrence: + + one.y:11.10-15: error: only one %empty allowed per rule + %empty {} %empty + ^^^^^^ + one.y:11.3-8: previous declaration + %empty {} %empty + ^^^^^^ + + And consistently discard the second one. + + * src/complain.h, src/complain.c (duplicate_directive): New. + * src/reader.c: Use it where appropriate. + * src/symlist.h, src/symlist.c (symbol_list): Add a dprec_location member. + * tests/actions.at: Adjust expected output. + +2013-02-18 Akim Demaille + + style: no longer use backquotes + * tests/actions.at, tests/atlocal.in, tests/c++.at, tests/calc.at, + * tests/conflicts.at, tests/existing.at, tests/glr-regression.at, + * tests/input.at, tests/java.at, tests/local.at, tests/sets.at, + * tests/synclines.at, doc/bison.texi, lib/libiberty.h, lib/timevar.h: + Use single quotes. + +2013-02-18 Akim Demaille + + style: no longer use backquotes + * README, REFERENCES, TODO, configure.ac, data/README, data/bison.m4, + * data/c++.m4, data/c.m4, data/java.m4, data/lalr1.cc, + * data/lalr1.java, data/yacc.c, doc/local.mk, etc/bench.pl.in, + * src/conflicts.c, src/files.c, src/getargs.c, src/gram.h, src/lalr.c, + * src/location.c, src/location.h, src/muscle-tab.c, src/muscle-tab.h, + * src/output.c, src/parse-gram.c, src/parse-gram.y, src/print-xml.c, + * src/print.c, src/reader.c, src/reduce.c, src/scan-skel.l, + * src/symtab.h, src/system.h, src/tables.c: + Use single quotes, as currently recommended by the GNU Coding Standards. + +2013-02-18 Akim Demaille + + style: no longer use backquotes in messages + * src/getargs.c (usage): Use single quotes. + +2013-02-18 Akim Demaille + + doc: use %empty instead of /* empty */ + * doc/bison.texi: Change the comments into explicit %empty. + +2013-02-18 Akim Demaille + + doc: introduce %empty and -Wempty-rule + * doc/bison.texi (Grammar Rules): Make it a @section which + contains... + (Rules Syntax): this new subsection (with the previous contents of + "Grammar Rules". + (Empty Rules): New subsection, extracted from the former + "Grammar Rules". + Document %empty. + (Recursion): New a subsection of "Grammar Rules". + Complete a few index entries. + (Bison Options): Document -Wempty-rule. + +2013-02-18 Akim Demaille + + report: use %empty to denote empty rules + * src/gram.c (rule_rhs_print): Use %empty for empty rules. + * tests/conflicts.at, tests/regression.at, tests/sets.at: Adjust. + +2013-02-18 Akim Demaille + + diagnostics: %empty enables -Wempty-rule + * src/complain.h, src/complain.c (warning_is_unset): New. + * src/reader.c (grammar_current_rule_empty_set): If enabled -Wempty-rule, + if not disabled. + * tests/actions.at (Implicitly empty rule): Check this feature. + Also check that -Wno-empty-rule does disable this warning. + +2013-02-18 Akim Demaille + + -Wempty-rule: diagnose empty rules without %empty + * src/complain.h, src/complain.c (warning_empty_rule, Wempty_rule): + New warning category. + (warnings_args, warnings_types): Adjust. + * src/reader.c (grammar_rule_check): Check the empty rules are + flagged by %empty. + * tests/actions.at (Implicitly empty rule): New. + * tests/existing.at: Add expected warnings. + +2013-02-18 Akim Demaille + + tests: use %empty + * tests/actions.at, tests/input.at, tests/reduce.at, + * tests/regression.at: + here. + +2013-02-18 Akim Demaille + + regen + +2013-02-18 Akim Demaille + + parser: use %empty + Avoid that Bison's own use of "bison -Wall" trigger warnings. + + * src/parse-gram.y: Use %empty for every empty rule. + +2013-02-18 Akim Demaille + + grammar: introduce %empty + Provide a means to explicitly denote empty right-hand sides of rules: + instead of + + exp: { ... } + + allow + + exp: %empty { ... } + + Make sure that %empty is properly used. + + With help from Joel E. Denny and Gabriel Rassoul. + http://lists.gnu.org/archive/html/bison-patches/2013-01/msg00142.html + + * src/reader.h, src/reader.c (grammar_current_rule_empty_set): New. + * src/parse-gram.y (%empty): New token. + Use it. + * src/scan-gram.l (%empty): Scan it. + * src/reader.c (grammar_rule_check): Check that %empty is properly used. + * tests/actions.at (Invalid uses of %empty, Valid uses of %empty): New. + +2013-02-16 Akim Demaille + + getargs: minor simplification + * src/getargs.c (flag_argmatch): Simplify the handling of "none". + +2013-02-16 Akim Demaille + + style: move argument handling of -W into the diagnostics module + This allows to reduce the number of public interfaces. + + * src/getargs.c (--yacc): Use warning_argmatch instead of tweaking + directly warnings_flag (which will be private). + (warning_argmatch, warnings_argmatch): Move to... + * src/complain.h, src/complain.c: here. + + * src/getargs.h, src/getargs.c (warnings_args, warnings_types): Move to... + * src/complain.c: here, now private. + + * src/complain.h (severity, warnings_flag): Move to... + * src/complain.c: here, now private. + +2013-02-16 Akim Demaille + + diagnostics: revamp the handling of -Werror + Recent discussions with Joel E. Denny + (http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00026.html) + show that it is desirable to tell the difference between an option + that was explicitly disabled with -Wno-foo, as opposed to be left + unset. The current framework does not allow this. + + Instead of having a first int to store which options are enabled, and + another to store which are turned into errors, use an array that for + each warning category tells its status: disabled, unset, warning, + error. + + * src/complain.h, src/complain.c (warning_bit): New enum. + (warnings): Use it. + (severity): New enum. + (warnings_flag): Now an array of severity. + (errors_flag): Remove, now done by warnings_flag. + (complain_init): New function, to initialie warnings_flag. + (warnings_are_errors): New Boolean, for -Werror. + * src/complain.c (warning_severity): New. + (warnings_print_categories, complains): Use it. + * src/getargs.c (warning_argmatch): Adjust to use warnings_flag. + (warnings_argmatch): Ditto. + Handle -Werror and -Wno-error here. + (getargs): Adjust. + * src/main.c (main): Call complain_init. + * tests/input.at (Invalid options): Add more corner cases. + +2013-02-14 Akim Demaille + + options: simplify the handling of -W + * src/getargs.c (warnings_argmatch, warning_argmatch): Simplify by + replacing function arguments with their actual values. + (WARNING_ARGMATCH): Remove, useless. + Adjust callers. + +2013-02-14 Akim Demaille + + options: don't accept "error=" for -f and -r + * src/getargs.c (warning_argmatch, warnings_argmatch, WARNINGS_ARGMATCH): + New. + Use them for -W/--warning. + They are copied from... + (flag_argmatch, flags_argmatch, FLAGS_ARGMATCH): these. + Simplify by removing the support for "error". + * tests/input.at (Invalid options): New. + * TODO (Laxism in Bison invocation arguments): Remove. + +2013-02-14 Akim Demaille + + diagnostics: factor the list of warning names + * src/getargs.h, src/getargs.c (warnings_args, warnings_types): Make + them public. + * src/complain.h, src/complain.c (warnings_print_categories): Its + only use outside complain.c was removed in a recent commit, so + make it static. + Simplify its implementation. + Use warnings_args and warnings_types. + * src/muscle-tab.c (muscle_percent_define_check_values): Make it + silent. + +2013-02-14 Akim Demaille + + diagnostics: no longer pretty-print rules in error messages, carets suffice + * src/gram.c (grammar_rules_useless_report): Let -fcaret handle the + pretty-printing of the guilty rules. + (rule_print): Inline in its only use. + * tests/conflicts.at, tests/existing.at, tests/reduce.at, + * tests/regression.at: Adjust. + * NEWS: Document. + +2013-02-14 Akim Demaille + + options: no longer document warnings when diagnosing an invalid -W + The argmatch functions accept prefixes of the alternatives (like + getopt does for long options). Bison uses this to document the + warning categories. This is troublesome: it duplicates the --help + documentation, it is not gettextized, it is displayed with ugly quotes + (because argmatch uses it to display the list of possible answers), + and it prevents straighforward uses of the tables of valid warning + categories (for instance so that warning diagnostics end with the name + of the warning). + + The "hidden" option --trace uses the same trick, but it does not need + to be translated, nor to be described in --help. + + * src/getargs.c (warnings_args): Remove pseudo documentation. + Comment changes. + +2013-02-11 Akim Demaille + + tests: enlarge the allowed duration for calc tests + Hydra "often" fails on this test: + + 252. calc.at:658: 252. Calculator %glr-parser api.pure + parse.error=verbose %debug %locations %defines api.prefix="calc" + %verbose %yacc %parse-param {semantic_value *result} + %parse-param {int *count} (calc.at:658): FAILED + + * tests/calc.at: Give 200s instead of 100s. + Use AT_DEBUG_IF. + +2013-02-11 Akim Demaille + + debug: improve the display of symbol lists + * src/symtab.c (symbol_print): Remove useless quotes (the symbol already + has quotes). + Prefer fputs. + * src/symlist.c (symbol_list_syms_print): Likewise. + Fix separators. + +2013-02-09 Akim Demaille + + style: minor changes + * src/complain.c: Space changes. + * src/reader.c: Comment changes. + Avoid && in assertions. + * src/location.c: Move comments to... + * src/location.h: here. + * src/symlist.h, src/symlist.c: Create a pseudo section for members + that apply to the rule. + +2013-02-08 Akim Demaille + + news: restructure, document variants for C++ + * NEWS: here. + +2013-02-08 Akim Demaille + + c++: api.token.constructor requires api.value.type=variant + Eventually it should also support "union". + + * data/glr.cc: Move this check to... + * data/c++.m4: here, as lalr1.cc is affected too. + +2013-02-05 Akim Demaille + + build: restore C90 compatibility + * src/parse-gram.y, src/parse-gram.c: Don't use // comments. + +2013-02-05 Akim Demaille + + doc: use @group to improve page breaking + * doc/bison.texi: here. + +2013-02-04 Akim Demaille + + style: rename internal "stype" as "union_members" for clarity + "stype" is quite unclear, and it also collides with the former %define + variable that had the same name (replaced by api.value.type). + + * src/parse-gram.y (stype): Rename as... + (union_members): this. + * data/bison.m4: Adjust. + (b4_user_stype): Rename as... + (b4_user_union_members): this. + * data/c++.m4, data/c.m4: Adjust. + * src/parse-gram.c: regen. + +2013-02-04 Akim Demaille + + tests: improve the language independance layer + * tests/local.at (_AT_LANG_DISPATCH): New, shamelessly stolen from + Autoconf's _AT_LANG_DISPATCH. + (AT_LANG_DISPATCH): New. + (AT_YYERROR_FORMALS, AT_YYERROR_PROTOTYPE, AT_YYERROR_DECLARE_EXTERN) + (AT_YYERROR_DECLARE, AT_YYERROR_DEFINE, AT_MAIN_DEFINE, AT_COMPILE) + (AT_FULL_COMPILE): + Use AT_LANG_DISPATCH instead of an ad hoc m4_case. + +2013-02-04 Akim Demaille + + regen + +2013-02-04 Akim Demaille + + style: space changes in the parser + * src/parse-gram.y: Fix spaces. + +2013-02-04 Akim Demaille + + parser: use api.pure full + * src/parse-gram.y: Use api.pure full instead of silly macro tricks. + +2013-02-04 Akim Demaille + + style: use a for loop instead of a while loop, and scope reduction + * src/reader.c (packgram): Improve readability. + The parser calls grammar_current_rule_end at the end of every rhs, + which adds a NULL to separate the rules. So there is no need to + check whether "p" is non-null before proceeding. + +2013-02-01 Theophile Ranquet + + variants: stylistic change + * data/variant.hh (tname): Respect the GNU Coding Standards for this + pointer's declaration. + +2013-02-01 Theophile Ranquet + + grammar: free the association tracking graph + The graph introduced by Valentin wasn't free'd after use. + + * src/symtab.c (assoc_free): New, clear the array of linked lists with... + (linkedlist_free): This, new. + (print_precedence_warnings): Call assoc_free when done. + (print_assoc_warnings): Free used_assoc after use. + +2013-02-01 Theophile Ranquet + + tests: use AT_FULL_COMPILE where possible + * tests/c++.at (C++ Variant-based Symbol, Variants): Here. Rename the + generated input files to use .y instead of .yy, as a requirement for using + AT_FULL_COMPILE instead of a combination of AT_BISON_CHECK and + AT_BISON_COMPILE_CXX. + +2013-02-01 Theophile Ranquet + + variants: avoid type punning issue + This is based on what is recommended by both Scott Meyers, in 'Effective + C++', and Andrei Alexandrescu and Herb Sutter in 'C++ Coding Standards'. + + Use a static_cast on void* rather than directly use a reinterpret_cast, + which can have nefarious effects on objects. However, even though following + this guideline is good practice in general, I am not quite sure how relevant + it is when applied to conversions from POD to objects. Actually, it might + very well be the opposite: isn't this exactly what reinterpret_cast is for? + What we really want *is* to transmit the memory map as a series of bytes, + which, if I am correct, falls into the kind of "low level" hack for which + this cast is meant. + + In any case, this silences the warning, which will be greatly appreciated by + anyone using variants with a compiler supporting -fstrict-aliasing. + + * data/variant.hh (as): Here. + * tests/c++.at (Exception safety, C++ Variant-based Symbols, Variants): + Don't use NO_STRICT_ALIAS_CXXFLAGS (revert commit ddb9db15), as type punning + is no longer an issue. + * tests/atlocal.in, configure.ac (NO_STRICT_ALIAS_CXXFLAGS): Remove + definition. + * examples/local.mk (NO_STRICT_ALIAS_CXXFLAGS): Remove from AM_CXXFLAGS. + * doc/bison.texi: Don't mention type punning issues. + +2013-02-01 Theophile Ranquet + + todo: update + Reformulate and give more details on my thoughts concerning the graphical + visualization, and add an entry about a bug in the options processing for + warnings as errors. + + * TODO: Here. + +2013-02-01 Akim Demaille + + regen + +2013-02-01 Akim Demaille + + location: pass the location first + * src/location.h, src/location.c (location_print): For consistency + with other data structures and other location_* routines, pass the + location argument first. + * src/complain.c: Adjust. + (location_caret): Likewise. + * src/parse-gram.y: Adjust. + +2013-02-01 Akim Demaille + + symlist: use the right stream + * src/symlist.c (symbol_list_syms_print): Use "f", not stderr. + +2013-01-30 Akim Demaille + + tests: put two related tests together + * tests/conflicts.at (Useless associativity warning): Move next + to "Useless precedence warning". + +2013-01-30 Akim Demaille + + news: name contributors + * NEWS: here. + +2013-01-30 Valentin Tolmer + + warnings: introduce -Wprecedence + The new warning category "precedence" flags useless precedence and + associativity. -Wprecedence can now be used, it is disabled by default. + The warnings about precedence and associativity are grouped into one, and + the testsuite was corrected accordingly. + + * src/complain.h (warnings): Introduce "precedence". + * src/complain.c (warnings_print_categories): Adjust. + * src/getargs.c (warnings_args, warning_types): Likewise. + * src/symtab.h, src/symtab.c (print_associativity_warnings): Remove. + * src/symtab.h (register_assoc): Correct arguments. + * src/symtab.c (print_precedence_warnings): Print both warnings together. + * doc/bison.texi (Bison options): Document the warnings and provide an + example. + * tests/conflicts.at, tests/existing.at, tests/local.at, + * tests/regression.at: Adapt the testsuite for the new category + (-Wprecedence instead of -Wother where appropriate). + +2013-01-30 Akim Demaille + + build: avoid clang's colored diagnostics in the test suite + The syncline tests, which try to recognize compiler diagnostics, + are confused by escapes for colors. + + * configure.ac (warn_tests): New, to factor the warnings for both + C and C++ tests. + Add -fno-color-diagnostics to it. + * tests/local.at (AT_TEST_TABLES_AND_PARSE): Do not remove glue + together compiler flags. + +2013-01-30 Akim Demaille + + build: please Clang++ 3.2+ on Flex scanners + Clang++, with -Wall, rejects code generated by Flex (for C scanners): + + CXX examples/calc++/examples_calc___calc__-calc++-scanner.o + In file included from examples/calc++/calc++-scanner.cc:1: + error: implicit conversion of NULL constant to 'bool' [-Werror,-Wnull-conversion] + if ( ! ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : __null) ) { + ~ ^~~~~~ + false + * configure.ac (WARN_NO_NULL_CONVERSION_CXXFLAGS): Compute it. + * examples/calc++/local.mk (examples_calc___calc___CXXFLAGS): Use it. + +2013-01-30 Valentin Tolmer + + grammar: record used associativity and print useless ones + Record which symbol associativity is used, and display useless ones. + + * src/symtab.h, src/symtab.c (register_assoc, print_assoc_warnings): New + * src/symtab.c (init_assoc, is_assoc_used): New + * src/main.c: Use print_assoc_warnings + * src/conflicts.c: Use register_assoc + * tests/conflicts.at (Useless associativity warning): New. + + Due to the new warning, many tests had to be updated. + + * tests/conflicts.at tests/existing.at tests/regression.at: + Add the associativity warning in the expected results. + * tests/java.at: Fix the java calculator's grammar to remove a useless + associativity. + * doc/bison.texi (mfcalc example): Fix associativity to remove + warning. + +2013-01-29 Valentin Tolmer + + grammar: warn about unused precedence for symbols + Symbols with precedence but no associativity, and whose precedence is + never used, can be declared with %token instead. The used precedence + relationships are recorded and a warning about useless ones is issued. + + * src/conflicts.c (resolve_sr_conflict): Record precedence relation. + * src/symtab.c, src/symtab.h (prec_nodes, init_prec_nodes) + (symgraphlink_new, register_precedence_second_symbol) + (print_precedence_warnings): New. + Record relationships in a graph and warn about useless ones. + * src/main.c (main): Print precedence warnings. + * tests/conflicts.at: New. + +2013-01-29 Theophile Ranquet + + variants: remove the 'built' assertions + When using %define parse.assert, the variants come with additional variables + that are useful for development purposes. One is a Boolean indicating if the + variant is built (to make sure we don't read a non-built variant), and the + other is a string describing the stored type. There is no need to have both of + these, the string is enough. + + * data/variant.hh (built): Remove. + +2013-01-29 Akim Demaille + + style: indentation fixes + * src/parse-gram.y: here. + +2013-01-29 Akim Demaille + + maint: be sure to neutralize out-of-tree paths from our parser + * tests/bison.in: Adjust to support fixed versions of ylwrap. + +2013-01-29 Theophile Ranquet + + m4: generate a basic_symbol constructor for each symbol type + Recently, there was a slightly vicious bug hidden in the make_ functions: + + parser::symbol_type + parser::make_TEXT (const ::std::string& v) + { + return symbol_type (token::TOK_TEXT, v); + } + + The constructor for symbol_type doesn't take an ::std::string& as + argument, but a constant variant. However, because there is a variant + constructor which takes an ::std::string&, this caused the implicit + construction of a built variant. Considering that the variant argument + for the symbol_type constructor was cv-qualified, this temporary variant + was never destroyed. + + As a temporary solution, the symbol was built in two stages: + + symbol_type res (token::TOK_TEXT); + res.value.build< ::std::string&> (v); + return res; + + However, the solution introduced in this patch contributes to letting + the symbols handle themselves, by supplying them with constructors that + take a non-variant value and build the symbol's own variant with that + value. + + * data/variant.hh (b4_symbol_constructor_define_): Use the new + constructors rather than building in a temporary symbol. + (b4_basic_symbol_constructor_declare, + b4_basic_symbol_constructor_define): New macros generating the + constructors. + * data/c++.m4 (basic_symbol): Invoke the macros here. + +2013-01-29 Theophile Ranquet + + c++: minor stylistic changes + * data/c++m4: Remove useless comment lines. + * data/variant.hh (self_type): Use this typedef instead of variant. + (b4_symbol_constructor_define_): Remove commented-out line, and stylistic + change (avoid blank line). + +2013-01-29 Akim Demaille + + c++: please G++ 4.8 with -O3: type puning issue + * tests/c++.at (Exception safety): Now that this test covers + variants, pass -fno-strict-aliasing to g++. + +2013-01-29 Akim Demaille + + c++: please G++ 4.8 with -O3: array bounds + * data/c++.m4, data/lalr1.cc (by_state, by_type): Do not use -1 to + denote the absence of value, as GCC then fears that this -1 might + be used to dereference arrays (such as yytname). + Use 0, which corresponds to $accept, which is valueless (the needed + property: the symbol destructor must not try to reclaim the memory + associated with the symbol). + +2013-01-29 Akim Demaille + + c++: use more explicit types than int + * data/c++.m4 (b4_public_types_declare): Declare token_number_type soon. + Introduce symbol_number_type (wider than token_number_type). + Clarify the requirement that kind_type from by_state and by_type + denote the _input_ type (required by the constructor), not the stored type. + Use symbol_number_type and token_number_type where appropriate, instead + of int. + * data/lalr1.cc: Adjust to these changes. + Propagate "symbol_number_type". + Invoke "type_get ()" instead of read "type" directly. + +2013-01-29 Akim Demaille + + c++: value_type -> kind_type + * data/c++.m4, data/lalr1.cc (by_type, by_state): Rename 'value_type' + as 'kind_type', as it is clearer. + +2013-01-29 Akim Demaille + + c++: improve the signature of yysyntax_error_ + * data/lalr1.cc: This function is const. + It takes a symbol_number_type. + +2013-01-29 Akim Demaille + + c++: style changes + * data/lalr1.cc: Formatting changes. + And name changes. + +2013-01-28 Akim Demaille + + doxygen: upgrade Doxyfile, and complete it + * doc/Doxyfile.in: Let doxygen upgrade it. + (INCLUDE_PATH): Point to lib too. + (PROJECT_BRIEF): New. + (EXCLUDE): Update to reflect the current file hierarchy. + +2013-01-28 Akim Demaille + + maint: fix syntax-check issues + * cfg.mk: Ignore strcmp in local.at. + * tests/conflicts.at: Use AT_PARSER_CHECK. + * tests/regression.at: Preserve the exit status of the generated parsers. + + * tests/local.mk ($(TESTSUITE)): Map @tb@ to a tabulation. + * tests/c++.at, tests/input.at, tests/regression.at: Use @tb@. + * cfg.mk: (space-tab): There are no longer exceptions. + +2013-01-28 Akim Demaille + + tests: please C90 compilers + * tests/actions.at, tests/conflicts.at: Use /* ... */ comments. + Let "main" return a value. + +2013-01-28 Akim Demaille + + maint: update todo + * TODO: Remove fixed items. + +2013-01-28 Akim Demaille + + news: minor improvements + * NEWS: Name some more contributors. + Restructure slightly. + +2013-01-28 Akim Demaille + + tests: please clang and use ".cc", not ".c", for C++ input + When fed with foo.c, clang++ 3.2 answers: + + clang: error: treating 'c' input as 'c++' when in C++ mode, + this behavior is deprecated + + * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use *.cc and *.hh + for C++. + +2013-01-28 Akim Demaille + + tests: formatting changes + * tests/local.at: Restore proper indentation. + +2013-01-28 Theophile Ranquet + + c++: better inline expansion + Many 'inline' keywords were in the declarations. They rather belong in + definitions, so move them. + + * data/c++.m4 (basic_symbol, by_type): Many inlines here. + * data/lalr1.cc (yytranslate_, yy_destroy_, by_state, yypush_, yypop_): Inline + these as well. + (move): Move the definition outside the struct, where it belongs. + +2013-01-28 Akim Demaille + + tests: check that using variants is exception safe + * tests/local.at: (Slightly) improve the regexp by escaping '.' + when it denotes a point. + (AT_VARIANT_IF): New. + * tests/c++.at (Exception Safety): Run it for variants too. + +2013-01-28 Akim Demaille + + tests: remove useless %defines + Many tests were using %defines because C++ skeletons used to require + it. + + * tests/actions.at, tests/c++.at, tests/input.at, tests/regression.at: + Remove useless %defines. + +2013-01-28 Akim Demaille + + c++: remove now-useless operators + Now that symbols behaves properly, we can eliminate special routines + that are no longer needed. + + * data/c++.m4, data/glr.cc, data/lalr1.cc, data/variant.hh: + Remove useless assignment operators and copy constructors. + As a consequence, remove useless includes for "abort". + +2013-01-28 Akim Demaille + + tests: enable support for --debug + * tests/c++.at (Variants): Here. + And remove useless clutter when api.token.constructor is enabled. + +2013-01-28 Akim Demaille + + c++: revamp the support for variants + The current approach was too adhoc: the symbols were not sufficiently + self-contained, in particular wrt memory management. The "new" + guideline is the one that should have been followed from the start: + let the symbols handle themslves, instead of leaving their users to + it. It was justified by the will to avoid gratuitious moves and + copies, but the current approach does not seem to be slower, yet it + will probably be simpler to adjust to support move semantics from + C++11. + + The documentation says that the %parse-param are available from the + %destructor. In retrospect, that was a silly design decision, which + we can break for variants, as its a new feature. It should be phased + out for non-variants too. + + * data/variant.hh: A variant never knows if it stores something or + not, it is up to its users to store this information. + Yet, in parse.assert mode, make sure the empty/filled variants + are properly used. + (b4_symbol_constructor_define_): Don't call directly the symbol + constructor, to save a useless temporary. + * data/stack.hh (push): Steal the pushed value instead of duplicating + it. + This will simplify the callers of push, who handled this "move" + approach themselves. + * data/c++.m4 (basic_symbol): Let -1, as kind, denote the fact that + a symbol is empty. + This is needed for instance when shifting the lookahead: yyla + is given as argument to "push", and its value is then moved on + the stack. But then yyla must be declared "empty" so that its + destructor won't be called. + (basic_symbol::move): New. + Move the responsibility of calling the destructor from yy_destroy + to ~basic_symbol in the case of variants. + * data/lalr1.cc (stack_symbol_type): Now a derived class from its + previous value, so that we can add a constructor from a symbol_type. + (by_state): State -1 means empty. + (yypush_): Factor, by calling one overload from the other one, and + using the new semantics of stack::push. + No longer reclaim by hand the memory from rhs symbols, since now + that we store objects with proper destructors, they will be reclaimed + automatically. + Conversely, be sure to delete yylhs. + * tests/c++.at (C++ Variant-based Symbols): New "unit" test for + symbols. + +2013-01-28 Akim Demaille + + c++: formatting and comment changes + * data/c++.m4, data/lalr1.cc, data/stack.hh, data/variant.hh: + Fix indentation. + Fix some comments. + +2013-01-27 Valentin Tolmer + + tests: add token declaration order test + * tests/conflicts.at: New test. + +2013-01-27 Akim Demaille + + regen + +2013-01-27 Valentin Tolmer + + grammar: preserve token declaration order + In a declaration %token A B, the token A is declared before B, but in %left + A B (or with %precedence or %nonassoc or %right), the token B was declared + before A (tokens were declared in reverse order). + + * src/symlist.h, src/symlist.c (symbol_list_append): New. + * src/parse-gram.y: Use it instead of symbol_list_prepend. + * tests/input.at: Adjust expectations. + +2013-01-25 Akim Demaille + + tests: improve test group titles + * tests/local.at (AT_SETUP_STRIP): AT_SETUP does not behave properly + with new-lines in its argument. + Remove them. + Fix the handling of %define with quotes. + +2013-01-25 Akim Demaille + + c: no longer require stdio.h when locations are enabled + Recent changes (in 2.7) introduced a dependency on both FILE and + fprintf, which are "available" only in %debug mode. This was to + define yy_location_print_, which is used only in %debug mode by the + parser, but massively used by the test suite to output the locations + in yyerror. + + Break this dependency: the test suite should define its own routines + to display the locations. Eventually Bison will provide the user with + a means to display locations, but not yet. + + * data/c.m4 (b4_yy_location_print_define): Use YYFPRINTF instead of + fprintf directly. + * data/yacc.c (b4_yy_location_print_define): Invoke it only in %debug + mode, so that stdio.h is included (needed for FILE*), and YYFPRINTF + is defined. + + * tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DEFINE): Declare + and define location_print and LOCATION_PRINT. + + * tests/actions.at, tests/existing.at, tests/glr-regression.at, + * tests/input.at, tests/named-refs.at, tests/regression.at: Adjust + to use them. + Fix the expected line numbers (as the prologue's length has changed). + +2013-01-25 Akim Demaille + + c: minor simplification in the debug code + * data/c.m4 (yy_symbol_print): Minor factoring. + +2013-01-25 Akim Demaille + + c++: display locations as C does + See commit 3804aa260b956dd012adde3894767254422a5fcf. + + * data/location.cc (operator<<): Display location exactly as is + done in C skeletons. + * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): Also define + AT_FIRST_LINE, AT_LAST_LINE, AT_FIRST_COLUMN, AT_LAST_COLUMN. + * tests/actions.at (Location Print): Also check C++ skeletons. + +2013-01-25 Akim Demaille + + tests: highlight empty right-hand sides + * tests/actions.at, tests/c++.at, tests/headers.at, + * tests/input.at: here. + +2013-01-25 Akim Demaille + + news: prepare for 2.8 + * NEWS: Restructure. + Name contributors. + +2013-01-21 Akim Demaille + + tests: generalize default main for api.namespace + * tests/local.at (AT_NAME_PREFIX): Also match api.namespace. + (AT_MAIN_DEFINE): Take it into account. + * tests/c++.at, tests/headers.at: Use AT_NAME_PREFIX. + (AT_CHECK_NAMESPACE): Rename as... + (AT_TEST): this. + +2013-01-21 Akim Demaille + + tests: improve factoring of the main function + * tests/local.at (AT_MAIN_DEFINE): If %debug is used, check if + -d/--debug is passed to the generated parser, and enable the traces. + Return exactly the result of yyparse, so that we can check exit code + 2 too. + * tests/actions.at, tests/glr-regression.at, tests/regression.at: + Use AT_MAIN_DEFINE, helping AT_BISON_OPTION_PUSHDEFS where needed, + preferably to option -t. + +2013-01-21 Akim Demaille + + tests: factor the definition of main + With Théophile Ranquet. + + * tests/local.at (AT_MAIN_DEFINE): New. + (AT_YYERROR_DEFINE): Improve formatting. + * tests/actions.at, tests/c++.at, tests/conflicts.at, + * tests/glr-regression.at, tests/input.at, tests/regression.at, + * tests/skeletons.at, tests/torture.at: Adjust. + * tests/c++.at: Add missing %skeleton for a PUSHDEFS, and a missing + PUSH/POPDEFS for another test. + +2013-01-21 Akim Demaille + + tests: minor refactoring + * tests/named-refs.at: Use AT_FULL_COMPILE where applicable. + +2013-01-21 Akim Demaille + + diagnostics: avoid useless caret stuttering + * src/scan-code.l: When reporting a missing ending ';', don't display + the guilty action twice. + +2013-01-21 Theophile Ranquet + + examples: please clang + * doc/bison.texi (calc++-scanner.ll): Don't output useless yyinput function. + +2013-01-21 Theophile Ranquet + + tests: better silencing of unused argument warnings + input.yy:35:44: error: unused parameter 'msg' [-Werror,-Wunused-parameter] + void yy::parser::error (std::string const& msg) + ^ + + * tests/c++.at (C++ GLR parser identifier shadowing): Don't name unused + argument, use YYUSE instead of a direct cast to void. + +2013-01-21 Theophile Ranquet + + bench: compatibility for Bison <= 2.7 + There used to be a bug in some skeletons, which caused the expansion of + 'yylval' and 'yylloc', generating these errors: + + input.cc:547:16: error: expected ',' or '...' before '(' token + #define yylval (yystackp->yyval) + ^ + input.yy:29:39: note: in expansion of macro 'yylval' + int yylex (yy::parser::semantic_type *yylval) + ^ + + This bug is fixed by 'skel: better aliasing of identifiers', but a workaround + is useful when benchmarking against older versions of Bison, which are still + affected by the bug. + + * etc/bench.pl.in: Rename yylval to yylvalp and yylloc to yyllocp in base + grammar 'list'. + +2013-01-15 Theophile Ranquet + + c++: remove useless inlines + * data/c++.m4 (basic_symbol): Keep 'inline' in the prototypes, but don't + duplicate it in the implementation. + * data/variant.hh (variant): 'inline' is not needed when the implementation is + provided in the class definition. + +2013-01-15 Theophile Ranquet + + c++: m4 stylistic change + * data/c++.m4 (syntax_error): Fix the indentation of 'inline'. + +2013-01-14 Theophile Ranquet + + c++: silence warnings + * data/c++.m4 (basic_symbol::operator=): Unused parameter. + * tests/c++.at (C++ GLR parser identifier shadowing): Here too. + - + +2013-01-14 Theophile Ranquet + + news: typos + * NEWS: Fix a typo, use YYSTYPE rather than semantic_type. + +2013-01-12 Akim Demaille + + regen + +2013-01-12 Akim Demaille + + maint: update copyright years + Suggested by Stefano Lattarini. + Run "make update-copyright". + +2013-01-12 Akim Demaille + + build: fix VPATH issue + * Makefile.am (update-b4-copyright, update-package-copyright-year): Fix + path to build-aux. + +2013-01-11 Theophile Ranquet + + carets: document default activation + * NEWS: Announce it. + * doc/bison.texi: Adjust. + +2013-01-11 Theophile Ranquet + + carets: show them in more tests + * tests/input.at, tests/named-refs.at: Here. + +2013-01-11 Theophile Ranquet + + carets: activate by default + * src/getargs.c (feature_flag): Here. + * tests/local.at (AT_BISON_CHECK_, AT_BISON_CHECK_NO_XML): Deactivate carets + for the testsuite, by default. + * tests/input.at: Adjust the locations for command line definitions. + +2013-01-11 Theophile Ranquet + + variants: document move and swap + * data/variant.hh (swap): Doc. + (build): Rename as... + (move): This, more coherent naming with clearer meaning. + * data/c++.m4 (move): Adjust. + +2013-01-11 Theophile Ranquet + + c++: privatize variant blind copies + * data/variant.hh (variant, operator=): Make private. + * data/c++.m4 (operator=): New, to avoid needing a definition of that operator + for each class member (such as a possible variant). + * data/glr.cc, data/lalr.cc: Add the necessary include for the abort. + +2013-01-11 Akim Demaille + + glr.c: fix an unused argument issue + * data/glr.c (yyuserAction): "Use" yyrhslen, as in variant mode, we might + not use it. + +2013-01-11 Akim Demaille + + glr.c: style changes + * data/glr.c (yyuserAction): Use a size_t for sizes. + +2013-01-11 Akim Demaille + + c.m4: style fix + * data/c.m4 (b4_parse_param_use): Add missing space before paren. + +2013-01-11 Theophile Ranquet + + skel: better aliasing of identifiers + * data/glr.c, data/yacc.c: Avoid emitting useless defines. + * data/glr.cc: Restore prefixes for epilogue. + +2013-01-11 Theophile Ranquet + + glr.cc: fatal if using api.token.ctor without variants + * data/glr.cc: Here. + +2013-01-11 Theophile Ranquet + + skel: correctly indent switch cases + * data/bison.m4 (b4_type_action_): Here. + +2013-01-11 Theophile Ranquet + + variants: assert changes + * data/variant.hh (swap): More asserts can't hurt. Don't perform useless swaps. + (build): Deactivate problematic asserts, pending further investigation. + (variant): Prohibit copy construction. + +2013-01-11 Theophile Ranquet + + lalr1.cc: use a vector for the symbol stack + * data/lalr1.cc: Adjust includes. + * data/stack.hh (push, pop): Use push_back and pop_back. + (operator []): Access vector from the end. + +2013-01-11 Theophile Ranquet + + lalr1.cc: change symbols implementation + A "symbol" groups together the symbol type (INT, PLUS, etc.), its + possible semantic value, and its optional location. The type is + needed to access the value, as it is stored as a variant/union. + + There are two kinds of symbols. "symbol_type" are "external symbols": + they have type, value and location, and are returned by yylex. + "stack_symbol_type" are "internal symbols", they group state number, + value and location, and are stored in the parser stack. The type of + the symbol is computed from the state number. + + The class template symbol_base_type factors the code common to + stack_symbol_type and symbol_type. It uses the Curiously Recurring + Template pattern so that we can always (static_) downcast to the exact + type. symbol_base_type features value and location, and delegates the + handling of the type to its parameter. + + When trying to generalize the support for variant, a significant issue + was revealed: because stack_symbol_type and symbol_type _derive_ from + symbol_base_type, the type/state member is defined _after_ the value + and location. In C++ the order of the definition of the members + defines the order in which they are initialized, things go backward: + the value is initialized _before_ the type. This is wrong, since the + type is needed to access the value. + + Therefore, we need another means to factor the common code, one that + ensures the order of the members. + + The idea is simple: define two (base) classes that code the symbol + type ("by_type" codes it by its type, and "by_state" by the state + number). Define basic_symbol as the class template that + provides value and location support. Make it _derive_ from its + parameter, by_type or by_state. Then define stack_symbol_type and + symbol_type as basic_symbol, basic_symbol. The + name basic_symbol was chosen by similarity with basic_string and + basic_ostream. + + * data/c++.m4 (symbol_base_type): Remove, replace by... + (basic_symbol): which derives from its parameter, one of... + (by_state, by_type): which provide means to retrieve the actual type of + symbol. + (symbol_type): Is now basic_symbol. + (stack_symbol_type): Is now basic_symbol. + * data/lalr1.cc: Many adjustments. + +2013-01-11 Theophile Ranquet + + bench: add %b directive to use a specific Bison + For example, + $ bench.pl -v '%s lalr1.cc & %d variant & ( %b ~/old-bison/bin/bison + | %b ~/new-bison/bin/bison )' -g list -i 10000 + + * etc/bench.pl.in: Here. + +2013-01-09 Akim Demaille + + regen + +2013-01-04 Akim Demaille + + gnulib: update + +2012-12-31 Akim Demaille + + doc: use deffn to declare the list of %define variables + * doc/bison.texi (%define Summary): Use @deffn instead of @table, it + spares a lot of width, especially in PDF, and looks nicer in the other + formats too. + It is also more consistent with the rest of the document. + +2012-12-31 Akim Demaille + + doc: minor completion and fixes + * doc/bison.texi (%define Summary): Provide more history to some + variables. + +2012-12-31 Akim Demaille + + java: stype is obsoleted by api.value.type + This is consistent with the other %define variable names. + + * data/java.m4: Use api.value.type instead of stype. + * doc/bison.texi, NEWS: Document that change. + * src/muscle-tab.c (muscle_percent_variable_update): Provide backward + compatibility. + * tests/java.at: Adjust. + +2012-12-31 Akim Demaille + + doc: fix html build + * doc/local.mk (bison.html): Fix dependencies. + +2012-12-31 Akim Demaille + + todo: remove erroneous task + * tests/input.at: Check that there are no warnings about stray $ and @ + in the epilogue. + * TODO: Remove the correponding task. + +2012-12-31 Akim Demaille + + gnulib: update + +2012-12-28 Akim Demaille + + regen + +2012-12-28 Akim Demaille + + syncline: one line is enough + So far we were issuing two lines for each syncline change: + + /* Line 356 of yacc.c */ + #line 1 "src/parse-gram.y" + + This is a lot of clutter, especially when reading diffs, as these + lines change often. Fuse them into a single, shorter, line: + + #line 1 "src/parse-gram.y" /* yacc.c:356 */ + + * data/bison.m4 (b4_syncline): Issue a single line. + Comment improvements. + (b4_sync_start, b4_sync_end): Issue a shorter comment. + * data/c++.m4 (b4_semantic_type_declare): b4_user_code must be + on its own line as it might start with a "#line" directive. + +2012-12-28 Akim Demaille + + regen + +2012-12-28 Akim Demaille + + maint: restore ANSI 89 compliance + * data/bison.m4, src/conflicts.c, src/files.c, src/output.c, + * src/symtab.c: Use /* ... */ comments only. + Declare variables before statements. + +2012-12-28 Akim Demaille + + graph: minor simplification + * src/gram.c (print_lhs): Use %*s to indent. + * src/print_graph.c (print_lhs): Use obstack_printf. + Became simple enough to be inlined in... + (print_core): here. + Use a "rule*" instead of an index in "rules[]". + +2012-12-28 Akim Demaille + + closure, gram: add missing const + * src/closure.h, src/closure.c, src/gram.h, src/gram.c: Add some missing + const where appropriate. + +2012-12-27 Theophile Ranquet + + carets: properly display when no line feed is present + * src/location.c (location_caret): finish the line with one whether or not it + is present in input. Rewrite code without getline. + (cleanup_caret): Reset the caret_info global. + * bootstrap.conf: No longer require getline. + +2012-12-27 Theophile Ranquet + + scanner: reintroduce unput for missing end tokens + Unput was no longer used since a POSIX-compatiblity issue with Flex 2.5.31, + which has been adressed in newer versions of Flex. See this discussion: + + + This partially reverts commit aa4180418fff518198e1b0f2c43fec6432210dc7. + + * src/scan-gram.l (unexpected_end): Here. + * tests/input.at: Adjust for new order of error reports. + +2012-12-27 Akim Demaille + + tables: scope reduction + * src/tables.c (default_goto): Make it easier to understand. + +2012-12-27 Akim Demaille + + regen + +2012-12-27 Akim Demaille + + skeletons: fix comments + The commit 38de4e570fdc7c8db9633c3b2054e565d8c1c6b9 underquoted the + content of the comments, which resulted in losing square brackets in + the comments. Besides, some other invocations were underquoting the + effective arguments. + + * data/c.m4 (b4_comment_): Properly quote the comment. + (b4_comment_, b4_comment): Move to... + * data/c-like.m4: here, so that... + * data/java.m4: can use it instead of its own copy. + * data/bison.m4 (b4_integral_parser_tables_map): Fix some comments. + + * data/lalr1.cc, data/lalr1.java, data/yacc.c: Comment fixes. + + * data/lalr1.cc: Reorder a bit to factor some CPP directives. + +2012-12-27 Akim Demaille + + maint: which -> whose + Apparently, I was confusing both. + + * data/bison.m4, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: + Use "whose" where appropriate. + +2012-12-26 Akim Demaille + + tables: scope reduction + * src/tables.c (matching_state): here. + +2012-12-26 Akim Demaille + + tables: scope reduction + * src/tables.c (token_actions): here. + +2012-12-26 Akim Demaille + + tables: scope reduction + * src/tables.c (save_row): here. + +2012-12-26 Akim Demaille + + tables: scope reduction + * src/tables.c (save_column, pack_vector): Reduce the scope to + emphasize the structure of the code. + Rename the returned value "res" to make understanding easier. + +2012-12-26 Akim Demaille + + tables: use size_t where appropriate + These changes aim at making the code easier to understand. + + * src/tables.c (tally): This is a size, always >= 0, so make it + a size_t. -2013-04-15 Akim Demaille +2012-12-26 Akim Demaille - regen + tables: style changes + * src/tables.c: Prefer < to >. + Fix/complete some comments. + Remove useless parens. -2013-04-08 Akim Demaille +2012-12-26 Akim Demaille - glr.cc: fix a clang warning - * data/glr.cc (b4_epilogue): Be sure to end with an end-of-line, - so that the file does end with one. + skeletons: no longer call yylex via a CPP macro + The YYLEX existed only to support YYLEX_PARAM, which is now removed. + This macro was a nuisance, since incorrect yylex calls where pointed + the macro _use_, instead of its definition. -2013-04-08 Akim Demaille + * data/c.m4 (b4_lex_formals, b4_lex): New. + * data/glr.c, data/yacc.c: Use it. + * data/lalr1.cc (b4_lex): New. + Use it. - maint: update copyright years - Run "make update-copyright". + squash! skeletons: no longer call yylex via a CPP macro -2013-04-08 Akim Demaille +2012-12-26 Akim Demaille - build: fix VPATH issue - * Makefile.am (update-b4-copyright, update-package-copyright-year): Fix - path to build-aux. + YYLEX_PARAM: drop support + * data/yacc.c, doc/bison.texi: Remove YYLEX_PARAM support. + * NEWS: Document it. -2013-04-08 Akim Demaille +2012-12-26 Akim Demaille - build: avoid clang's colored diagnostics in the test suite - The syncline tests, which try to recognize compiler diagnostics, - are confused by escapes for colors. + examples: minor improvements + * examples/variant.yy: Don't use debug_stream(), obsoleted. + Use <*>. - * configure.ac (warn_tests): New, to factor the warnings for both - C and C++ tests. - Add -fno-color-diagnostics to it. - * tests/local.at (AT_TEST_TABLES_AND_PARSE): Do not remove glue - together compiler flags. +2012-12-26 Akim Demaille -2013-04-08 Akim Demaille + skeletons: factor comments about symbols + * data/variant.hh (b4_char_sizeof_): Rename as... + * data/bison.m4 (b4_symbol_tag_comment): this. + Provide more documentation about b4_symbol_*. - tests: please clang and use ".cc", not ".c", for C++ input - When fed with foo.c, clang++ 3.2 answers: +2012-12-26 Akim Demaille - clang: error: treating 'c' input as 'c++' when in C++ mode, - this behavior is deprecated + c: improve the definition of public types + * data/c.m4 (b4_token_enum): Improve comments. + (b4_value_type_define, b4_location_type_define): New, extracted + from... + (b4_declare_yylstype): here. + Separate the typedefs from the union/struct definitions. - * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use *.cc and *.hh - for C++. +2012-12-26 Akim Demaille -2013-04-08 Akim Demaille + doc: update variant usage + * doc/bison.texi, examples/variant.yy: Use "%define api.value.type variant", + instead of "%define variant". + +2012-12-26 Akim Demaille + + tests: check the "%define variant" is deprecated. + * tests/input.at: Rename some AT_SETUP to avoid that + AT_SETUP_STRIP thinks they contain %define directives. + ("%define" backward compatibility): Merge tests together + to speed up the test suite, and to make maintenance easier + (multiple AT_CHECK means multiple runs of the test suite to + be sure to have updated all the error messages). + Check the "%define variant" is properly obsoleted. + +2012-12-23 Akim Demaille + + %define variables: support value changes in deprecation + * src/muscle-tab.c (define_directive): Be robust to "assignment" + containing '='. + (muscle_percent_variable_update): Upgrade "variant" to "api.value.type". + Support such upgrade patterns. + Adjust callers. + + * data/bison.m4: Use api.value.type for variants. + * tests/c++.at: Adjust tests. + +2012-12-23 Akim Demaille + + diagnostics: treat obsolete %define variable names as obsolete directives + Instead of + + warning: deprecated %define variable name: 'namespace', use 'api.namespace' [-Wdeprecated] + + display (in -fno-caret mode): + + warning: deprecated directive: '%define namespace foo', use '%define api.namespace foo' [-Wdeprecated] + + and (in -fcaret mode): + + warning: deprecated directive, use '%define api.namespace toto' [-Wdeprecated] + %define namespace toto + ^^^^^^^^^ + + This is in preparation of cases where not only the variable is + renamed, but the values are too: + + warning: deprecated directive: '%define variant', use '%define api.value.type variant' [-Wdeprecated] + + * src/muscle-tab.c (define_directive): New. + (muscle_percent_variable_update): Take the value as argument, and use it + in the diagnostics. + Loop with a pointer instead of an index. + * tests/input.at (%define backward compatibility): Adjust. + +2012-12-23 Akim Demaille + + diagnostics: factor the deprecated directive message + * src/complain.h, src/complain.c (deprecated_directive): New. + * src/muscle-tab.c: Use it. + +2012-12-23 Akim Demaille + + variant: produce stable results + Improve the output by ensuring a well defined order for type switches. + + * src/uniqstr.h: Style changes for macro arguments. + (UNIQSTR_CMP): Replace by... + (uniqstr_cmp): this. + * src/uniqstr.c (uniqstr_cmp): New. + Produce well defined results. + * src/output.c: Use it. + +2012-12-23 Akim Demaille + + uniqstr: formatting changes + * src/uniqstr.h: Sort functions by object type. + +2012-12-23 Akim Demaille + + skeletons: fix an error message + * data/bison.m4 (b4_flag_if): Display the invalid value. + +2012-12-23 Akim Demaille + + tests: improve titles + * tests/local.at (AT_SETUP_STRIP): New. + (AT_SETUP): Use it to shorten the test titles: remove %defines, %language + and %skeleton whose arguments suffice. + * tests/synclines.at: Use more precise AT_SETUP. + +2012-12-23 Akim Demaille + + c++: comment changes + * data/c++.m4, data/glr.cc, data/lalr1.cc: Convert some /* ... */ + comments to //. + +2012-12-23 Akim Demaille + + c++: use // comments in the output + This is mostly used for the license header, the synclines, and the + generated tables: + + - /* STOS_[STATE-NUM] -- The (internal number of the) accessing + - symbol of state STATE-NUM. */ + + // STOS_[STATE-NUM] -- The (internal number of the) accessing + + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + * data/c.m4: Comment changes. + (b4_comment_): Expand the text argument. + Before this change, we were actually formatting M4 code as a + C comment, and then expand it. + (b4_comment): Fix the closing of comments: there is no reason to + add the (line) prefix before the closing "*/". + * data/c++.m4 (b4_comment): New. + +2012-12-21 Akim Demaille + + maint: disable sc_prohibit_test_backticks + * cfg.mk: here. + And fix typos. + Reported by Stefano Lattarini. + +2012-12-21 Akim Demaille + + maint: more syntax-checks + * cfg.mk (sc_prohibit_tab_based_indentation, sc_prohibit_test_backticks) + (sc_preprocessor_indentation, sc_space_before_open_paren): New, + stolen from Coreutils (2e9f5ca4ebbbdb6a9fa2dd3d5add3f7720a172d7). + +2012-12-21 Akim Demaille + + debug: no longer generate tabs + * src/closure.c, src/derives.c, src/nullable.c, tests/sets.at: Use + spaces. + +2012-12-21 Akim Demaille + + style changes: run cppi + Run it in src/ for a start. + + * src/AnnotationList.h, src/InadequacyList.h, src/Sbitset.h, + * src/closure.c, src/complain.h, src/flex-scanner.h, src/getargs.h, + * src/gram.h, src/graphviz.h, src/ielr.h, src/location.h, + * src/muscle-tab.h, src/named-ref.h, src/relation.h, src/scan-code.h, + * src/state.h, src/symtab.h, src/system.h, src/uniqstr.h: + Reindent preprocessor directives. + +2012-12-21 Akim Demaille + + style changes: untabify + * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl, m4/flex.m4, + * tests/glr-regression.at, tests/torture.at: here. + +2012-12-21 Akim Demaille + + tests: be robust to set -e. + * examples/test (run): here. + +2012-12-19 Akim Demaille + + variants: prohibit simple copies + The "variant" structure provides a means to store, in a typeless way, + C++ objects. Manipulating it without provide the type of the stored + content is doomed to failure. So provide a means to copy in a type + safe way, and prohibit typeless assignments. + + * data/c++.m4 (symbol_type::move): New. + * data/lalr1.cc: Use it. + * data/variant.hh (b4_variant_define): Provide variant::copy. + Let variant::operator= abort. + We cannot undefine it, yet, as it is still uses by the implicit + assigment in symbols, which must also be disabled. + +2012-12-19 Akim Demaille + + variant: more assertions + Equip variants with more checking code. Provide a means to request + includes. + + * data/variant.hh (b4_variant_includes): New. + * data/lalr1.cc: Use it. + * data/variant.hh (variant::built): Define at the end, as a private member. + (variant::tname): New. + Somewhat makes "built" useless, but let's keep both for a start, in + case using "typeinfo" is considered unacceptable in some environments. + Fix some formatting issues. + +2012-12-19 Akim Demaille gnulib: update -2013-04-08 Akim Demaille +2012-12-19 Akim Demaille - skeletons: avoid empty switch constructs - Reported by Rob Conde. - http://lists.gnu.org/archive/html/bug-bison/2013-03/msg00003.html + skeletons: fix output directives + * data/lalr1.cc, data/location.cc, data/glr.cc: Use b4_output_begin. + Broken during a merge. - * data/c.m4 (b4_symbol_actions): Rename as... - (_b4_symbol_actions): this. - (b4_symbol_actions): New wrapper. - Do not emit empty switches. - Adjust all b4_symbol_actions callers. +2012-12-19 Akim Demaille -2013-04-08 Akim Demaille + yacc.c: style changes + * data/yacc.c (b4_lex_param): Provide arguments with a name. - lalr1.cc: fix compiler warnings - Reported by Rob Conde. - http://lists.gnu.org/archive/html/bug-bison/2013-03/msg00003.html +2012-12-19 Akim Demaille - * data/stack.hh (operator=, stack(const stack&)): Make this class - uncopyable, i.e., "undefine" these operators: make them private and - don't implement them. - (clear): New. - * data/lalr1.cc: Use it instead of an assignment. - (parser): Make this class uncopyable. + glr.cc: simplifying the handling of parse/lex params + The fact that glr.cc uses glr.c makes the handling of parse params + more complex, as the parser object of glr.cc must be passed to the + parse function of glr.c. Yet not all the functions need access to + the parser object. -2013-04-08 Akim Demaille + * data/glr.cc (b4_parse_param_wrap): New. + Use them. - yacc.c: do not use __attribute__ unprotected - Reported by Victor Khomenko. - http://lists.gnu.org/archive/html/bug-bison/2013-04/msg00001.html +2012-12-19 Akim Demaille - * data/glr.c (YYUSE, __attribute__): Fuse their definition into... - * data/c.m4 (b4_attribute_define): this new macro. - * data/yacc.c, data/glr.c: Use it. + glr: rename lex params + * data/glr.c (b4_lex_param): Rename as... + (b4_lex_formals): this, for consistency. + Provide arguments a name. + (LEX): Adjust. + +2012-12-19 Akim Demaille + + glr.c: move function declaration earlier + * data/glr.c (yypstack, yypdumpstack): Declare earlier, to make + it easier to call them from other functions. + +2012-12-19 Akim Demaille + + %define variables: backward compatibility + * src/muscle-tab.c (muscle_percent_variable_update): Accept lex_symbol. + Reported by Roland Levillain. + +2012-12-16 Akim Demaille + + diagnostics: improve -fcaret for list of accepted values + Instead of + + input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + input.y:1.9-21: accepted value: 'pull' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + input.y:1.9-21: accepted value: 'push' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + input.y:1.9-21: accepted value: 'both' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + + report + + input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither' + %define api.push_pull "neither" + ^^^^^^^^^^^^^ + input.y:1.9-21: accepted value: 'pull' + input.y:1.9-21: accepted value: 'push' + input.y:1.9-21: accepted value: 'both' + + * src/complain.h (no_caret): New. + * src/complain.c (error_message): Use it. + * src/muscle-tab.c (muscle_percent_define_check_values): Use it. + * src/scan-skel.l (flag): Ditto. + * tests/input.at: Adjust and check. + +2012-12-16 Akim Demaille + + skeletons: simplify the handling of default api.location.type + * data/bison.m4 (b4_bison_locations_if): New. + * data/glr.cc, data/lalr1.cc: Use it. + +2012-12-16 Akim Demaille + + tests: address syntax-check failures + * cfg.mk: Ignore failures in timevar (uses GCC style configuration, + not gnulib's). + * doc/local.mk: Space changes. + * lib/main.c, tests/calc.at: Remove useless HAVE_ tests. + +2012-12-15 Akim Demaille + + remove duplicate definitions + * src/system.h: here, inherited from a merge. 2012-12-15 Akim Demaille tests: style changes * tests/glr-regression.at: Issue yyerror before yylex. +2012-12-15 Akim Demaille + + doc: fix dependencies + * doc/local.mk: here. + +2012-12-14 Akim Demaille + + doc: style fixes + * doc/bison.texi: Add a couple of missing @var and @code. + +2012-12-14 Theophile Ranquet + + doc: fix build dependencies + Suggested by Nick Bowler + + + * doc/local.mk: Avoid overwriting Automake's rules. + +2012-12-14 Akim Demaille + + Merge branch 'origin/maint' + * origin/maint: + maint: credit Wojciech Polak + maint: post-release administrivia + version 2.7 + yacc.c: scope reduction + tests: C90 compliance + fix C90 compliance + glr.c: scope reduction + gnulib: update + +2012-12-14 Theophile Ranquet + + symtab: add missing initializations + * src/symtab.c (semantic_type_new): Here. + +2012-12-14 Theophile Ranquet + + symtab: fix some leaks + * src/symlist.c (symbol_list_free): Deep free it. + * src/symtab.c (symbols_free, semantic_types_sorted): Free it too. + (symbols_do, sorted): Call by address. + +2012-12-14 Theophile Ranquet + + tests: remove use of PARSE_PARAM + * tests/header.at: Here. + 2012-12-13 Akim Demaille maint: credit Wojciech Polak @@ -137,6 +4166,29 @@ gnulib: update +2012-12-10 Theophile Ranquet + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + news: prepare for forthcoming release + doc: explain how mid-rule actions are translated + error: use better locations for unused midrule values + doc: various minor improvements and fixes + tests: ignore more useless compiler warnings + tests: be robust to C being compiled with a C++11 compiler + build: beware of Clang++ not supporting POSIXLY_CORRECT + maint: post-release administrivia + version 2.6.90 + build: fix syntax-check error. + cpp: simplify the Flex version checking macro + news: improve the carets example and fix a typo + cpp: improve the Flex version checking macro + carets: improve the code + maint: update news + build: keep -Wmissing-declarations and -Wmissing-prototypes for modern GCCs + build: drop -Wcast-qual + gnulib: update + 2012-12-09 Akim Demaille news: prepare for forthcoming release @@ -305,6 +4357,19 @@ 2012-12-06 Theophile Ranquet + Merge remote-tracking branch 'origin/maint' + * origin/maint: + misc: pacify the Tiny C Compiler + cpp: make the check of Flex version portable + misc: require getline + c++: support wide strings for file names + doc: document carets + tests: enhance existing tests with carets + errors: show carets + getargs: add support for --flags/-f + +2012-12-06 Theophile Ranquet + misc: pacify the Tiny C Compiler * src/graphviz.c (conclude_red): Remove a useless return. @@ -367,12 +4432,26 @@ * src/getargs.c (feature_flag): New global. * src/getargs.h (feature): New enum. +2012-12-05 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + getargs: don't label --language/-l as experimental + getargs: fix the locations of command-line input + errors: indent missing action code semicolon warning + 2012-12-04 Theophile Ranquet getargs: don't label --language/-l as experimental * NEWS: Announce it. * doc/bison.texi, src/getargs.c (usage): Here. +2012-12-03 Akim Demaille + + tests: minor improvements + * tests/calc.at (AT_CHECK_SPACES): To speed up, accept several files + at once, and factor some calls. + 2012-12-03 Theophile Ranquet getargs: fix the locations of command-line input @@ -389,6 +4468,18 @@ 2012-12-03 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: + parser: accept #line NUM + m4: use a safer pattern to enable/disable output + tests: beware of gnulib's need for config.h + gnulib: update + yacc.c, glr.c: check and fix the display of locations + formatting changes + glr.c: remove stray macro + +2012-12-03 Akim Demaille + parser: accept #line NUM * src/scan-gram.l (scanner): Accept '#line NUM'. (handle_syncline): Adjust to the possible missing file name. @@ -451,6 +4542,16 @@ 2012-11-29 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: + doc: minor fixes + doc: improve the index + doc: introduce api.pure full, rearrange some examples + yacc.c: support "%define api.pure full" + local.at: improvements + +2012-11-29 Akim Demaille + doc: minor fixes * doc/bison.texi: Use stderr for error messages. Meta-variables are usually spelled in lower case. @@ -485,6 +4586,12 @@ * test/calc.at (Simple LALR Calculator): Modernize. * tests/local.at (AT_YYERROR_ARG_LOC_IF): Adjust. +2012-11-28 Akim Demaille + + tests: check variants without locations + * tests/c++.at (Variants): Support non-use of locations, and + check its support. + 2012-11-26 Theophile Ranquet local.at: improvements @@ -494,6 +4601,39 @@ 2012-11-26 Akim Demaille + tests: use -fno-strict-aliasing with variants + Reported by Théophile Ranquet. + + * configure.ac (NO_STRICT_ALIAS_CXXFLAGS): New. + * tests/c++.at, tests/atlocal.in, examples/local.mk: Use it. + +2012-11-26 Akim Demaille + + tests: remove leftover + * tests/atlocal.in: Remove duplicate handling of --compile-c-with-cxx. + +2012-11-26 Akim Demaille + + doc: use %precedence instead of nonassoc when associativity is not wanted + * doc/bison.texi: here. + Formatting changes in some grammars. + Fix a %prec into %precedence. + +2012-11-26 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + yacc.c: always initialize yylloc + scanner: issue a single error for groups of invalid characters + tests: formatting changes + doc: one of the fixes for an ambiguous grammar was ambiguous too + doc: fix the dangling else with precedence directives + doc: prefer "token" to TOKEN + doc: formatting changes + scanner: use explicit "ignore" statements + +2012-11-26 Akim Demaille + Merge remote-tracking branch 'origin/branch-2.6' into maint * origin/branch-2.6: yacc.c: always initialize yylloc @@ -563,6 +4703,17 @@ scanner: use explicit "ignore" statements * src/scan-gram.l: here. +2012-11-13 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: close files in glr-regression + xml: match DOT output and xml2dot.xsl processing + xml: factor xslt space template + graph: fix a memory leak + xml: documentation + output: capitalize State + 2012-11-12 Theophile Ranquet tests: close files in glr-regression @@ -612,6 +4763,24 @@ 2012-11-12 Akim Demaille + tests: fix syntax-check errors + Reported by Théophile Ranquet. + + * tests/c++.at: Use AT_PARSER_CHECK. + Avoid using "strcmp", which triggers an error from syntax-check. + +2012-11-12 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: address syntax-check errors. + tests: use valgrind where appropriate + tests: use valgrind where appropriate + tests: don't expect $EGREP to support -w + tests: more possible error compiler messages for "#error" + +2012-11-12 Akim Demaille + maint: address syntax-check errors. * cfg.mk: Ignore the "error" call in tests/c++.at, it is not to be translated. @@ -665,6 +4834,22 @@ 2012-11-08 Akim Demaille + Merge branch 'maint' + * origin/maint: + regen + maint: post-release administrivia + version 2.6.5 + regen + tests: syntax-check + tests: beware of compilers that do not support POSIXLY_CORRECT + gnulib: update + +2012-11-08 Akim Demaille + + regen + +2012-11-08 Akim Demaille + Merge branch 'branch-2.6' into maint * origin/branch-2.6: maint: post-release administrivia @@ -718,6 +4903,32 @@ 2012-11-06 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: (24 commits) + tests: calc: modernize the use of locations + tests: remove useless location initializations + lalr1.cc: always initialize yylval. + tests: check that C and C++ objects can be linked together. + yacc.c: also disable -Wuninitialized. + glr.cc, yacc.c: initialize yylloc properly + yacc.c, glr.c: a better YY_LOCATION_PRINT + yacc.c: simplify initialization + doc: formatting changes + c++: fix position operator signatures + tests: remove useless location initialization. + tests: fix locations in C + tests: handle %parse-param in the generated yyerror + tests: simplifications + grammars: fix display of nul character in error message + tests: sort + tests: cosmetic changes + comment changes + autoconf: update + gnulib: update + ... + +2012-11-06 Akim Demaille + Merge branch 'branch-2.6' into maint * origin/branch-2.6: (24 commits) tests: calc: modernize the use of locations @@ -856,12 +5067,43 @@ AT_YYERROR_DECLARE, now that they handle properly the parse-params. Be sure to let AT_BISON_OPTION_PUSHDEFS now what parse-params are used. -2012-11-05 Akim Demaille +2012-11-05 Akim Demaille + + tests: simplifications + * tests/actions.at (Exotic Dollars): Formatting changes. + Use AT_FULL_COMPILE. + (AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove useless initialization of @$. + +2012-11-01 Akim Demaille + + lalr1.cc: rename lex_symbol as api.token.constructor + * data/bison.m4 (b4_lex_symbol_if): Rename as... + (b4_token_ctor_if): this. + Depend upon api.token.constructor. + * data/c++.m4, data/lalr1.cc: Adjust. + * doc/bison.texi: Fix all the occurrences of lex_symbol. + * etc/bench.pl.in: Adjust. + * examples/variant.yy: Likewise. + + * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): + Handle AT_TOKEN_CTOR_IF. + * tests/c++.at: Adjust to using api.token.constructor and AT_TOKEN_CTOR_IF. + Simplify the test of both build call styles. + (AT_CHECK_VARIANTS): Rename as... + (AT_TEST): this. + And undef when done. + +2012-11-01 Akim Demaille - tests: simplifications - * tests/actions.at (Exotic Dollars): Formatting changes. - Use AT_FULL_COMPILE. - (AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove useless initialization of @$. + examples: simplify/improve + * examples/variant.yy: Put yylex in yy::, and simplify accordingly. + Minor formatting changes. + +2012-11-01 Akim Demaille + + bison.m4: support b4_*_if macros whose name differ from their variable + * data/bison.m4 (b4_percent_define_if_define_, b4_percent_define_if_define): + Accept a second argument. 2012-11-01 Akim Demaille @@ -924,6 +5166,90 @@ Therefore, remove the initialization of yylloc's field. * data/glr.c: Likewise. +2012-10-26 Theophile Ranquet + + graphs: fix spacing refactoring + * src/print_graph.c (print_lhs, print_core): Here. + +2012-10-26 Theophile Ranquet + + tests: make deprecation tests more specific + * tests/input.at (Deprecated directives): Here, don't generate unrelated errors + or warnings. + +2012-10-26 Theophile Ranquet + + tests: fix AT_BISON_CHECK_WARNINGS_ stderr rewriting + * tests/input.at (Deprecated directives): Avoid spurious error. + * tests/locat.at (AT_BISON_CHECK_WARNINGS): Adjust for recent changes. + +2012-10-26 Theophile Ranquet + + scan-skel.l: consider m4 notes as related to "complaint" errors + * src/scan-skel.l (flag): Here. + +2012-10-26 Theophile Ranquet + + warnings: distinguish context information based on warning type + * src/scan-code.l (show_sub_message, show_sub_messages): Take a new warnings + argument. + +2012-10-26 Theophile Ranquet + + warnings: fix early exit of warnings treated as errors + Treating warnings as errors caused Bison to exit earlier than needed, making it + hide warnings that would have been printed had -Werror not been set. + + Also, fix a bug that caused some context information of errors to not be + shown. + + * src/complain.c (complaint_issued): Rename as... + (complaint_status): This, and change its type from boolean to + * src/complain.h (err_status): This, new enumeration. + * src/main.c (main): Adjust (only finish early if an actual complaint was + risen, not a mere warning treated an error). + * src/reader.c: Adjust. + +2012-10-26 Theophile Ranquet + + tests: reindent for legibility + * tests/local.at (AT_BISON_CHECK_WARNINGS_): Here. + +2012-10-26 Akim Demaille + + build: fix Texinfo compilation + * doc/local.mk: fix dependencies. + +2012-10-26 Akim Demaille + + regen + +2012-10-26 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: (46 commits) + doc: minor style change + maint: use gendocs's new -I option + regen + yacc.c: do not define location support when not using locations + maint: be compilable with GCC 4.0 + tests: address a warning from GCC 4.4 + tests: don't use options that Clang does not support + tests: restore the tests on -Werror + regen + parse-gram: update the Bison interface + fix comment + maint: post-release administrivia + version 2.6.4 + regen + 2.6.4: botched 2.6.3 + maint: post-release administrivia + version 2.6.3 + gnulib: update + tests: check %no-lines + NEWS: warnings with clang + ... + 2012-10-26 Akim Demaille Merge branch 'branch-2.6' into maint @@ -994,6 +5320,17 @@ Adjust dependencies. * src/reader.h: Don't use "named_ref" as a formal argument name. +2012-10-26 Theophile Ranquet + + misc: document TESTSUITEFLAGS in README-hacking + * README-hacking: Document -j and -k flags. + +2012-10-26 Theophile Ranquet + + deprecation: add tests + * tests/input.at (Deprecated directives warn, Non-deprecated + directives don't, Unput doesn't mess up locations): New tests. + 2012-10-25 Akim Demaille tests: address a warning from GCC 4.4 @@ -1042,6 +5379,17 @@ fix comment * data/c.m4 (b4_YYDEBUG_define): here. +2012-10-24 Theophile Ranquet + + regen + +2012-10-24 Theophile Ranquet + + deprecation: issue warnings in scanner + * src/parse-gram.y: Move the handling of (three) deprecated constructs ... + * src/scan-gram.l: ...Here, and issue warnings. + (DEPRECATED): New. + 2012-10-23 Akim Demaille Merge branch 'branch-2.6' into maint @@ -1364,9 +5712,57 @@ 2012-10-16 Akim Demaille + news: spell check + * NEWS: here. + +2012-10-16 Akim Demaille + + Merge branch 'maint' + * origin/maint: + java: use api.location.type and api.position.type + +2012-10-16 Akim Demaille + + variables: use singular in %define variable names + See http://lists.gnu.org/archive/html/bison-patches/2012-02/msg00045.html + + * doc/bison.texi, src/lalr.c, src/main.c, src/muscle-tab.c, + * src/print.c, src/reader.c, src/tables.c, tests/conflicts.at, + * tests/input.at, tests/reduce.at: + s/lr.default-reductions/lr.default-reduction/ + s/lr.keep-unreachable-states/lr.keep-unreachable-state/. + * NEWS: Document. + +2012-10-16 Akim Demaille + java: fixes * data/java.m4: Remove stray M4 characters. +2012-10-16 Akim Demaille + + api.tokens.prefix -> api.token.prefix + See + http://lists.gnu.org/archive/html/bison-patches/2012-02/msg00045.html + Note that api.tokens.prefix has not been released, yet. + + * NEWS, data/bison.m4, doc/bison.texi, tests/c++.at, + * tests/calc.at, tests/java.at, tests/local.at: Do it. + * src/muscle-tab.c (muscle_percent_variable_update): Ensure + backward compatibility. + +2012-10-15 Theophile Ranquet + + scan-skel.l: shift complain_args arguments + Because argv[0] is never used, shift it out from the argument list. + + * src/complain.c (complain_args): Here. + * src/scan-skel.l (at_complain): Adjust argv and argc. + +2012-10-15 Theophile Ranquet + + scan-skel.l: formatting changes + * src/scan-skel.l (fail_for_at_directive_too_few_args): Here. + 2012-10-12 Akim Demaille java: use api.location.type and api.position.type @@ -1375,6 +5771,23 @@ 2012-10-12 Akim Demaille + Merge branch 'maint' + * origin/maint: + tests: check %no-lines + tests: minor simplification + graphs: stylistic changes. + graphs: minor style changes + graphs: show reductions + graphs: style: prefix state number with "state" + graphs: style: use left justification for states + graphs: style: prefix rules and change shapes + obstack: import obstack_finish0 from master + c++: api.location.type + muscles: a function for backward compatibility + maint: more macros + +2012-10-12 Akim Demaille + tests: check %no-lines * tests/synclines.at: here. @@ -1437,6 +5850,29 @@ obstack: import obstack_finish0 from master * src/system.h (obstack_finish0): New. +2012-10-11 Akim Demaille + + Merge branch 'maint' + * origin/maint: + NEWS: warnings with clang + warnings: avoid warnings from clang + tests: no longer disable -O compiler options + yacc.c: initialize yylval in pure-parser mode + skeletons: style changes + lalr1.cc: document exception safety + lalr1.cc: check exception safety of error handling + lalr1.cc: check (and fix) %printer exception safety + lalr1.cc: check (and fix) %initial-action exception safety + lalr1.cc: fix exception safety + lalr1.cc: check exception safety. + lalr1.cc: indentation fixes. + lalr1.cc: don't leave macros define to nothing + tests: minor improvements + tests: use $PERL instead of perl + build: look for Perl in configure. + tests: fix sed portability issues + tests: diff -u is not portable + 2012-10-09 Akim Demaille c++: api.location.type @@ -1652,6 +6088,69 @@ 2012-10-04 Akim Demaille + Merge branch 'maint' + * origin/maint: + maint: word changes + lalr1.cc: fix test suite portability + maint: fix an erroneous include + tests: check that headers are self contained + doc: add missing documentation for --report + +2012-10-04 Akim Demaille + + scan-skel: use the scanner to reject all invalid directives + * src/scan-skel.l: Use a simpler and more consistent pattern escaping + scheme. + Catch all the invalid directives here by just removing the previous + catch-all-but-alphabetical rule. + +2012-10-04 Theophile Ranquet + + scan-skel: recognize the @directives directly in scanner + * src/scan-skel.l (at_directive, at_init): New. + (at_ptr): New, function pointer used to call the right at_directive + function (at_basename, etc.). + (outname): Rename as... + (out_name): this, for consistency with out_lineno. + +2012-10-04 Theophile Ranquet + + scan-skel: split @directive functions + * src/scan-skel.l (at_directive_perform): Split as... + (at_basename, at_complain, at_output): these. + +2012-10-04 Theophile Ranquet + + errors: support indented context info in m4 macros + * TODO: Address the issue, so remove it. + * data/bison.m4: Use b4_error with [[note]] rather than a complain_at + for context information. + * src/complain.c (complain_args): Take an additional argument, an + indentation pointer, to allow the dispatching of context information. + * src/complain.h (complain_args): Adjust prototype. + * src/scan-skel.l (at_directive_perform): Recognize the new @note mark. + * tests/input.at: Adjust. + +2012-10-04 Theophile Ranquet + + errors: factor b4_error @directives + Instead of @complain, @warn, and @fatal, use a unique @complain + directive. This directive's first argument is "complain", "warn", etc. + + * data/bison.m4 (m4_error): Here. + * src/scan-skel.l (at_directive_perform): Adjust. + (flag): Replace the switch by safer and more explicit if branches. + +2012-10-04 Theophile Ranquet + + errors: pointerize complain_at_indent + * src/complain.c (complain_at_indent): Rename as... + (complaint_indent): This, and take the location as a pointer. + * src/complain.h, src/muscle-tab.c, src/reader.c, src/scan-code.l, + src/symtab.c: Adjust. + +2012-10-04 Akim Demaille + maint: word changes * README-hacking (Typical errors): Improve wording. @@ -1691,6 +6190,97 @@ 2012-10-01 Akim Demaille + build: use gnulib's non-recursive-gnulib-prefix-hack + Suggested by Jim Meyering. + + * etc/prefix-gnulib-mk: Remove, as it is now provided by... + * bootstrap.conf (modules): the non-recursive-gnulib-prefix-hack module. + * build-aux/.gitignore, configure.ac, m4/.gitignore: Adjust. + +2012-10-01 Akim Demaille + + warnings: simplify the m4 interface + * data/bison.m4 (error_at): Replace... + (error): this. + (b4_warn, b4_complain, b4_fatal): Bounce to their _at equivalent, + with empty location. + * src/scan-skel.l (at_directive_perform): Simplify accordingly. + +2012-10-01 Theophile Ranquet + + warnings: separate flags_argmatch + This function is now a mere iterator that calls flag_argmatch, + a new function, that matches a single option parameter. + + * src/getargs.c (flag_argmatch): New, taken from... + (flags_argmatch): Here. + +2012-10-01 Theophile Ranquet + + warnings: refactoring + The code here was too confusing, this seems more natural. + + * src/complain.c (error_message): Move the indentation check and the category + output to complains. Also, no longer take a 'warnings' argument. + (complains): Factor calls to error_message. + +2012-10-01 Theophile Ranquet + + formatting changes + * src/complain.c: Here. + +2012-10-01 Theophile Ranquet + + warnings: organize variadic complaints call + Move the dispatch of variadic complains to complain.c, rather than do + it in a scanner. + + * src/complain.h, src/complain.c (complain_args): New. + * src/scan-skel.l (at_directive_perform): Use it. + +2012-10-01 Theophile Ranquet + + warnings: fusion of complain and complain_at + These functions are very similar, and keeping them seperate makes + future improvements difficult, so merge them. + + This impacts 89 calls. + + * src/bootstrap.conf: Adjust. + * src/complain.c (complain, complain_at): Merge into... + (complain): this. + (complain_args): Adjust. + * src/complain.h, src/conflicts.c, src/files.c, src/getargs.c, + * src/gram.c, src/location.c, src/muscle-tab.c, src/parse-gram.y, + * src/reader.c, src/reduce.c, src/scan-code.l, src/scan-gram.l, + * src/scan-skel.l, src/symlist.c, src/symtab.c: + Adjust. + +2012-10-01 Theophile Ranquet + + warnings: remove spurious suffixes on context + Rectify a bug that introduced suffixes out of place. + + * src/complainc.c (complains): Handle all three special warning bits. + * src/scan-code.l (show_sub_message): Remove useless argument. + * tests/named-refs.at: Adjust. + +2012-10-01 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + headers: move CPP guards into YY_*_INCLUDED to avoid collisions + minor changes. + +2012-10-01 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + gnulib: update + errors: indent "user token number redeclaration" context + +2012-10-01 Akim Demaille + headers: move CPP guards into YY_*_INCLUDED to avoid collisions See . @@ -1720,6 +6310,81 @@ complain_at_indent to output with increased indentation level. * tests/input:at: Apply this change. +2012-09-27 Theophile Ranquet + + errors: don't display "warnings treated as errors" + This line doesn't add any meaningful information anymore, the appended + [-Werror=CATEGORY] is enough. It is actually more insightful, as it + allows to distinguish warnings treated as errors from those that + aren't. This line is also removed by gcc 4.8. + + * src/complain.c (set_warnings_issued): The only action left was + checking if the error bit corresponding to the warning issued was set, + and that function was only called once. Therefore, remove it, and do + its job directly in the caller... + (complains): here. + * src/complains.h: Adjust. + * tests/input.at: Adjust. + * NEWS: Document this change. + +2012-09-27 Akim Demaille + + errors: change output, and improve -y coherence + The prefix of warnings treated as errors is now "error: ". Also, their + suffix now reflects the changes in the Werror option format. + + An output for -Werror=other used to be: + bison: warnings being treated as errors + input.y:1.1: warning: stray ',' treated as white space [-Wother] + + It is now: + bison: warnings being treated as errors + input.y:1.1: error: stray ',' treated as white space [-Werror=other] + + The line "warnings being treated as errors" no longer adds any info, + it will be removed in a forthcoming change. + + * NEWS: Add entry "Enhancement of the -Werror" + * doc/bison.texi: Move the warnings-as-error to a new bullet. + * src/complain.c (complains): Refactor, change the prefix of warnings + that are treated as errors. + (warnings_print_categories): Support for [-Werror=CATEGORY] display + * src/getargc.c (getargs): -y implies -Werror=yacc + * tests/input.at: Update expected --yacc output for coherence. + +2012-09-27 Theophile Ranquet + + errors: introduce the -Werror=CATEGORY option + This new option is a lot more flexible than the previous one. Its + details will be discussed in the NEWS and info file, in a forthcoming + change. + + If no category is specified (ie: used as simply "-Werror"), the + functionality is the same as before. + + * src/complain.c (errors_flag): New variable. + (set_warning_issued): Accept warning categories as an argument. + * src/complain.h (Wall): Better definition. + * src/getargs.c (flags_argmatch): Support for the new format. + (usage): Update -Werror to -Werror[=CATEGORY] format. + + * src/complain.c (errors_flag): New variable. + (set_warning_issued): Accept warning categories as an argument. + * src/complain.h (Wall): Better definition. + * src/getargs.c (flags_argmatch): Support for the new format. + (usage): Update -Werror to -Werror=[CATEGORY] format. + +2012-09-26 Akim Demaille + + Merge branch 'maint' + * maint: + warnings: introduce -Wdeprecated in the usage info + errors: prefix the output with "error: " + errors: indent "invalid value for %define" context + errors: indent "%define var" redefinition context + errors: indent "symbol redeclaration" context + errors: indent "result type clash" error context + 2012-09-26 Theophile Ranquet warnings: introduce -Wdeprecated in the usage info @@ -1728,6 +6393,18 @@ * src/getargs.c (usage): Insert here. +2012-09-26 Akim Demaille + + regen + +2012-09-26 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + regen + yacc: fix handling of CPP guards when no header is generated + gnulib: update + 2012-09-26 Theophile Ranquet errors: prefix the output with "error: " @@ -1824,6 +6501,38 @@ 2012-09-25 Akim Demaille + warnings: use the regular interface for s/r and r/r conflicts + The current routines used to display s/r and r/r conflicts are both + inconvenient from the programmer point of view (they do not use the + warning infrastructure) and for the user (the messages are rather + terse, not necessarily pleasant to read, and because they don't use + the same routines, they look different). + + It was due to the belief (dating back to the initial checked-in + version of Bison) that, at some point, POSIX Yacc mandated the format + for these messages. Today, the Open Group's manual page for Yacc, + , + explicitly states that the format of these messages is unspecified. + See commit be7280480c175bed203883f524c7dcd6cf37c13d and + . + + For a discussion on the chosen warning format, see + http://lists.gnu.org/archive/html/bison-patches/2012-09/msg00039.html + + In an effort to factor the handling of errors and warnings, use the + Bison warning routines to report these messages. + + * src/conflicts.c (conflicts_print): Rewrite with clearer sections + about S/R and then R/R conflicts. + (conflict_report): Remove, inlined in its sole + caller... + (conflicts_output): here. + * tests/conflicts.at, tests/existing.at, tests/glr-regression.at, + * tests/reduce.at, tests/regression.at: Adjust the expected results. + * NEWS: Update. + +2012-09-25 Akim Demaille + regen 2012-09-25 Akim Demaille @@ -1848,6 +6557,86 @@ gnulib: update +2012-09-21 Akim Demaille + + conflicts: refactor the counting routines + * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Rename as... + (count_sr_conflicts, count_rr_conflicts): these. + Use size_t for counts. + (count_sr_conflicts, count_rr_conflicts): New. + Use them. + +2012-09-21 Akim Demaille + + %expect-rr is for GLR only + * src/conflicts.c (conflicts_print): Complain about %expect-rr if not + in GLR mode, regardless of the number of reduce/reduce conflicts. + * tests/conflicts.at (%expect-rr non GLR): New test. + * NEWS: Update. + +2012-09-21 Akim Demaille + + TODO: lalr1.cc master vs maint + * TODO: here. + +2012-09-21 Akim Demaille + + c++: coding style fixes + * data/lalr1.cc, tests/c++.at: Formatting changes. + +2012-09-21 Akim Demaille + + Revert "introduced a GCC-like -Werror=type" + This reverts commit 981c53e257f1974854edc4f6ad0e88c7f18e2bea. + +2012-09-21 Akim Demaille + + Revert "made previous commit less hairy" + This reverts commit fd01e1d05ea3e627033d148b5400b99a18ac7ba3. + +2012-09-21 Akim Demaille + + Revert "new Werror report format fixed in a test" + This reverts commit 41511178a71ebaf81bde7ffc682c575537af45cb. + +2012-09-21 Theophile Ranquet + + new Werror report format fixed in a test + * tests/input.at : replaced [-Wyacc] with [-Werror=yacc] + + todo: fix the other failed test of the suite, tests/conflicts.at:1554 + +2012-09-21 Theophile Ranquet + + made previous commit less hairy + * src/getargs.c : here + +2012-09-20 Theophile Ranquet + + introduced a GCC-like -Werror=type + * src/complain.h : errors_flag variable + * src/complain.c : actual stuff happens here + * src/conflits.c : differentiated SR and RR conflicts + * src/getargs.c : flags_argmatch recognizes the new -Werror format + +2012-09-04 Akim Demaille + + regen + +2012-09-04 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: remove useless file + update files to ignore + remove useless include + use locale-indep. c_is* functions for parsing, not isspace, isprint etc + gnulib: update + --help: include a place to report translation issues + tests: style changes + tests: fix push-pull test + yacc.c: style changes + 2012-09-04 Akim Demaille maint: remove useless file @@ -1886,14 +6675,87 @@ 2012-09-03 Akim Demaille - --help: include a place to report translation issues - http://lists.gnu.org/archive/html/bug-bison/2012-08/msg00007.html - shows that it is useful to help users report translation issues. - While at it, include other informative bits that the coreutils shows. - - * src/getargs.c (usage): Report more URLs where the user can - refer to. - Mostly copied/pasted from coreutils' emit_ancillary_info function. + --help: include a place to report translation issues + http://lists.gnu.org/archive/html/bug-bison/2012-08/msg00007.html + shows that it is useful to help users report translation issues. + While at it, include other informative bits that the coreutils shows. + + * src/getargs.c (usage): Report more URLs where the user can + refer to. + Mostly copied/pasted from coreutils' emit_ancillary_info function. + +2012-09-03 Akim Demaille + + news: style changes + * NEWS: Minor improvements. + +2012-09-03 Akim Demaille + + use -Wdeprecated for obsolete %define variable names + * src/muscle-tab.c (muscle_percent_variable_update): Here. + * tests/input.at (%define backward compatibility): Update expectations. + +2012-09-03 Akim Demaille + + introduce -Wdeprecated + GCC seems to be using "deprecated" consistently over "obsoleted", so + use -Wdeprecated rather than -Wobsolete. + + * src/complain.h (warnings): Add Wdeprecated. + * src/complain.c (warnings_print_categories): Adjust. + * src/getargs.c: Likewise. + * doc/bison.texi: Document it. + + * src/scan-code.l: Use this category for the trailing ';' support. + * tests/actions.at: Adjust expected output. + +2012-09-03 Akim Demaille + + undefined but unused is a warning + * src/symtab.c (symbol_check_defined): Undeclared symbols are only + a warning. + * tests/input.at (Undeclared symbols used for a printer or destructor): + Rename as... + (Undefined symbols): this, and check this case. + * NEWS: Doc it. + +2012-09-03 Akim Demaille + + glr.cc: %defines is no longer mandatory + * data/glr.cc: No longer require %defines. + When it is not given, define the position and location classes instead + of including their headers. + (b4_shared_declarations): Use the original parse-params. + * data/glr.c (b4_shared_declarations): Define only if undefined. + * tests/actions.at, tests/calc.at: No longer force the use of %defines + for glr.cc. + * NEWS: Doc it. + +2012-09-03 Akim Demaille + + todo: check push parsers + +2012-09-03 Akim Demaille + + style: remove useless C++ provisio + * src/complain.h: here. + +2012-09-03 Akim Demaille + + parser: style changes + * src/parse-gram.y: Avoid deprecated directives. + +2012-09-03 Akim Demaille + + doc: address a fixme + * doc/bison.texi (Calc++ Parser): Add a cross-reference. + +2012-09-03 Akim Demaille + + style changes + * data/glr.cc, tests/actions.at: Fix comments. + * src/symtab.h, src/symtab.c: Fix indentation/comments. + * src/symlist.c: Fix indentation. 2012-08-31 Akim Demaille @@ -1914,6 +6776,92 @@ yacc.c: style changes * data/yacc.c: (yytoken): Define with initial value. +2012-08-12 Akim Demaille + + refactoring: define variables with a value + * src/muscle-tab.c: Where possible, fuse definition and initial assignment. + +2012-08-12 Akim Demaille + + minor refactoring: shorten variable names + * src/scan-skel.l (at_directive_argc, at_directive_argv) + (AT_DIRECTIVE_ARGC_MAX): Rename as... + (argc, argv, ARGC_MAX): these, as there is no possible confusion. + (flags): New. + (QPUTS): Remove, inline its only use. + +2012-08-12 Akim Demaille + + obstacks: simplifications + * src/system.h (obstack_finish0): New. + Use it to simplify several uses. + * src/muscle-tab.h (MUSCLE_INSERTF): New. + * src/muscle-tab.c: Use obstack_printf where simpler. + +2012-08-12 Akim Demaille + + minor refactoring in user code scanning + * src/scan-code.l (show_sub_message, show_sub_messages): Instead of a + Boolean, take a "warnings" argument. + Avoid storing printf-like format strings in a variable, so that GCC + can check them. + +2012-08-12 Akim Demaille + + minor refactoring in user code scanning + * src/scan-code.l (show_sub_message): New, extracted from... + (show_sub_messages): here. + +2012-08-03 Akim Demaille + + tests: strengthen the trailing spaces check + * tests/calc.at: here. + * data/glr.c: Fix accordingly. + +2012-08-03 Akim Demaille + + regen + +2012-08-03 Akim Demaille + + Merge branch 'maint' + * origin/maint: + maint: post-release administrivia + version 2.6.2 + NEWS: update. + yacc: remove trailing end of line at end of file + thanks: fix a contributor name + gnulib: update + tests: synch line -> syncline, for consistency + tests: synclines: style changes + tests: synclines: fix perl invocation + regen + c++: trailing end-of-lines in %parse-param + tests: simplify + +2012-08-03 Akim Demaille + + regen + +2012-08-03 Akim Demaille + + remove support for lint + Basically revert commit 12ce2df60d16961eaa03a5aa009eeaa645e4e1cb. + http://lists.gnu.org/archive/html/bison-patches/2012-08/msg00004.html + + * data/c.m4, data/glr.c, data/yacc.c (YYID): Remove. + No longer use ARGSUSED. + * src/getargs.c: Restore simpler inclusion of getopt.h (anyway, since + then we now use gnulib which certainly protects us from such issues). + +2012-08-03 Akim Demaille + + skeletons: renamings after knr removal + * data/c.m4 (b4_yydestruct_generate, b4_yy_symbol_print_generate): + Rename as... + (b4_yydestruct_define, b4_yy_symbol_print_define): these, for consistency. + * data/glr.c, data/glr.cc, data/yacc.c: Adjust. + 2012-08-03 Akim Demaille maint: post-release administrivia @@ -1928,6 +6876,58 @@ 2012-08-02 Akim Demaille + c++: fix a comment + * data/c++.m4: Be sure to attach a ';' to its declaration, otherwise + it appears in the preceding comment. + +2012-08-02 Akim Demaille + + skeletons: simplify after knr removal + * data/c.m4 (b4_yydestruct_generate, b4_yy_symbol_print_generate): + They no longer need an argument, it has a single possible value. + * data/glr.c, data/yacc.c: Adjust. + +2012-08-02 Akim Demaille + + skeletons: renamings after knr removal + * data/c.m4 (b4_c_comment_, b4_c_args, b4_c_function_def) + (b4_c_function_decl, b4_c_formals, b4_c_call, b4_c_arg): Rename as... + (b4_comment, b4_args, b4_function_define, b4_function_declare, + b4_formals, b4_function_call, b4_arg): these. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Adjust. + +2012-08-02 Akim Demaille + + skeletons: b4_args -> b4_join to prepare forthcoming changes + * data/bison.m4 (b4_args, _b4_args): Rename as... + (b4_join, _b4_join): these. + * data/c++.m4, data/lalr1.cc, data/variant.hh: Adjust. + +2012-08-02 Akim Demaille + + regen + +2012-08-02 Akim Demaille + + YYPARSE_PARAM: drop support + * data/yacc.c: No longer support it. + * doc/bison.texi, tests/headers.at: Adjust. + * NEWS: Document. + +2012-08-02 Akim Demaille + + skeletons: remove K&R C support + * data/c.m4 (b4_c_modern, b4_c_knr_formal_names, b4_c_knr_formal_decls) + (b4_c_knr_formal_decl, b4_c_formal_names, b4_c_formal_decls) + (b4_c_formal_decl): Remove. + (b4_c_ansi_formal_names, b4_c_ansi_formal_decls, b4_c_ansi_formal_decl): + Rename as... + (b4_c_formal_names, b4_c_formal_decls, b4_c_formal_decl): + these. + * data/glr.c, data/glr.cc, data/yacc.c: Adjust. + +2012-08-02 Akim Demaille + NEWS: update. * NEWS: Catch up with the other changes from 2.6.1. @@ -1996,6 +6996,86 @@ 2012-07-31 Akim Demaille + todo: more items + * TODO: $ in the epilogue, and obstack_copy. + +2012-07-31 Akim Demaille + + Merge branch 'maint' + * maint: + use obstack_printf + scanner: restore a missing start condition + gnulib: update + maint: post-release administrivia + version 2.6.1 + gnulib: update + maint: fix some syntax-check issues + tests: do not depend on __cplusplus to decide for C++ or C output + +2012-07-31 Akim Demaille + + tests: comment changes + * tests/actions.at, tests/input.at: here. + +2012-07-31 Akim Demaille + + tests: really check the set of generated files + * tests/output.at (AT_CHECK_OUTPUT): It used to check that the + expected files are indeed generated, but it did not check that + there are no additional ones. + Do that, and adjust expectations (in particular alphabetical order). + +2012-07-31 Akim Demaille + + lalr1.cc: do not create stack.hh without %defines + * data/stack.hh (b4_stack_define): New. + * data/lalr1.cc: Use it when %defines is not passed. + * tests/output.at: Adjust expected output. + +2012-07-31 Akim Demaille + + lalr1.cc: location.hh and position.hh are not generated without %defines + * data/location.cc (b4_position_define, b4_location_define): New. + (location.hh, position.hh): Generate only if %defines. + * data/lalr1.cc: therefore, define these classes when locations are + needed, but headers are not generated. + * tests/output.at: Check that these files are not generated. + * NEWS: Document. + +2012-07-31 Akim Demaille + + lalr1.cc: no longer require %defines. + * data/lalr1.cc: Generate the parser header only when %defines is + passed. + * tests/calc.at: Check it. + +2012-07-31 Akim Demaille + + skeletons: style changes + * data/glr.c, data/lalr1.cc: Use more consistent comments, + and YY_NULL declaration. + +2012-07-31 Akim Demaille + + glr.cc, lalr1.cc: define b4_shared_declarations + * data/glr.cc, data/lalr1.cc: here. + The name is no longer right, but at least it is consistent with + the other skeletons. + +2012-07-31 Akim Demaille + + glr.cc: no longer require location support + * data/glr.cc: Use b4_locations_if where appropriate. + * data/lalr1.cc: M4 quotation changes to highlight code duplication + with glr.cc. + * tests/calc.at: Check glr.cc with and without %location. + While at it, fuse multiple %parse-params into one. + * tests/actions.at: Simplify. + * NEWS: Doc this. + Some other wording changes. + +2012-07-31 Akim Demaille + use obstack_printf This is not just nicer, it is also much safer, since we were using sprintf... @@ -2053,6 +7133,10 @@ 2012-07-27 Akim Demaille + regen + +2012-07-27 Akim Demaille + tests: do not depend on __cplusplus to decide for C++ or C output Since we do support compiling C code with a C++ compiler. @@ -2060,6 +7144,40 @@ 2012-07-27 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: (29 commits) + regen + synclines: remove spurious empty line + also support $$ in the %initial-action + skeletons: b4_dollar_pushdef and popdef to simpify complex definitions + regen + printer/destructor: translate only once + factor the handling of m4 escaping + news: schedule the removal of the ";" hack + style changes in the scanners + regen + support $$ in printers and destructors + scan-code: factor the handling of the type in $$ + muscles: fix another occurrence of unescaped type name + glr.cc: fix the handling of yydebug + gnulib: update + formatting changes + tests: fix an assertion + tests: adjust to GCC 4.8, which displays caret errors + be sure to properly escape type names + obstack_quote: escape and quote for M4 + muscles: shuffle responsabilities + muscles: make private functions static + muscles: rename private functions/macros + obstack_escape: escape M4 characters + remove dead macro + maint: style changes + doc: avoid problems with case insensitive file systems + configure: fix botched quoting + news: fix typo. + +2012-07-27 Akim Demaille + regen 2012-07-27 Akim Demaille @@ -2289,6 +7407,160 @@ checking for Java compiler... gcj -C -fsource=1.3 -ftarget=1.4 ... +2012-07-24 Akim Demaille + + regen + +2012-07-24 Akim Demaille + + yystype, yyltype: remove. + * data/c.m4: here. + * NEWS: Doc it. + +2012-07-22 Akim Demaille + + regen + +2012-07-22 Akim Demaille + + YYFAIL: remove. + * data/lalr1.java, data/yacc.c, src/scan-code.l: Remove YYFAIL support. + * NEWS, TODO: Update. + +2012-07-22 Akim Demaille + + todo: update. + * TODO: obsolete items. + +2012-07-22 Akim Demaille + + regen. + +2012-07-22 Akim Demaille + + space changes. + * data/bison.m4 (b4_symbol_action): Remove spurious eol in the output. + +2012-07-22 Akim Demaille + + parser: fix %printer usage. + * src/parse-gram.y: Instead of stderr, using yyo. + +2012-07-22 Akim Demaille + + parser: factor the handling of code_props + * src/parse-gram.y: Now that %printer and %destructor are treated + equally, let... + (code_props_type): handle them. + +2012-07-22 Akim Demaille + + parser: factor handling of type tags + * src/parse-gram.y: Now that <*> and <> are processed like regular + tags, let... + (tag): handle them. + +2012-07-22 Akim Demaille + + regen. + +2012-07-22 Akim Demaille + + simplify the handling of <> and <*>'s code_props. + Currently they are treated in separated variables, contrary to other + code_props. This duplicates code (and messages for translators) + uselessly, as demonstrated by the fact that thanks to this patch, now + useless <*> and <> code_props are reported like the others. + + * src/parse-gram.y (generic_symlist_item): Treat "<*>" and "<>" as regular + type tags. + * src/symlist.h, src/symlist.c (symbol_list_default_tagged_new) + (symbol_list_default_tagless_new,SYMLIST_DEFAULT_TAGGED) + (SYMLIST_DEFAULT_TAGLESS): Remove. + * src/symtab.h, src/symtab.c (default_tagged_code_props) + (default_tagless_code_props, default_tagged_code_props_set) + (default_tagless_code_props_set): Remove. + (symbol_code_props_get): Default to <*> or <>'s code_props. + + * tests/actions.at: Complete expected errors: there are new warnings. + * tests/input.at: Likewise. + (Useless printers or destructors): Extend. + +2012-07-22 Akim Demaille + + allow modification on retrieved code_props. + The logic to compute the %printer or %destructor to used (i.e., a + code_props) is implemented twice: one, of course, in + symbol_code_props_get, and another time in symbol_check_defined to + record the fact that a code_props is used (so that we can reported + unused ones). Let the former use the latter. + + I would probably use "mutable" in C++ and keep these guys const, + but this is C. And casting away constness triggers warnings. + + * src/scan-code.h, src/scan-code.l (code_props_none): Is not const. + * src/symtab.h, src/symtab.c (symbol_code_props_get): The symbol + is not const. + (symbol_check_defined): Use it. + +2012-07-22 Akim Demaille + + maint: regen. + +2012-07-22 Akim Demaille + + maint: fix bison's own header guards. + Because I'm using a VPATH build with an absolute srcdir, I have + GRAM__USERS_AKIM_SRC_GNU_BISON_SRC_PARSE_GRAM_H. Before, I was using + a relative srcdir, and had GRAM_______SRC_PARSE_GRAM_H (coming from + ../../). Let it be GRAM_SRC_PARSE_GRAM_H. + + * tests/bison.in: Do not depend on the value of $top_srcdir for + Bison itself. + If we were to use relative paths from .c to .y, we would not have + this problem. + +2012-07-22 Akim Demaille + + maint: add missing const. + * src/symtab.h, src/symtab.c (symbol_print): here. + +2012-07-22 Akim Demaille + + style changes. + * src/parse-gram.y, src/symtab.c: Space changes. + * src/symtab.h: Comment changes. + +2012-07-22 Akim Demaille + + autoconf: update. + * submodules/autoconf: here. + No significant changes for our use of m4sugar.m4. + +2012-07-22 Akim Demaille + + output: no longer use b4_tokens. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, data/yacc.c: + Since the previous commit, b4_tokens_define and the like no longer need + b4_tokens. + * src/output.c (token_definitions_output): Remove. + +2012-07-22 Akim Demaille + + output: use the token list to define the yytokentype + There are currently two systems used to pass information about tokens to + m4: the original one, and another, which is used for instance for + printers and destructors, variants etc. Move to using only the latter. + + * data/bison.m4 (b4_symbol_map, b4_token_visible_if) + (b4_token_has_definition, b4_any_token_visible_if, b4_token_format): New. + * data/c++.m4, data/c.m4, data/glr.c, data/java.m4: Adjust to use them. + +2012-07-20 Akim Demaille + + tests: fix VPATH issue + * examples/test: With an absolute VPATH build, "../" is incorrect. + 2012-07-20 Akim Demaille news: fix typo. @@ -2297,6 +7569,31 @@ 2012-07-19 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: update gnu-web-doc-update. + maint: post-release administrivia + version 2.6 + maint: prepare for release 2.6 + maint: post-release administrivia + version 2.5.91 + maint: prepare NEWS. + maint: fix spaces. + tests: adjust to case where the C compiler is actually a C++ compiler + tests: fix dependencies + doc: fix Texinfo command + maint: Valgrind on OS X. + tests: be sure that backups are safe. + maint: dead comment. + tests: refactor for legibility. + tests: refactor the bison invocations. + maint: fix syntax-check ignore patterns. + gnulib: update + gnulib: update. + gnulib: update + +2012-07-19 Akim Demaille + maint: update gnu-web-doc-update. * gnulib: here. @@ -2408,6 +7705,41 @@ 2012-07-06 Akim Demaille + maint: minor fixes + * NEWS: restore missing entry. + * cfg.mk: Adjust to *.texinfo -> *.texi. + * src/symtab.c: Spaces fixes. + +2012-07-06 Akim Demaille + + tests: address g++-4.8 warnings. + list.yy: In function 'yy::parser::symbol_type yylex()': + list.yy:107:29: error: typedef 'token' locally defined but not used + [-Werror=unused-local-typedefs] + typedef yy::parser::token token; + ^ + + * tests/c++.at (AT_CHECK_VARIANTS): here. + +2012-07-06 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: update release instructions + maint: post-release administrivia + version 2.5.90 + build: fix gen-ChangeLog call. + gnulib: update. + tests: fix SKIP_IF for Java. + api.prefix: incompatible with %name-prefix. + api.prefix: strengthen the tests and fix push-parsers. + skeletons: style changes. + NEWS: minor changes. + api.prefix: improve the documentation for YYDEBUG. + gnulib: update. + +2012-07-06 Akim Demaille + maint: update release instructions * README-hacking: here. @@ -2478,6 +7810,20 @@ 2012-07-04 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: headers.at: strengthen. + glr.cc: do not override C++ definitions by C macros. + YYLLOC_DEFAULT: factor, and don't export it in headers. + api.prefix: do not use #define to handle YYSTYPE_IS_TRIVIAL etc. + tests: portability fixes. + c++: fewer #includes in the headers. + glr.cc: formatting changes. + tests: more logs. + api.prefix: also rename YYDEBUG. + +2012-07-04 Akim Demaille + tests: headers.at: strengthen. * tests/headers.at (Several headers): Be stricter when checking the exported macros. @@ -2578,6 +7924,24 @@ 2012-07-02 Akim Demaille + formatting changes. + * data/lalr1.cc: here. + +2012-07-02 Akim Demaille + + NEWS: spell fixes. + * NEWS: here. + Reported by Stefano Lattarini. + +2012-07-02 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + NEWS: spell check. + api.prefix. + +2012-07-02 Akim Demaille + NEWS: spell check. * NEWS: here. @@ -2600,6 +7964,90 @@ (Bison Options): -p/--name-prefix are obsoleted. * NEWS: Announce api.prefix. +2012-06-29 Victor Santet + + warnings: display warnings categories + * src/complain.c (error_message): Call 'warnings_print_categories'. + * src/gram.c (grammar_rules_useless_report): Display itself warning + category. + * tests/actions.at, tests/conflicts.at, tests/existing.at, + tests/input.at, tests/named-refs.at, tests/output.at, tests/reduce.at, + tests/regression.at, tests/skeletons.at: Adjust. + * NEWS: Document this. + +2012-06-29 Victor Santet + + warnings: be ready to print warnings categories + A function to print warnings categories, like -Wyacc, -Wother, etc. + + * src/complain.h, src/complain.c (print_warning_categories): New function. + * src/output.c (ARRAY_CARDINALITY): Move it to file 'src/system.h'. + * src/complain.h (enum warnings): New value, 'silent', "complain" + must not display the warning type. + +2012-06-29 Akim Demaille + + maint: prepare forthcoming changes + * src/gram.c (rule_rhs_print): Do not print new line anymore. + (rule_print): Make it static. + * src/closure.c, src/derives.c, src/gram.c: Adjust. + +2012-06-29 Victor Santet + + style changes + * src/complain.c, src/reader.c, src/reduce.c, src/main.c: + Fix indentation. + Simplify a bit. + +2012-06-28 Akim Demaille + + regen. + +2012-06-28 Victor Santet + + warnings: factoring: complaints + * src/complain.c (error_message): Accept warning categories (an integer) as + argument. + Location is a 'const location *' instead of 'location *'. + (ERROR_MESSAGE): Delete it. + * src/complain.c, src/complain.h (complains): New function. + (complain, complain_at, complain_at_indent): Generic functions for + complaints. Call 'complains'. + (warn_at, warn_at_indent, warn, yacc_at, midrule_value_at) + (fatal_at, fatal): Delete them. Adjust dependencies. + * src/complain.h (enum warnings): New fields 'complaint' and 'fatal'. + * bootstrap.conf (XGETTEXT_OPTIONS): Adjust. + +2012-06-28 Victor Santet + + warnings: move them to complain.c. + * src/getargs.h, src/getargs.c (warnings, warnings_flags): Move to... + * src/complain.h, src/complain.c: Here. + +2012-06-28 Victor Santet + + warnings: rename the categories + Forthcoming changes will use the warning categories much more often, + so shortening them will improve readability. + + * src/complain.c, src/complain.h, src/conflicts.c, + * src/getargs.c, src/getargs.h, src/gram.c (enum warnings): + s/warnings_/W/g. + +2012-06-28 Akim Demaille + + fix merge. + * data/bison.m4: Use b4_error_verbose_if after it was defined. + +2012-06-28 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: use the generalized default yylex. + tests: AT_YYERROR_DEFINE: prepare for list of ints. + skeletons: no longer define YYLSP_NEEDED. + c++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE. + 2012-06-28 Akim Demaille tests: use the generalized default yylex. @@ -2634,6 +8082,12 @@ 2012-06-26 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: use *.texi. + +2012-06-26 Akim Demaille + maint: use *.texi. This is more consistent with the other packages, and Automake-NG supports only *.texi. @@ -2644,6 +8098,36 @@ 2012-06-26 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: do not output m4 set up. + tests: use the generic yyerror function. + tests: use assert instead of plain abort. + tests: improve the generic yylex implementation. + tests: generalize the compilation macros. + tests: fix confusion between api.prefix and name-prefix. + maint: gitignores. + yacc: work around the ylwrap limitation. + +2012-06-26 Victor Santet + + warnings: raise warning for useless printers or destructors + * src/scan-code.h (code_props): Add field 'is_used'. + (CODE_PROPS_NONE_INIT): Adjust. + * src/scan-code.l (code_props_plain_init, code_props_symbol_action_init) + (code_props_rule_action_init): Instead of implementing several + times the initialization of the code_props structures, + use code_props_none_init. + * src/symtab.c (symbol_check_defined): If a symbol does not have a + destructor (resp. printer) but has a type which has a destructor (resp. + printer), then set field 'is_used' to true. + (semantic_type_check_defined): If a type has a destructor (resp. printer) + but all symbols of this type have already a destructor (resp. printer), + then raise a warning. + * tests/input.at (Useless printers or destructors): New. + +2012-06-26 Akim Demaille + tests: do not output m4 set up. * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use a diversion to avoid outputting comments etc. @@ -2695,13 +8179,96 @@ maint: gitignores. -2012-06-25 Akim Demaille +2012-06-25 Victor Santet + + warnings: useless semantic types + * src/symtab.h (symbol_list): Represent semantic types as structure + 'semantic_type'. + * src/symlist.c (symbol_list_type_new): Allocate this structure. + (symbol_list_code_props_set): Set this semantic type's status to used if it + was not declared. + * src/symtab.c (semantic_types_sorted): New. + (semantic_type_new): Set the new semantic type's location appropriately. + (symbol_check_defined): If a symbol has a type, then set this type's status + to "declared". + (semantic_type_check_defined, semantic_type_check_defined_processor): Same + as symbol_check_defined and symbol_check_defined_processor, but for semantic + types. + (symbol_check_defined): Check semantic types usefulness. + * src/symtab.h (semantic_type): New fields 'location' and 'status'. + * src/symtab.h, src/symtab.c (semantic_type_new) + (semantic_type_from_uniqstr, semantic_type_get): Accept a location as a + supplementary argument. + * tests/input.at (Unassociated types used for printer of destructor): New. + * tests/c++.at (AT_CHECK_VARIANTS): Fix an error caught by this commit. + +2012-06-25 Akim Demaille + + yacc: work around the ylwrap limitation. + * data/yacc.c (b4_shared_declarations): Include the header guards. + Do not include the header in the *.c file, duplicate it. + * NEWS (Future Changes): Extend, and announce the forthcoming change + about the use of the parser header. + +2012-06-25 Akim Demaille + + fix for printers and destructors. + The previous "code_props: factor more" patch sends has_%printer + etc. to m4, instead of has_printer. + + * src/output.c (prepare_symbol_definitions): Fix value of pname. + +2012-06-25 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + tests: more uniformity. + tests: handle locations in a more generic way. + tests: handle locations in the generic yyerror functions. + tests: fix AT_CHECK_CALC. + tests: improve infrastructure + tests: factor. + skeletons: minor style changes + tests: AT_LANG. + c skeletons: factor the declaration of yylloc and yylval. + news: condemn YYPARSE_PARAM and YYLEX_PARAM. + maint: regen. + +2012-06-22 Akim Demaille + + code_props: factor more. + * src/symtab.h, src/symtab.c (code_props_type_string): No longer static. + * src/output.c (CODE_PROPS): Remove, we can now iterate on both the + destructor and the printer. + (SET_KEY2): New. + +2012-06-22 Victor Santet + + maint: factor the handling of %printer and %destructor + There is too much code duplication between %printer and %destructor. + We used to have two functions for each action: the first one for + destructors, the second one for printers. Factor using a + 'code_props_type', and an array of code_props instead of two + members. - yacc: work around the ylwrap limitation. - * data/yacc.c (b4_shared_declarations): Include the header guards. - Do not include the header in the *.c file, duplicate it. - * NEWS (Future Changes): Extend, and announce the forthcoming change - about the use of the parser header. + * src/symlist.h, src/symlist.c (symbol_list_destructor_set) + (symbol_list_printer_set): Fuse into... + (symbol_list_code_props_set): this. + * src/symtab.h, src/symtab.c (default_tagged_destructor) + (default_tagged_printer): Fuse into... + (default_tagged_code_props): this. + (default_tagless_destructor, default_tagless_printer) + (default_tagless_code_props): Likewise. + (code_props_type_string): new. + (symbol_destructor_set, symbol_destructor_get, semantic_type_destructor_set) + (default_tagged_destructor_set, default_tagless_destructor_set) + (symbol_printer_set, symbol_printer_get, semantic_type_printer_set) + (default_tagged_printer_set, default_tagless_printer_set): Replace by... + (symbol_code_props_set, symbol_code_props_get, semantic_type_code_props_set) + (default_tagged_code_props_set, default_tagless_code_props_set): these. + * src/parse-gram.y (grammar_declaration): Adjust. + * src/output.c (CODE_PROP, grammar_declaration): Ditto. + * src/reader.c (symbol_should_be_used): Ditto. 2012-06-22 Akim Demaille @@ -2772,6 +8339,21 @@ (AT_LANG_COMPILE): New. (AT_FULL_COMPILE): Use AT_LANG. +2012-06-21 Victor Santet + + symtab: refactoring + Prepares forthcoming changes. + + * src/symtab.c (symbols_do): Accept the hash table and the sorted + list as arguments. Adjust dependencies. + +2012-06-21 Akim Demaille + + maint: address syntax-check issues. + * examples/calc++/local.mk: Space changes. + * src/files.c: Avoid unmarked_diagnostics. + * src/output.c: Remove useless include. + 2012-06-21 Akim Demaille c skeletons: factor the declaration of yylloc and yylval. @@ -2789,11 +8371,112 @@ 2012-06-20 Akim Demaille + fix warnings for useless %printer/%destructor + The previous commit, which turns into a warning what used to be an + error: + + %printer {} foo; + %% + exp: '0'; + + has two shortcomings: the warning is way too long (foo is reported + to be useless later), and besides, it also turns into a warning much + more serious errors: + + %printer {} foo; + %% + exp: foo; + + Reduce the amount to warnings in the first case, restore the error in + the second. + + * src/symtab.h (status): Add a new inital state: undeclared. + * src/symtab.c (symbol_new): Initialize to undeclared. + (symbol_class_set): Simplify the logic of the code that neutralize + the "redeclared" warning after the "redefined" one. + (symbol_check_defined): "undeclared" is also an error. + * src/reader.c (grammar_current_rule_symbol_append): Symbols appearing + in a rule are "needed". + * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set): + An unknown symbol appearing in a %printer/%destructor is "used". + * src/reduce.c (nonterminals_reduce): Do not report as "useless" symbols + that are not used (e.g., those that for instance appeared only in a + %printer). + * tests/input.at (Undeclared symbols used for a printer or destructor): + Improve the cover the cases described above. + +2012-06-20 Akim Demaille + + gitignore: test-driver. + +2012-06-20 Akim Demaille + + maint: style changes. + * src/reduce.c (reduce_grammar_tables): Define variables with their + initial value. + +2012-06-20 Akim Demaille + + news: fixes. + * NEWS: Fix spelling. + +2012-06-20 Victor Santet + + warnings: used but undeclared symbols are warnings + We used to raise an error if a symbol appears only in a %printer or + %destructor. Make it a warning. + + * src/symtab.h (status): New enum. + (symbol): Replace the binary "declared" with the three-state "status". + Adjust dependencies. + * src/symtab.c (symbol_check_defined): Needed symbols are an error, + whereas "used" are simply warnings. + * src/symlist.c (symbol_list_destructor_set, symbol_list_printer): Set + symbol status to 'used' when associated to destructors or printers. + * input.at (Undeclared symbols used for a printer or destructor): New. + +2012-06-20 Akim Demaille + + maint: regen. + * Makefile.am (regen): New target. + +2012-06-20 Akim Demaille + + regen. + +2012-06-20 Akim Demaille + maint: regen. * Makefile.am (regen): New target. 2012-06-19 Akim Demaille + tests: enhance AT_YYERROR_DEFINE. + * tests/local.at: Handle the fact that locations are no longer + needed with lalr1.cc. + +2012-06-19 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + maint: formatting changes. + tests: support api.prefix. + tests: pacify font-lock-mode. + tests: remove test covered elsewhere. + tests: factor the declaration/definition of yyerror and yylex. + regen. + tests: portability issues. + tests: call the parser from another compilation unit. + glr.c, yacc.c: declare yydebug in the header. + skeletons: use header guards. + tests: improve AT_FULL_COMPILE. + tests: reorder. + tests: strengthen the test on generated headers inclusion + yacc.c: instead of duplicating y.tab.h inside y.tac.c, include it. + yacc.c: factor. + +2012-06-19 Akim Demaille + maint: formatting changes. * NEWS: Fix indentation of code snippets. Untabify. @@ -2894,6 +8577,18 @@ * data/yacc.c: here. +2012-06-15 Akim Demaille + + maint: xfdopen, and scope reduction. + * src/files.h, src/files.c (xfdopen): New. + * src/output.c (output_skeleton): Use it. + Reduce the scope of argv. + +2012-06-15 Akim Demaille + + maint: space changes + * configure.ac, src/complain.c: space changes. + 2012-06-13 Akim Demaille yacc.c: factor. @@ -2907,6 +8602,30 @@ * data/yacc.c (b4_shared_declarations): New. Use it to factor duplicated declarations. +2012-06-13 Stefano Lattarini (tiny change) + + cosmetics: prettify names for compiled object for bison + * src/local.mk (src_bison_SHORTNAME): Define to "bison". + +2012-06-13 Akim Demaille + + lalr1.cc: spello. + * data/lalr1.cc: Reported by Gilles Espinasse. + +2012-06-13 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + skeletons: factor yacc.c and glr.c. + glr.c: minor refactoring. + tests: remove all the -On flags. + maint: fix spello. + maint: improve release procedure instructions. + gnulib: update readme-release. + maint: cfg.mk: manual title. + maint: cfg.mk: simplify + maint: post-release administrivia + 2012-06-12 Akim Demaille skeletons: factor yacc.c and glr.c. @@ -2970,6 +8689,57 @@ 2012-06-05 Akim Demaille + maint: an envvar equal to "00" is 0. + * src/output.c (prepare): here. + Reported by Paul Eggert. + +2012-06-05 Akim Demaille + + maint: don't use mbsr?chr. + Basically, revert ba60c39547a445dee3e07920931b4d7a81843868's move to + mbs* functions, which was prompted by -DGNULIB_POSIXCHECK. See + + and following. + + * bootstrap.conf: No longer ask for them. + * src/files.c, src/getargs.c, src/location.c, + * src/parse-gram.c, src/parse-gram.y, src/scan-gram.l, + * src/symtab.c: s/mbs(r?chr)/str$1/g. + +2012-06-05 Akim Demaille + + maint: use xconcat-filename. + * bootstrap.conf (gnulib_modules): Request it. + * src/output.h, src/output.c (compute_pkgdatadir): Rename as... + (pkgdatadir): this. + Adjust dependencies. + * src/output.c (output_skeleton): Reduce the scope of "in". + Use xconcatenated_filename to simplify the construction of the + qualified paths to m4sugar.m4, bison.m4, and the selected skeleton. + There are a few minor differences: the new code uses strchr instead of + mbschr (but this was not really justified), and the new code does not + garantee a single slash even if $BISON_PKGDATADIR ends with several + (which was considered more accurate). See the discussion at + . + +2012-06-05 Akim Demaille + + maint: minor simplification + * src/output.c (prepare): Assign use_push_for_pull_flag's value at its + declaration. + +2012-06-05 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: + version 2.5.1 + NEWS: prepare for 2.5.1. + maint: update release procedure + maint: fix comment typos + maint: post-release administrivia + +2012-06-05 Akim Demaille + version 2.5.1 * NEWS: Record release date. @@ -2999,6 +8769,51 @@ -e '($file,$n,$l,$r)=($1,$2,$3,$4); $q="'\''"; $r=~s/$q/$q\\$q$q/g;'\ -e 'print "sed -i $q${n}s!$l!$r!$q $file"'|bash +2012-05-24 Akim Demaille + + build: regen. + +2012-05-24 Akim Demaille + + Merge tag 'v2.5.1_rc2' + Bison 2.5.1_rc2. + + * tag 'v2.5.1_rc2': (34 commits) + Bison 2.5.1_rc2. + doc: fixes. + build: fix ChangeLog generation. + c++: compute the header guards. + skeletons: remove support for unused directive. + lalr1.cc: improve Doxygen documentation. + lalr1.cc: extract stack.hh. + news: convert to double quotes. + space changes. + build: do not prototype flex-generated functions. + build: fix ChangeLog generation. + Bison 2.5.1_rc1. + tests: save/restore Autotest special files when checking XML support. + tests: AT_SAVE_SPECIAL_FILES / AT_RESTORE_SPECIAL_FILES. + tests: honor TESTSUITEFLAGS in all the check targets. + build: do not enable c++ warnings on 0 when nullptr is not supported. + maint: update gnulib. + build: config.in.h. + build: move silent rules. + glr.c: reduce variable scopes. + maint: maintainer-release-check. + maint: shush a syntax-check. + maint: prefer "commit message" to "log entry". + command line: fix minor leaks. + maint: we no longer maintain the ChangeLog. + maint: fix the generation of the synclines for bison's parser. + maint: regen. + maint: import the xmemdup0 gnulib module. + maint: remove left-over gnulib modules. + maint: ignore files imported by autopoint. + build: AC_PROG_LEX: use more readable variable names. + maint: regen src/parse-gram.[ch] + maint: simplify parse-gram.y + maint: s/strncpy/memcpy/, when equivalent + 2012-05-23 Akim Demaille maint: post-release administrivia @@ -3246,6 +9061,22 @@ 2012-05-04 Akim Demaille + glr.c: formatting changes. + * data/glr.c: Fix indentation. + +2012-05-04 Akim Demaille + + Merge remote-tracking branch 'origin/master' + * origin/master: + glr.c: untabify. + glr.cc: untabify. + glr.cc: formatting changes. + glr.cc: remove unused signature. + glr.cc: properly declare locations are const where appropriate. + doc: fix @xref. + +2012-05-04 Akim Demaille + glr.c: untabify. * data/glr.c: here. @@ -3275,6 +9106,33 @@ doc: fix @xref. * doc/bison.texinfo: here. +2012-05-04 Akim Demaille + + Merge remote-tracking branch 'origin/maint' + * origin/maint: (22 commits) + tests: ignore code coverage/profiling failure messages + doc: fix some invalid @ref. + build: fix previous commit. + install-pdf: fix. + NEWS: Update. + %printer: support both yyo and yyoutput. + doc: mfcalc: demonstrate %printer. + tests: style changes. + build: require Flex. + build: flex.m4: check for Flex. + build: flex.m4: quote properly. + build: flex.m4. + build: autoconf: update. + glr: eliminate last bits of unwanted locations. + NEWS: 2.6 will drop K&R. + TODO: remove dead items. + TODO: import from master. + gnulib: update. + maint: update NEWS. + doc: fix index. + doc: fix documentation of YYERROR. + c++: more YY_NULL + 2012-05-02 Akim Demaille tests: ignore code coverage/profiling failure messages @@ -3342,6 +9200,37 @@ It is unused, so we don't care, yet it is less surprising. * tests/actions.at: Comment changes. +2012-04-16 Akim Demaille + + %printer: support both yyo and yyoutput. + lalr1.cc used to support yyo, but not yyoutput. Support both, + but document only yyoutput (at least until there is some consensus + on this). + + * data/c.m4 (yy_symbol_value_print): Also support yyo. + * data/glr.cc (yy_symbol_value_print_): Support both yyo and yyoutput. + * data/lalr1.cc: Also support yyoutput. + * doc/bison.texinfo: Explicitly use yyoutput in the examples. + * examples/mfcalc/mfcalc.test: Test the -p option. + +2012-04-16 Akim Demaille + + doc: mfcalc: demonstrate %printer. + * doc/bison.texinfo (Printer Decl): New. + Number mfcalc.y snippets so that they are output in + the proper order. + (The mfcalc Main): Use yydebug. + (Debugging): Simplify the text. + (Enabling Traces, Mfcalc Traces, The YYPRINT Macro): New. + (Table of Symbols): Document YYPRINT and YYFPRINTF. + +2012-04-16 Akim Demaille + + tests: style changes. + * tests/input.at: Use "print" in %printer instead of "destroy". + It is unused, so we don't care, yet it is less surprising. + * tests/actions.at: Comment changes. + 2012-04-10 Akim Demaille build: require Flex. @@ -3397,6 +9286,46 @@ TODO: import from master. * TODO: Copy the current version. +2012-04-08 Akim Demaille + + tests: fix bison wrapper. + * tests/bison.in (PERL): Fix. + +2012-04-08 Akim Demaille + + doc: fix some invalid @ref. + * doc/bison.texinfo: Fix incorrect @ref uses. + +2012-04-08 Akim Demaille + + build: extexi: support out-of-order blocks. + * examples/extexi (%file_output): Remove. + (&process): Accept "FILE: BLOCK-NUM" requests. + +2012-04-08 Akim Demaille + + build: look for Perl in configure. + Bison uses "/usr/bin/perl" or "perl" in several places, and it does + not appear to be a problem. But, at least to make it simpler to + change PERL on the make command line, check for perl in configure. + + * configure.ac (PERL): New. + * doc/Doxyfile.in, doc/local.mk, examples/local.mk, + * tests/bison.in: Use it. + +2012-04-08 Akim Demaille + + maint: rewrite extexi in Perl. + * examples/extexi: Rewrite in Perl. + * examples/local.mk (extract): Adjust. + +2012-04-07 Akim Demaille + + build: simplify clean. + * doc/local.mk (CLEANFILES): Since the previous commit, + there a no longer such files. + * Makefile.in (CLEANFILES): Initialize here. + 2012-04-07 Akim Demaille gnulib: update. @@ -3431,6 +9360,60 @@ 2012-04-01 Akim Demaille + build: fix distcheck issues. + For some reason it seems that texi2dvi -o no longer forces --clean + mode, so we have stray TeX compilation files staying in top_builddir + since TeX is run from there. + + While at it, upgrade the generation of the (completely obsolete) + reference card. Target PDF. + + * doc/local.mk (TEXI2DVI): Pass --build-dir. + (CLEANDIRS): More accurate. + (doc/refcard.dvi): Replace with... + (doc/refcard.pdf): this. + Adjust dependencies. + +2012-04-01 Akim Demaille + + build: don't rely on $< in non-pattern rules. + * doc/local.mk, tests/local.mk: here. + Reported by Stefano Lattarini. + +2012-04-01 Akim Demaille + + doc: upgrade Doxyfile. + * doc/Doxyfile.in: Run doxygen -u. + Prompted by Tim Landscheidt. + +2012-04-01 Akim Demaille + + doc: help Doxygen find our files. + * doc/Doxyfile.in (INCLUDE_PATH): here. + +2012-04-01 Tim Landscheidt + + Fix Doxygen generation and clean-up. + * doc/Doxyfile.in: Amend OUTPUT_DIRECTORY. + * doc/local.mk (html-local): Amend working directory. + (CLEANDIRS): Fix "html", remove "latex". + +2012-04-01 Tim Landscheidt + + Fix Doxygen comment. + * src/InadequacyList.h: s###. + +2012-04-01 Akim Demaille + + c++: more YY_NULL + Caught by maintainer-check-g++. + * data/glr.c, data/lalr1.cc, data/yacc.c, tests/cxx-type.at, + * tests/glr-regression.at, tests/push.at: + When simple to do, avoid expliciting the null ptr. + Otherwise use YY_NULL. + +2012-04-01 Akim Demaille + c++: more YY_NULL Caught by maintainer-check-g++. * data/glr.c, data/lalr1.cc, data/yacc.c, tests/cxx-type.at, @@ -3440,6 +9423,25 @@ 2012-04-01 Akim Demaille + Merge remote-tracking branch 'origin/maint' + * origin/maint: + bump to 2012 in skeletons. + build: remove ancient Autoconf tests. + doc: c++: complete the location documentation. + c++: locations: provide convenience constructors. + c++: locations: remove useless "inline". + glr: do not use locations when they are not requested + c++: use nullptr for C++11. + build: simplify and improve the compiler warnings for tests. + gnulib: update. + maint: formatting changes. + NEWS: update. + Java: Fix syntax error handling without error token. + tests: beware of -pedantic on large #line numbers. + tests: when using the C++ compiler, use its flags too. + +2012-04-01 Akim Demaille + bump to 2012 in skeletons. * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, * data/location.cc, data/yacc.c: Bump copyright year ranges. @@ -3574,6 +9576,135 @@ * tests/atlocal.in: Implement it. * tests/local.mk: Use it. +2012-03-24 Akim Demaille + + tests: style changes in the Makefile. + * tests/local.mk: Prefer passing variable assignment by + the command line, instead of the environment, so that it + is reported in the logs. + Prefer single quotes for shell literal strings. + +2012-03-24 Akim Demaille + + tests: beware of -pedantic on large #line numbers. + * tests/local.at (AT_TEST_TABLES_AND_PARSE): Don't pass -pedantic + when compiling large canonical-LR parsers. + Reported by Tys Lefering. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00025.html + +2012-03-24 Akim Demaille + + tests: when using the C++ compiler, use its flags too. + * tests/local.at: Go for colors. + (--compile-c-with-cxx): New option. + We used to pass "CC=$CXX" as command line argument, + but it was not possible to adjust CFLAGS accordingly + in atlocal, since it is loaded before assignments on + the command line are honored (so that the command line + takes precedence). + * tests/atlocal.in: Implement it. + * tests/local.mk: Use it. + +2012-03-24 Akim Demaille + + tests: fix dependencies. + * tests/local.mk (check_SCRIPTS): Add atlocal and atconfig so + that they are properly updated before running tests. + (RUN_TESTSUITE_deps): New. + Use it to factor the dependencies of "*-check" targets, + especially those that don't bounce to the regular + "check-local" target, since then they don't benefit from the + proper dependencies (such as atlocal). + +2012-03-19 Akim Demaille + + Merge remote-tracking branch 'fsf/maint' + * fsf/maint: (404 commits) + doc: update the --verbose report format. + doc: spell check. + doc: stmt, not stmnt. + doc: save width. + doc: reformat grammar snippets. + doc: use only @example, not @smallexample. + doc: style changes. + doc: minor fixes to "Understanding" section + tests: minor fixes/simplifications + tests: be robust to quote style. + maint: update gnulib. + tests: be robust to POSIXLY_CORRECT being defined. + doc: fix environment issues. + regen. + tests: fix regressions. + glr: fix ambiguity reports. + doc: stylistic improvements. + maint: address sc_prohibit_doubled_word. + maint: address sc_prohibit_always-defined_macros. + maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC. + ... + +2012-03-19 Akim Demaille + + doc: spell fix. + * doc/bison.texinfo: here. + Reported by Tim Landscheidt. + +2012-03-19 Akim Demaille + + doc: update the --verbose report format. + * doc/bison.texinfo (Understanding): Adjust to match the + current format. + +2012-03-19 Akim Demaille + + doc: spell check. + * doc/bison.texinfo: here. + +2012-03-19 Akim Demaille + + doc: stmt, not stmnt. + * doc/bison.texinfo: s/stmnt/stmt/g. This is a + much more common abbreviation for "statement". + +2012-03-19 Akim Demaille + + doc: save width. + * doc/bison.texinfo (Language and Grammar): Use the same + layout for an example in all the versions, i.e., keep + as general case what used to be used only for Info. + +2012-03-19 Akim Demaille + + doc: reformat grammar snippets. + * doc/bison.texinfo: Convert the grammar examples to + use a narrower style. This helps fitting into the + @smallbook constraints. + http://lists.gnu.org/archive/html/bison-patches/2012-03/msg00011.html + +2012-03-19 Akim Demaille + + doc: use only @example, not @smallexample. + * doc/bison.texinfo: Convert all @smallexamples into @examples. + Adjust layout where needed. + +2012-03-19 Akim Demaille + + doc: style changes. + * doc/bison.texinfo: Avoid line width issues with TeX. + Upgrade ancient messages. + Move some comments to better looking places. + Add more @group. + (Mfcalc Symbol Table): Reduce variable scopes. + Prefer size_t for sizes. + Prefer declarations with an initial value. + Fix a @group environment. + +2012-03-19 Paul Eggert + + doc: minor fixes to "Understanding" section + * doc/bison.texinfo (Understanding): Minor wording fixes and + improvements. Fixes problems reported in + . + 2012-03-19 Akim Demaille doc: update the --verbose report format. @@ -3624,13 +9755,57 @@ Prefer declarations with an initial value. Fix a @group environment. -2012-03-19 Paul Eggert +2012-03-19 Akim Demaille + + c.m4: better newline control with b4_parse_param_use. + * data/c.m4: Use m4_ifvaln instead of m4_ifval where + applicable. + (b4_parse_param_use): Switch order between two nested + "if"s to avoid useless empty lines. + Adjust callers to avoid useless lines. + +2012-03-19 Akim Demaille + + glr.c: remove (broken) support for YYPRINT. + YYPRINT uses yytoknum which glr does not define. Since YYPRINT + is considered obsolete, and did not work, don't fix its support, + remove it from glr.c. + + * data/c.m4 (yy_symbol_value_print): Use YYPRINT only for yacc.c. + * TODO: Done. + +2012-03-17 Paul Eggert doc: minor fixes to "Understanding" section * doc/bison.texinfo (Understanding): Minor wording fixes and improvements. Fixes problems reported in . +2012-03-15 Akim Demaille + + TODO: update. + +2012-03-15 Akim Demaille + + gnulib: update. + +2012-03-13 Akim Demaille + + tests: minor fixes/simplifications + * tests/local.at (AT_BISON_CHECK_NO_XML): Simplify sed programs, + quotation, and default value assignments. + Ensure a proper value to the numeric variables. + Reported by Lie Yan. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html + +2012-03-13 Akim Demaille + + maint: fix distcheck. + * examples/local.mk (MAINTAINERCLEANFILES): Complete, and rename as... + (CLEANFILES): this, + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk (CLEANFILES): Add the generated files. + 2012-03-13 Akim Demaille tests: minor fixes/simplifications @@ -3642,6 +9817,14 @@ 2012-03-09 Akim Demaille + tests: be robust to POSIXLY_CORRECT being defined. + * tests/local.at (AT_BISON_CHECK_NO_XML): Check if + POSIXLY_CORRECT is defined, not if it is defined to 1. + Reported by Lie Yan. + http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html + +2012-03-09 Akim Demaille + tests: be robust to quote style. See . @@ -3654,6 +9837,36 @@ * gnulib: update. * src/scan-gram.l: Don't use the (former version of) STREQ. +2012-03-09 Akim Demaille + + tests: remove quote magic from the bison test wrapper. + Basically, revert 4c4d35394d1bdb4dc3392482ab002bc111a3378f. + + * tests/bison.in: Leave bison's stderr as is. + +2012-03-09 Akim Demaille + + tests: be robust to quote style. + See . + + * src/main.c (main): Define the quoting style we use. + * tests/atlocal.in: Use ASCII style quotes during the tests. + +2012-03-09 Akim Demaille + + avoid direct strncmp calls. + Before this change, bison would accept either .tab and _tab equivalently, + whatever the current platform. Besides, it was not obeying everywhere + to the possible definition of TAB_EXT to something else than .tab. + + For consistency, handle only TAB_EXT (".tab" on non DJGPP platforms). + Support for "_tab" is neither documented, nor tested. + + * src/system.h (STRNCMP_LIT): New. + From Jim Meyering. + (STRPREFIX_LIT): New. + * src/files.c, src/getargs.c: Use it. + 2012-03-06 Akim Demaille tests: be robust to POSIXLY_CORRECT being defined. @@ -3662,6 +9875,85 @@ Reported by Lie Yan. http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html +2012-02-24 Akim Demaille + + build: comment changes. + * Makefile.am, examples/calc++/local.mk, examples/local.mk, + * examples/mfcalc/local.mk, examples/rpcalc/local.mk, + * lib/local.mk, src/local.mk, tests/local.mk: + Make the copyright licenses more uniform. + +2012-02-24 Akim Demaille + + build: fix more example extraction issues. + * Makefile.am (dist_TESTS): New. + (TESTS, EXTRA_DIST): Run and ship them. + * examples/calc++/local.mk: examples/calc++/calc++.stamp no longer + exists, don't try to ship it. + (.yy.stamp): New recipe. + Use it. + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk: + Don't ship the sources. + Adjust the CPPFLAGS: there is nothing left in srcdir. + (MAINTAINERCLEANFILES): Remove, now we are in builddir. + (TESTS): Rename as... + (dist_TESTS): this. + +2012-02-24 Akim Demaille + + maint: fix example extraction issues. + calc++: don't rely on Automake to compile a C++ parser. + + Basically, revert commit 609b3d8096fb0cc1fa4d908b6e1a860ced260bda, + Automake 1.11.3 is not safe enough for C++ parser. + + * examples/calc++/calc++-parser.hh: Remove. + * examples/calc++/local.mk (examples/calc++/calc++-parser.stamp): + New. + + examples: factor the extractions into a single step + + extexi had to be run in the extraction directory. Now, it can be + given the files with expected output directory. This allows to + use $(*_extracted) variables (before we had to list again their + members, but limited to their base names). In turn, this also + allows fusing the extraction recipes into a single one. + + Also, it is currently too hard (or requires too much duplication, + since Make wants all the occurrences of the files to be prefixed with + $(srcdir)/, which is something Automake cannot support for *_SOURCES) + to work in the source tree. So extract, and compile scanners and parsers + in the build tree. + + * examples/extexi (basename): New. + (BEGIN): Now "file_wanted" maps base name to extracted file name. + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/rpcalc/local.mk: Fuse extraction rules into... + * examples/local.mk: Here. + (extract, extracted): New. + +2012-02-23 Akim Demaille + + maint: use STREQ/STRNEQ. + * doc/bison.texinfo: Space change. + * src/system.h (STREQ, STRNEQ): New. + * src/files.c, src/ielr.c, src/lalr.c, src/muscle-tab.c, + * src/output.c, src/print.c, src/print_graph.c, + * src/reader.c, src/scan-skel.l, src/tables.c, + * src/uniqstr.c: + Use them. + * src/scan-gram.l: Do not use streq.h, use system.h's STREQ. + * cfg.mk: The documentation is an exception. + +2012-02-23 Akim Demaille + + doc: fix environment issues. + * doc/bison.texinfo: Do not use @verbatim, in particular when + we use @group inside. + Use @quotation instead of @display for frequently asked questions, + it looks much nicer. + 2012-02-23 Akim Demaille doc: fix environment issues. @@ -3686,10 +9978,81 @@ Missing includes. * tests/calc.at, tests/named-refs.at: Include assert.h. +2012-02-22 Akim Demaille + + maint: gitignore. + * examples/mfcalc/.gitignore, examples/rpcalc/.gitignore: Fix. + +2012-02-21 Akim Demaille + + regen. + * src/parse-gram.c, src/parse-gram.h: regen. + +2012-02-21 Akim Demaille + + tests: fix regressions. + Exit status 63 is documented for version-mismatch. + * bootstrap.conf (gnulib_modules): Remove sysexits. + * src/system.h (EX_MISMATCH): Define. + * src/parse-gram.y (version_check): Use it instead of EX_CONFIG. + + Missing includes. + * tests/calc.at, tests/named-refs.at: Include assert.h. + +2012-02-21 Akim Demaille + + tests: post-process stderr to normalize quotes. + * tests/bison.in: Save bison's stderr, and convert gettextized + quotes to plain ASCII. + +2012-02-21 Akim Demaille + + glr: fix ambiguity reports. + * tests/glr-regression.at (Ambiguity reports): New. + 2012-02-21 Akim Demaille glr: fix ambiguity reports. + Fix a regression introduced in commit + 783aa653f4ca70a75919c8516b950494c612cbfe. + * tests/glr-regression.at (Ambiguity reports): New. + * data/glr.c (yyreportTree): Fix an offset error. + +2012-02-19 Akim Demaille + + doc: stylistic improvements. + * doc/bison.texinfo: Prefer "continue" to empty loop bodies. + Add some @group/@end group to avoid poor page breaks. + +2012-02-19 Akim Demaille + + maint: address sc_prohibit_doubled_word. + * data/yacc.c, doc/bison.texinfo: Reword to avoid having to + disable that check. + * cfg.mk: No longer skip this test. + +2012-02-19 Akim Demaille + + maint: address sc_prohibit_always-defined_macros. + * cfg.mk: No longer skip it, except where EXIT_SUCCESS is used + as a witness for stdlib.h. + Skip this test when appropriate. + * data/yacc.c: Drop a note about why EXIT_SUCCESS is defined here. + +2012-02-19 Akim Demaille + + maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC. + * bootstrap.conf (gnulib_modules): Require progname. + * src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it. + * cfg.mk (exclude): New. + Use it. + Skip lib/main.c for bindtextdomain and set_program_name. + +2012-02-19 Akim Demaille + + maint: remove stray file. + * config.hin: Remove. 2012-02-19 Akim Demaille @@ -3699,6 +10062,25 @@ 2012-02-19 Akim Demaille + doc: check the rpcalc. + * doc/bison.texinfo: Tag rpcalc.y snippets. + Add missing includes. + (Rpcalc Rules): Don't issue leading tabs. + Complete an Info menu. + Use @result. + * examples/rpcalc/local.mk: New. + * examples/rpcalc/rpcalc.test: New. + * examples/local.mk: Use them. + * examples/mfcalc/mfcalc.test: Remove dup test. + * examples/test: Disable debug traces. + +2012-02-19 Akim Demaille + + regen. + * src/parse-gram.c, src/parse-gram.h: Regen. + +2012-02-19 Akim Demaille + maint: address sc_prohibit_doubled_word. * data/yacc.c, doc/bison.texinfo: Reword to avoid having to disable that check. @@ -3728,6 +10110,12 @@ 2012-02-19 Akim Demaille + bitset: fix an incorrect error message. + * lib/bitset_stats.c: here. + Reported by Stefano Lattarini. + +2012-02-19 Akim Demaille + maint: address some syntax-issues remaining after cherry-picking from master. * cfg.mk: Skip bison generated files, 2.5 is generating trailing blanks. This is already fixed in master. @@ -3783,34 +10171,284 @@ Don't use parens with cpp's defined. Remove useless includes. -2012-02-19 Akim Demaille +2012-02-19 Akim Demaille + + maint: address a couple of syntax-check errors. + * cfg.mk (local-checks-to-skip): Remove sc_error_message_period + and sc_error_message_uppercase. + Address the uncovered issues. + * po/POTFILES.in: Add missing files. + * src/symtab.c: Remove useless includes. + * lib/bitset_stats.c, src/files.c, tests/glr-regression.at: Use + conformant error messages. + +2012-02-19 Akim Demaille + + maint: gnulib: upgrade. + +2012-02-18 Akim Demaille + + maint: remove trailing empty lines. + * cfg.mk: No longer skip sc_prohibit_empty_lines_at_EOF, except + for parse-gram.h (generated). + * examples/mfcalc/.gitignore, lib/.gitignore, m4/.gitignore, + * po/.gitignore, runtime-po/.gitignore: Remove trailing/leading + empty lines. + +2012-02-18 Akim Demaille + + maint: regen. + * src/parse-gram.c, src/parse-gram.h: regen. + +2012-02-18 Akim Demaille + + maint: avoid "magic number exit". + * cfg.mk (local-checks-to-skip): No longer skip it. + * bootstrap.conf (gnulib_modules): Add sysexits. + * doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y, + * src/system.h, tests/calc.at, tests/named-refs.at: Use assert + where appropriate instead of "if (...) exit". + Use symbolic exit status elsewhere. + +2012-02-18 Akim Demaille + + maint: fix some syntax-check issues. + * cfg.mk (local-checks-to-skip): Remove + sc_prohibit_quotearg_without_use, sc_prohibit_strcmp, + sc_unmarked_diagnostics, sc_useless_cpp_parens. + (sc_unmarked_diagnostics): Skip DJGPP. + * data/yacc.c, src/LR0.c, src/closure.c, + * src/flex-scanner.h, src/gram.c, src/lalr.c, + * src/print-xml.c, src/print.c, src/print_graph.c, + * src/reader.c, src/reduce.c, src/tables.c: + Don't use parens with cpp's defined. + Remove useless includes. + +2012-02-18 Akim Demaille + + maint: address a couple of syntax-check errors. + * cfg.mk (local-checks-to-skip): Remove sc_error_message_period + and sc_error_message_uppercase. + Address the uncovered issues. + * po/POTFILES.in: Add missing files. + * src/symtab.c: Remove useless includes. + * lib/bitset_stats.c, src/files.c, tests/glr-regression.at: Use + conformant error messages. + +2012-02-18 Akim Demaille + + maint: gnulib: upgrade. + +2012-02-17 Akim Demaille + + doc: mfcalc: fix includes. + * doc/bison.texinfo: math.h is needed early. + +2012-02-17 Akim Demaille + + examples: factor the test suite. + * examples/mfcalc/test, examples/calc++/test: Extract the + common bits into... + * examples/test: here. + (cwd): New. + Use it to avoid a race on the temporary directory. + Reported by Jim Meyering. + * examples/mfcalc/test, examples/calc++/test: Rename into... + * examples/mfcalc/mfcalc.test, examples/calc++/calc++.test: these. + * examples/calc++/local.mk, examples/mfcalc/local.mk, + * examples/local.mk: Adjust. + +2012-02-17 Akim Demaille + + examples: fix the test suites. + * examples/calc++/test, examples/mfcalc/test (me): Be more + meaningfull: include the example name. + (prog): Factor. + (run): Avoid printf, use echo. + Add missing parens. + (cleanup): New. + Call it on trap. + Remove the previous "rm" that did the cleanup. + Move into a private directory to avoid concurrency issues. + Reported by Jim Meyering. + +2012-02-17 Jim Meyering + + examples: link mfcalc with -lm for uses of pow, cos, atan, etc. + * examples/mfcalc/local.mk (examples_mfcalc_mfcalc_LDADD): Define. + +2012-02-16 Akim Demaille + + mfcalc: extract and exercise. + * examples/mfcalc/local.mk, examples/mfcalc/test: New, + based on calc++'s ones. + * examples/local.mk: Include mfcalc/local.mk. + +2012-02-16 Akim Demaille + + calc++: factor for other extracted tests. + * Makefile.am (TESTS, check_PROGRAMS): Initialize here. + * examples/local.mk (doc, extexi): Define here. + * examples/calc++/local.mk: Adjust accordingly. + * configure.ac: Ask for parallel-tests (for the way the logs + are handled). + * examples/calc++/test: As a consequence, always be verbose. + ($prog): New. + (run): Use it. + Sort the tests in a more natural order (simplest first). + +2012-02-16 Akim Demaille + + doc: mfcalc: send errors to stderr. + * doc/bison.texinfo (Mfcalc Lexer): New. + (Mfcalc Main): Move the definition of main and yyerror here, for + clarity. + Let yyerror report on stderr. + +2012-02-16 Akim Demaille + + doc: fix mfcalc code. + * doc/bison.texinfo (Multi-function Calc): Add missing includes. + Fix the rendering of the result: use @result and remove the + initial tabulation in the actual code. + Fix stylistic issues: avoid the , operator. + Add extexi mark-up. + * examples/extexi: Also support @smallexample. + +2012-02-16 Akim Demaille + + tests: c++: stylistic changes. + * tests/c++.at: Don't use void for incoming arguments. + Prefer cstdlib to stdlib.h. + +2012-02-16 Jim Meyering + + tests: avoid c++ failure due to lack of getenv decl + * tests/c++.at (Syntax error as exception): Avoid spurious failure + at least when compiling with g++-4.7.x due to lack of declaration + of getenv. Include . + +2012-02-15 Akim Demaille + + maint: rely on Automake for parsers. + * Makefile.am (AM_YFLAGS): Automake looks for "-d" alone. + Move other options in here. + (BISON): New. + (YACC): Use it. + (bison_SOURCES): Now that automake can see `-d' in AM_YFLAGS, + we can rely on it to compile and ship the parser header + files. + + Based on commit 737406a32c201471699bfa0843d1f432f3ec29ab and + commit 3d6ca339083c278d907c9f030f4ba6bc5ecb07f2. + +2012-02-15 Akim Demaille + + maint: trust Automake for parser headers. + * examples/calc++/local.mk, src/local.mk: Now that automake + can see `-d' in AM_YFLAGS, we can rely on it to compile + and ship the parser header files. + +2012-02-15 Akim Demaille + + maint: help Automake reading Yacc flags. + * Makefile.am (AM_YFLAGS): Automake looks for "-d" alone. + +2012-02-15 Akim Demaille + + calc++: rely on Automake. + Rely on $(YACC) being the bison being built, and let Automake do the + rest. It turned out to be much more difficult than anticipated, for + various reasons, including some bad behavior from Automake 1.11.2 + which (i) generates calc++-parser.h instead of calc++-parser.hh, and + (ii) leaves an #include "y.tab.h" in the generated parser instead + of #include "calc++-parser.h". + + The authors of Automake appear to be aware of the problem, + http://lists.gnu.org/archive/html/automake/2011-05/msg00008.html + so a simple work around will suffice for the time being. + + * examples/calc++/y.tab.h, examples/calc++/calc++-parser.hh: New. + To work around Automake 1.11.2 issues. + * examples/calc++/local.mk: Remove all the rules for compilation + with bison, leave them to Automake. + So provide it with "calc++-parse.yy" as a source file. + (calc_sources_generated, calc_sources_extracted): Rename as. + (calc_generated, calc_extracted): these. + (calc_sources): New. + Fix them. + +2012-02-14 Akim Demaille + + maint: tidy the Makefile a bit. + * src/local.mk: Put yacc related variables together. + (AUTOMAKE_OPTIONS): Move to... + * Makefile.am: here. + Remove an old Emacs mode request which disables Automake support. + * src/local.mk (YACC, AM_YFLAGS): Move to... + * Makefile.am: here, as they will be used by other local.mks. + +2012-02-14 Akim Demaille + + maint: de-recurse the handling of examples + The directory was still using a local Makefile.am because it provides + "scoped" Make variables: these examples are not meant to use the same + CPPFLAGS etc. If we were to use the same -I set, we'd pick up + gnulib's stdio.h for instance, which we do not want for these simple + examples. + + Yet, as a result, the dependencies are less accurate, there is code + duplication, etc. This is especially perceptible when trying to + extract more examples from the documentation, as will be done in + forthcoming changes. + + In order to make the tuning of CPPFLAGS easier, discard the predefined + -I from Automake. + + * examples/calc++/Makefile.am: Rename as... + * examples/calc++/local.mk: this. + Adjust the paths which are now rooted in top_srcdir/top_builddir. + Handle BISON_CXX_WORKS here, instead of the too crude previous + approach that completely discarded the whole directory. + ($(BISON)): Remove now useless bouncing recipe. + (calc___CPPFLAGS): New. + Stay away from -Ilib. + * Makefile.am, configure.ac, examples/local.mk, + * examples/calc++/test: Adjust. + + * configure.ac: Pass nostdinc to Automake. + * src/local.mk, lib/local.mk (AM_CPPFLAGS): Move to... + * Makefile.am: here. + + * src/local.mk, examples/calc++/Makefile.am (BISON, BISON_IN): Factor + to... + * Makefile.am: here. + * tests/local.mk: Use it. - maint: address a couple of syntax-check errors. - * cfg.mk (local-checks-to-skip): Remove sc_error_message_period - and sc_error_message_uppercase. - Address the uncovered issues. - * po/POTFILES.in: Add missing files. - * src/symtab.c: Remove useless includes. - * lib/bitset_stats.c, src/files.c, tests/glr-regression.at: Use - conformant error messages. +2012-02-14 Akim Demaille -2012-02-19 Akim Demaille + variant: fix the example. + * examples/variant.yy: Adjust to "assert" being now + "parse.assert". - maint: gnulib: upgrade. +2012-02-14 Akim Demaille -2012-02-15 Akim Demaille + maint: more authors. + * AUTHORS: here. + Suggested by Tys Lefering. - maint: rely on Automake for parsers. - * Makefile.am (AM_YFLAGS): Automake looks for "-d" alone. - Move other options in here. - (BISON): New. - (YACC): Use it. - (bison_SOURCES): Now that automake can see `-d' in AM_YFLAGS, - we can rely on it to compile and ship the parser header - files. +2012-02-14 Akim Demaille - Based on commit 737406a32c201471699bfa0843d1f432f3ec29ab and - commit 3d6ca339083c278d907c9f030f4ba6bc5ecb07f2. + maint: add license headers. + * examples/calc++/test, examples/variant.yy, AUTHORS, THANKS, + * tests/atlocal.in, tests/bison.in: Add license headers. + Reported by Tys Lefering. + +2012-02-14 Akim Demaille + + maint: remove obsolete file. + * etc/make-ChangeLogs: Remove (used for rcs to cvs migration!). + Reported by Tys Lefering. 2012-02-14 Akim Demaille @@ -3831,6 +10469,73 @@ * etc/make-ChangeLogs: Remove (used for rcs to cvs migration!). Reported by Tys Lefering. +2012-02-10 Akim Demaille + + lalr1.cc: also handle syntax_error when calling yylex. + * data/lalr1.cc (parse): Catch syntax_error around yylex and + forward them to errlab1. + * tests/c++.at (Syntax error as exception): Check support for + syntax exceptions raised by the scanner. + * NEWS, doc/bison.texinfo: Document it. + +2012-02-10 Akim Demaille + + tests: lalr1.cc: check syntax_error. + * tests/c++.at (Syntax error as exception): New. + +2012-02-10 Akim Demaille + + tests: don't require locations uselessly. + * tests/c++.at (Syntax error discarding no lookahead): Contrary to + 2.5, C++ parsers can work without locations. + +2012-02-10 Akim Demaille + + maint: more silent rules. + * tests/local.mk (TESTSUITE_AT): Include plackage.m4. + Adjust dependencies. + Make testsuite.at its first argument. + (package.m4): Be silent. + (testsuite): Be silent. + Use $<. + +2012-02-10 Akim Demaille + + skeletons: simplify the protections against "unused" warnings. + * data/c.m4 (b4_parse_param_use): Also accept optional arguments + to "use". + Simplify callers. + * data/glr.c (yyuserAction): Simplify use of b4_parse_param_use. + (yy_reduce_print): Don't use b4_parse_param_use, as all the arguments + _are_ used. + * data/lalr1.cc (YY_SYMBOL_PRINT): Even when disabled, "use" the + symbol argument. + This neutralizes a warning in yypush_ when there are no symbols + with a semantic values. + (yy_destroy_): Remove useless "use" of yymsg. + +2012-02-10 Akim Demaille + + glr: formatting changes. + * data/glr.c: Split long strings. + +2012-02-08 Akim Demaille + + use a more consistent quoting style. + See . + Use quotearg as often as possible instead of leaving the choice of + the quotes to the translators. Use shorter messages. Factor similar + messages to a single format, to make localization easier. + + * src/files.c, src/getargs.c, src/muscle-tab.c, src/reader.c + * src/scan-code.l, src/scan-gram.l, src/symtab.c: + Use quote() or quotearg_colon() on printf arguments instead of + quotes in the format string. + * data/bison.m4: Keep sync with the changes in muscle-tab.c. + + * tests/skeletons.at, tests/input.at, tests/regression.at: Adjust + expected messages. + 2012-02-08 Akim Demaille use a more consistent quoting style. @@ -3848,6 +10553,18 @@ * tests/skeletons.at, tests/input.at, tests/regression.at: Adjust expected messages. +2012-01-31 Jim Meyering + + maint: reenable sc_m4_quote_check + * cfg.mk (local-checks-to-skip): Reenable sc_m4_quote_check. + * m4/dmalloc.m4: Add quotes. + +2012-01-31 Jim Meyering + + maint: force "make syntax-check" to pass by skipping failing tests + * cfg.mk (local-checks-to-skip): Skip all currently-failing tests. + Remove changelog-check; it's long gone. + 2012-01-31 Akim Demaille maint: remove stray debug code. @@ -3885,6 +10602,37 @@ Use atexit to ensure we close stdout. * .gitignore: Ignore new files pulled in via gnulib-tool. +2012-01-31 Akim Demaille + + maint: more silent-rules. + * doc/local.mk, src/local.mk, examples/calc++/Makefile.am: Use + $(AM_V_GEN) and $(AM_V_at) where appropriate. + +2012-01-29 Jim Meyering + + do not ignore errors like ENOSPC,EIO when writing to stdout + Standard output was never explicitly closed, so we could not + detect failure. Thus, bison would ignore the errors of writing + to a full file system and getting an I/O error on write, but only + for standard output, e.g., for --print-localedir, --print-datadir, + --help and some verbose output. + Now, "bison --print-datadir > /dev/full" reports the write failure: + bison: write error: No space left on device + Before, it would exit 0 with no diagnostic, implying success. + This is not an issue for "--output=-" or the other FILE-accepting + command-line options, because unlike most other GNU programs, + an output file argument of "-" is treated as the literal "./-", + rather than standard output. + * bootstrap.conf (gnulib_modules): Add closeout. + * src/main.c: Include "closeout.h". + Use atexit to ensure we close stdout. + * .gitignore: Ignore new files pulled in via gnulib-tool. + +2012-01-26 Akim Demaille + + tests: fix expected output. + * tests/actions.at (YYBACKUP): here. + 2012-01-26 Akim Demaille tests: fix expected output. @@ -3892,6 +10640,13 @@ 2012-01-26 Akim Demaille + maint: fix configure.ac + Fix commit 1890a2a816dab86c23cc1d0af8fac3986335deb7. + + * configure.ac: Fix variable assignment. + +2012-01-26 Akim Demaille + yacc: fix YYBACKUP. Reported by David Kastrup: https://lists.gnu.org/archive/html/bug-bison/2011-10/msg00002.html. @@ -3929,6 +10684,40 @@ maint: remove trailing blanks. * src/scan-code.l: Here. +2012-01-26 Akim Demaille + + yacc: fix YYBACKUP. + Reported by David Kastrup: + https://lists.gnu.org/archive/html/bug-bison/2011-10/msg00002.html. + + * data/yacc.c (YYBACKUP): Accept rhs size. + Restore the proper state value. + * TODO (YYBACKUP): Make it... + * tests/actions.at: a new test case. + * NEWS, THANKS: Update. + +2012-01-25 Akim Demaille + + maint: update TODO. + * TODO (Labeling the symbols): Remove, it's done ("Name references"). + +2012-01-25 Akim Demaille + + maint: update THANKS. + * THANKS: Update Tys's address, on his request. + +2012-01-25 Akim Demaille + + maint: fix --gcc-warnings support. + * configure.ac: Use enable_gcc_warnings instead of enableval, + which is valid only with AC_ARG_ENABLE. + +2012-01-25 Akim Demaille + + maint: silent-rules. + * configure.ac: Ask for silent-rules support. + Enable it by default. + 2012-01-25 Paul Eggert tests: port to Solaris 10 'diff -u' @@ -3949,6 +10738,14 @@ * cfg.mk: Exempt lib/yyerror.c from the sc_require_config_h_first test. * THANKS: Update. +2012-01-24 Paul Eggert + + tests: port to Solaris 10 'diff -u' + * tests/regression.at (parse-gram.y: LALR = IELR): Port to Solaris 10, + where "diff -u X X" outputs "No differences encountered" + instead of outputting nothing. Reported by Tomohiro Suzuki in + . + 2012-01-24 Jim Meyering maint: generate ChangeLog from git log @@ -4001,6 +10798,18 @@ 2012-01-23 Jim Meyering + build: avoid possibly-replaced fprintf in liby-source, yyerror.c + * lib/yyerror.c (yyerror): Use fputs and fputc rather than fprintf + with a mere "%s\n" format. Always return 0 now, on the assumption + that the return value was never used anyway. + Don't include after all. This avoids a problem + reported by Thiru Ramakrishnan in + http://lists.gnu.org/archive/html/help-bison/2011-11/msg00000.html + * cfg.mk: Exempt lib/yyerror.c from the sc_require_config_h_first test. + * THANKS: Update. + +2012-01-23 Jim Meyering + build: update gnulib and autoconf submodules to latest (cherry picked from commit 728415f885e5cb8e518c8576fa6e1f541e384130) 2012-01-23 Jim Meyering @@ -4047,6 +10856,16 @@ * doc/bison.texinfo (Bug Reports): s/can not/cannot/ And remove trailing blanks. +2012-01-23 Jim Meyering + + build: generalize etc/prefix-gnulib-mk + This script hard-coded "libbison" and lib/gnulib.mk. + Adjust the script to require a --lib-name=$gnulib_name option + and a FILE argument like lib/$gnulib_mk. + Also add support for --help and --version. + * etc/prefix-gnulib-mk: Generalize. + * bootstrap.conf (bootstrap_post_import_hook): Update its invocation. + 2012-01-22 Jim Meyering maint: get gpl-3.0 from gnulib @@ -4054,3 +10873,124 @@ * doc/gpl-3.0.texi: Remove from version control, now that we get it via gnulib. * doc/.gitignore: Ignore it. + +2012-01-20 Akim Demaille + + maint: be more robust to gnulib's FOO_H variables. + * configure.ac: Instead of listing gnulib's variables, look for + them among AC_SUBST variables. + +2012-01-20 Jim Meyering + + maint: generate ChangeLog from git log + * Makefile.am (gen-ChangeLog): New rule. + (dist-hook): Depend on it. + (EXTRA_DIST): Distribute the two ChangeLog-* files. + * bootstrap.conf (gnulib_modules): Add gitlog-to-changelog. + (bootstrap_post_import_hook): Ensure that ChangeLog exists. + * build-aux/git-log-fix: New file. + * ChangeLog-2012: Renamed ... + * ChangeLog: ... from this. + * ChangeLog-1998: Renamed ... + * OChangeLog: ...from this + * .gitignore: Add ChangeLog. + +2012-01-19 Jim Meyering + + change more quotes in source, and adjust tests to match + Run this command to change each `%s' to '%s' in source directories: + git grep -l '`%s'\' src djgpp data \ + |xargs perl -pi -e '$q="'\''";s/`%s$q/$q%s$q/g' + * data/bison.m4: Affected per the above. + * djgpp/subpipe.c: Likewise. + * src/files.c: Likewise. + * src/getargs.c: Likewise. + * src/muscle-tab.c: Likewise. + * src/reader.c: Likewise. + * tests/glr-regression.at: Adjust to match. + * tests/input.at: Likewise. + * tests/push.at: Likewise. + * tests/skeletons.at: Likewise. + +2012-01-19 Jim Meyering + + quote consistently and make tests pass with new quoting from gnulib + Updating to gnulib pulled in new quote and quotarg modules, + by which quoting is now done like 'this' rather than `this'. + That change induces many "make check" test failures. This change + adapts code and tests so that "make check" passes once again. + * src/scan-code.l: Quote like 'this', not like `this'. + * src/scan-gram.l: Likewise. + * src/symtab.c: Likewise. + * tests/actions.at: Adjust tests to match. + * tests/input.at: Likewise. + * tests/named-refs.at: Likewise. + * tests/output.at: Likewise. + * tests/regression.at: Likewise. + * lib/.gitignore: Regenerate. + * m4/.gitignore: Likewise. + +2012-01-19 Jim Meyering + + build: update gnulib and autoconf submodules to latest + +2012-01-19 Jim Meyering + + build: manually update bootstrap from gnulib, and adapt + Updating to the latest bootstrap from gnulib involves more of a + change than usual, and updating to the latest gnulib would involve + its own set of challenges with the upcoming quoting changes, so + we update bootstrap manually and separately. + * bootstrap: Update from gnulib. + * Makefile.am: Initialize more variables to empty, so that gnulib.mk + can append to them with "+=". + * bootstrap.conf (gnulib_mk_hook): Remove. No longer honored. + (bootstrap_post_import_hook): Instead, run the same command, + etc/prefix-gnulib-mk lib/$gnulib_mk, via slightly different API. + Temporarily disable "bootstrap_sync=true". + * etc/prefix-gnulib-mk: Don't prepend "lib/" to tokens like -I$(... + or "\". + +2012-01-19 Jim Meyering + + maint: include first + * cfg.mk (exclude_file_name_regexp--sc_require_config_h_first): + Exempt data/glr.c and data/yacc.c from the include-config.h-first + requirement. + +2012-01-19 Jim Meyering + + build: include from lib/yyerror.c + * lib/yyerror.c: Include . + +2012-01-19 Jim Meyering + + maint: list djgpp/subpipe.c in po/POTFILES.in + * po/POTFILES.in: Add djgpp/subpipe.c. + +2012-01-19 Jim Meyering + + maint: placate the space-TAB syntax-check + * cfg.mk (exclude_file_name_regexp--sc_space_tab): Exempt + tests/input.at and tests/c++.at, since they appear to use + SP-TAB sequences deliberately. + * OChangeLog: Remove space-before-TAB. + +2012-01-19 Jim Meyering + + maint: remove final trailing space + * src/scan-gram.l (%): Remove single space at end of line. + +2012-01-19 Jim Meyering + + maint: get gpl-3.0 from gnulib + * bootstrap.conf (gnulib_modules): Add gpl-3.0. + * doc/gpl-3.0.texi: Remove from version control, now that + we get it via gnulib. + * doc/.gitignore: Ignore it. + +2012-01-19 Jim Meyering + + doc: correct typo: s/can not/cannot/ + * doc/bison.texinfo (Bug Reports): s/can not/cannot/ + And remove trailing blanks. diff --git a/ChangeLog-2012 b/ChangeLog-2012 index 6981c55..254f3d2 100644 --- a/ChangeLog-2012 +++ b/ChangeLog-2012 @@ -1,30 +1,32 @@ -2012-01-15 Jim Meyering +2012-01-15 Akim Demaille + + java: fix reduction traces. + * data/lalr1.java (yy_reduce_print): Fix state index. + Reported by Tim Landscheidt. + +2012-01-12 Jim Meyering + + build: avoid warning from coverity about lbitset_elt_find + * lib/lbitset.c (lbitset_elt_find): Remove unnecessary test of "elt", + at a point where we know it is non-NULL, due to prior dereference. + +2012-01-13 Jim Meyering maint: get fdl.texi from gnulib * bootstrap.conf (gnulib_modules): Add fdl. * doc/fdl.texi: Remove file. * doc/.gitignore: Add it here. -2012-01-15 Jim Meyering - maint: spell "file system" as two separate words * doc/Doxyfile.in: Spell it "file system", to avoid a "make syntax-check" failure. -2012-01-15 Jim Meyering - maint: avoid "the the" * djgpp/README.in: s/the the/the/ * src/parse-gram.c (lloc_default): Likewise. * src/parse-gram.y (lloc_default): Likewise, and remove a trailing space. -2012-01-13 Jim Meyering - - build: avoid warning from coverity about lbitset_elt_find - * lib/lbitset.c (lbitset_elt_find): Remove unnecessary test of "elt", - at a point where we know it is non-NULL, due to prior dereference. - 2012-01-13 Akim Demaille maint: factor copyright year. @@ -56,6 +58,12 @@ 2011-08-21 Joel E. Denny + lalr1.cc: remove trailing comma from enumerator list. + * data/lalr1.cc (yy::parser): Here. This suppresses a -pedantic + warning. + +2011-08-21 Joel E. Denny + tests: add -pedantic for --enable-gcc-warnings. This should help to avoid some portability problems. For example, it would have revealed the empty unions fixed by the last patch @@ -75,6 +83,22 @@ * tests/existing.at (GNU Cim Grammar) (GNU pic (Groff 1.18.1) Grammar.): Remove empty %union. +2011-07-24 Joel E. Denny + + global: remove unnecessary horizontal tabs. + This change was made by applying emacs' untabify function to + nearly all files in Bison's repository. Required tabs in make + files, ChangeLog, regexps, and test code were manually skipped. + Other notable exceptions and changes are listed below. + * bootstrap: Skip because we sync this with gnulib. + * data/m4sugar/foreach.m4 + * data/m4sugar/m4sugar.m4: Skip because we sync these with + Autoconf. + * djgpp: Skip because I don't know how to test djgpp properly, and + this code appears to be unmaintained anyway. + * README-hacking (Hacking): Specify that tabs should be avoided + where not required. + 2011-07-10 Joel E. Denny build: avoid YACC typo inherited from Autoconf. @@ -186,25 +210,13 @@ 2011-05-01 Joel E. Denny - Prepare for 2.5 release. - * NEWS (2.5_rc1): Rename back to... - (2.5): ... this, and unset date. - -2011-05-01 Joel E. Denny - - Version 2.5_rc1. - * NEWS (2.5): Rename to... - (2.5_rc1): ... this, and set date. - -2011-05-01 Joel E. Denny - Pacify -DGNULIB_POSIXCHECK. * bootstrap.conf (gnulib_modules): Add all modules suggested by -DGNULIB_POSIXCHECK. * src/files.c (file_name_split) * src/getargs.c (getargs) * src/location.c (boundary_set_from_string) - * src/output.c (token_definitions_output, output_skeleton) + * src/output.c (output_skeleton) * src/parse-gram.y (prologue_declaration) * src/scan-gram.l (handle_syncline) * src/symtab.c (symbol_new): Use mbschr and mbsrchr instead of @@ -356,12 +368,6 @@ * NEWS (2.5): Document fix for -Wno-CATEGORY. -2008-11-21 Di-an Jan - - Implement no-XXX arguments for --warnings, --report, --trace. - * src/getargs.c (flags_argmatch): Handles no-XXX. - Fix typo in doxygen comment. - 2011-03-20 Joel E. Denny doc: fix confusing citation of LAC publication. @@ -476,16 +482,17 @@ lr.keep-unreachable-states, lr.type, and parse.lac into brief summaries, and cross-reference the appropriate subsections of Tuning LR. For parse.lac, mention that it's only implemented for - deterministic parsers in C. - (Error Reporting): When mentioning %error-verbose, mention LAC, + deterministic parsers in C. In parse.error entry, mention LAC, and add cross-reference to the LAC section. + (Error Reporting): When mentioning parse.error, mention LAC, and + add cross-reference to the LAC section. (Tuning LR): New section with an extended version of the documentation removed from %define Summary. Change all cross-references in the manual to point here instead of there. - (Calc++ Parser): When mentioning %error-verbose, mention LAC, and - add cross-reference to the LAC section. - (Table of Symbols): In %error-verbose and YYERROR_VERBOSE entries, - add cross-references to Error Reporting. + (Calc++ Parser): When mentioning parse.error, mention LAC, and add + cross-reference to the LAC section. + (Table of Symbols): In %error-verbose entry, add cross-reference + to Error Reporting. (Glossary): Capitalize entry titles consistently. Add definitions for "defaulted state" and "unreachable state". Expand IELR acronym in IELR's entry. @@ -518,13 +525,14 @@ reversed access to location stack. * THANKS (Bernd Kiefer): Add. -2010-05-11 Akim Demaille +2011-02-13 Joel E. Denny - doc: please Emacs. - * doc/bison.texinfo (Local Variables): Move this after the - LocalWords, since the latter are looked for in the whole document, - while the former are looked for only at its end. - Require american spell checking. + doc: fix some minor inconsistencies. + * doc/bison.texinfo (%define Summary): Fix mislabeled entry for + lex_symbol. + (%code Summary): For consistency with the variable list in the + %define Summary, enclose the list of %code qualifiers in a table + instead of an itemize. 2011-02-06 Joel E. Denny @@ -809,7 +817,7 @@ is requested. * tests/conflicts.at (%nonassoc and eof): Extend to check the effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full. - (%error-verbose and consistent errors): Likewise. + (parse.error=verbose and consistent errors): Likewise. (LAC: %nonassoc requires splitting canonical LR states): New test group demonstrating how LAC can fix canonical LR. * tests/input.at (LAC: Errors for %define): New test group. @@ -827,18 +835,6 @@ 2010-11-07 Joel E. Denny - yysyntax_error: adjust prior fixes for branch-2.5's lalr1.cc. - On master, there is no yychar in lalr1.cc, but there is on - branch-2.5, and the prior cherry-pick of "Fix handling of yychar - manipulation in user semantic actions" wasn't adjusted for that - difference. - * data/lalr1.cc (yy::parser::parse): Translate yychar before - every use of yytoken, and add comments explaining this approach. - * tests/conflicts.at (%error-verbose and consistent errors): - Extend to test yychar manipulation with lalr1.cc. - -2010-11-07 Joel E. Denny - yysyntax_error: fix for consistent error with lookahead. * NEWS (2.5): Document. * data/yacc.c (yysyntax_error): In a verbose syntax error @@ -854,14 +850,14 @@ * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the unexpected token unless there actually is no lookahead. * data/lalr1.cc (yy::parser::parse): If there's no lookahead, - set yytoken to yyempty_ before invoking yysyntax_error_. + pass yyempty_ not yyla.type to yysyntax_error_. (yy::parser::yysyntax_error_): Again, don't drop the unexpected token unless there actually is no lookahead. * data/lalr1.java (YYParser::parse): If there's no lookahead, set yytoken to yyempty_ before invoking yysyntax_error. (YYParser::yysyntax_error): Again, don't drop the unexpected token unless there actually is no lookahead. - * tests/conflicts.at (%error-verbose and consistent + * tests/conflicts.at (parse.error=verbose and consistent errors): Extend test group to further reveal how the previous use of the simple "syntax error" message was too general. Test yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected @@ -879,7 +875,7 @@ There are no behavioral changes here. * data/glr.c (yyreportSyntaxError): Reorganize. * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize. - * tests/conflicts.at (%error-verbose and consistent errors): + * tests/conflicts.at (parse.error=verbose and consistent errors): Reorganize. 2010-11-07 Joel E. Denny @@ -894,6 +890,11 @@ 2010-10-31 Joel E. Denny + Fix memory leak. + * src/output.c (prepare_rules): Free temporary array. + +2010-10-31 Joel E. Denny + yysyntax_error: improve invocation readability. * data/yacc.c (yyparse, yypush_parse): For yysyntax_error invocation, get rid of the while loop, which is misleading @@ -947,9 +948,32 @@ out of storage? If not, we can omit malloc-gnu; but for now I left it in to be safe. (vc_ignore): Remove. + (gnulib_mk_hook): New function. * README-hacking: Renamed from HACKING, since gnulib bootstrap now uses that convention. +2010-09-09 Paul Hilfinger + + * data/glr.c (yySymbol): Define as int to avoid compiler warnings about + possible change of value. + +2010-09-08 Paul Hilfinger + + * data/glr.c (yy_reduce_print): Change yyrhsVals to yyvsp to remove + compiler errors when using %debug. + Add declaration of yylow when locations in use to avoid compilation + error. + (yyglrReduce): Conditionalize message "Parse ... rejected by rule..." + on whether we are in split mode, for consistency with behavior of + non-GLR parsing. + +2010-09-01 Akim Demaille + + Address GCC warnings about shadowed local variables (yyflag). + * data/glr.c (YYCHK): Rename yyflag as yychk_flag. + (yyprocessOneStack): Reduce the scope of yyaction, yyconflicts, + yyrule, and yyflag. + 2010-08-05 Joel E. Denny Version 2.4.3. @@ -1006,6 +1030,14 @@ 2010-07-25 Joel E. Denny + build: fix our adjustments for gnulib files in lib. + * configure.ac: For prepending lib/ to the values of config + variables, fix detection of empty values. Also, due to recent + gnulib changes, add LIBUNISTRING_UNITYPES_H and + LIBUNISTRING_UNIWIDTH_H to the list of those variables. + +2010-07-25 Joel E. Denny + maint: use announce-gen's new --mail-headers. * HACKING (Announce): Update instructions. * cfg.mk (announcement_Cc_): Define. @@ -1020,6 +1052,61 @@ (Output files: -dv >&-): Skip test group if running maintainer-check-valgrind. +2010-07-23 Paul Hilfinger + + * NEWS: Describe new semantic-predicate feature. + * data/c.m4 (b4_predicate_case): New definition. + * data/java.m4 (b4_predicate_case): New definition. + * data/glr.c (yyimmediate): Add definition. + (yydoAction): Remove comment, now obsolete. + Do YY_REDUCE_PRINT here. + (yyglrReduce): Alter comment to indicate that semantic values + need not be deferred. + Remove YY_REDUCE_PRINT from here; done in yydoAction. + (yyprocessOneStack): Pass immediate flag. + Delete stacks rejected by predicates in newly split-off parsers. + Change handling of yyerr so that only current stack gets deleted + when semantic predicate fails. + (yyfillin): Don't crash if a semantic value is unresolved (as may + happen in predicate rules). + Copy lr state as well in debugging mode. + Update comment on setting of yysval to include yyloc as well. + (yy_reduce_print): Add yynormal argument. Perform fillin properly. + Report unresolved RHS values. + (yyimmediate): New table. + * src/gram.h (struct rule): Add is_predicate field. + * src/output.c (user_actions_output): Use b4_predicate_case for + predicates. + (prepare_symbols): Output yyimmediate. + * src/scan-gram.l: Add %? token, SC_PREDICATE state. + * src/scan-code.l (code_props_rule_action_init): Add is_predicate + argument. + * src/scan-code.h (struct code_props): Add is_predicate field. + (code_props_rule_action_init): New interface. + * src/parse-gram.y (%?{...}): New token. + (rhs): Add %?{...} rule. + * src/parse-gram.c: Regenerate. + * src/parse-gram.h: Regenerate. + * src/reader.c (grammar_current_rule_action_append): Add + immediate argument. + (grammar_midrule_action): Use new interface for + code_props_rule_action_init. + (grammar_current_rule_action_append): Ditto. + (packgram): Transfer is_predicate value. + * src/reader.h (grammar_current_rule_action_append): New interface. + * doc/bison.texinfo: Document semantic predicates (%?). + + * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction) + (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet) + (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted) + (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce) + (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction) + (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter + names in comments and mention all parameters. + (struct yyGLRState): Fix description of yyposn field. + (yyresolveLocations): Correct comment so as not to imply action when + yyn1==0. + 2010-06-17 Paul Eggert Update from GFDL GFDL 1.2 to 1.3. @@ -1027,8 +1114,6 @@ * doc/fdl.texi: Update to version 1.3, taken from: http://www.gnu.org/licenses/fdl.texi -2010-06-17 Paul Eggert - Do not use date ranges in copyright notices. See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices @@ -1038,23 +1123,23 @@ * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4: * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc: * data/java-skel.m4, data/java.m4, data/lalr1.cc: - * data/lalr1.java, data/location.cc: - * data/xslt/bison.xsl: + * data/lalr1.java, data/local.mk, data/location.cc: + * data/stack.hh, data/variant.hh, data/xslt/bison.xsl: * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl: * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint: * djgpp/README.in, djgpp/config.bat, djgpp/config.sed: * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat: - * djgpp/subpipe.c, djgpp/subpipe.h: - * djgpp/testsuite.sed, doc/bison.texinfo: - * doc/refcard.tex, etc/README, etc/bench.pl.in: + * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h: + * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk: + * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk: * examples/calc++/Makefile.am, examples/extexi: - * lib/abitset.c, lib/abitset.h: + * examples/local.mk, lib/abitset.c, lib/abitset.h: * lib/bbitset.h, lib/bitset.c, lib/bitset.h: * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c: * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h: * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c: * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h: - * lib/libiberty.h, lib/main.c, lib/timevar.c: + * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c: * lib/timevar.def, lib/timevar.h, lib/vbitset.c: * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4: * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4: @@ -1066,7 +1151,7 @@ * src/derives.c, src/derives.h, src/files.c, src/files.h: * src/flex-scanner.h, src/getargs.c, src/getargs.h: * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c: - * src/ielr.h, src/lalr.c, src/lalr.h: + * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk: * src/location.c, src/location.h, src/main.c: * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c: * src/named-ref.h, src/nullable.c, src/nullable.h: @@ -1083,13 +1168,10 @@ * tests/calc.at, tests/conflicts.at, tests/cxx-type.at: * tests/existing.at, tests/glr-regression.at: * tests/headers.at, tests/input.at, tests/java.at: - * tests/local.at, tests/named-refs.at: + * tests/local.at, tests/local.mk, tests/named-refs.at: * tests/output.at, tests/push.at, tests/reduce.at: * tests/regression.at, tests/sets.at, tests/skeletons.at: * tests/synclines.at, tests/testsuite.at, tests/torture.at: - * data/Makefile.am, data/location.cc, doc/Makefile.am, src/Makefile.am: - * tests/Makefile.am, lib/Makefile.am, examples/Makefile.am: - * etc/Makefile.am: Don't use date ranges in copyright notices. 2010-05-11 Akim Demaille @@ -1100,7 +1182,24 @@ sections. * NEWS (2.5): Document this. -2010-05-07 Akim Demaille +2010-05-11 Akim Demaille + + doc: please Emacs. + * doc/bison.texinfo (Local Variables): Move this after the + LocalWords, since the latter are looked for in the whole document, + while the former are looked for only at its end. + Require american spell checking. + +2010-05-10 Akim Demaille + + doc: fix lalr1.cc documentation. + * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature. + (C++ Bison Interface): Fix lalr1.cc skeleton name. + (C++ Parser Interface): Fix semantic_type and location_type names. + Document yy::parser::token. + Reported by Jerry Quinn. + +2010-05-10 Akim Demaille c++: use YYRHSLOC. * data/lalr1.cc (YYRHSLOC): New. @@ -1111,28 +1210,45 @@ Check that glr.cc supports user defined location_type. * NEWS: Document this. -2010-05-10 Akim Demaille +2010-05-07 Akim Demaille - doc: fix lalr1.cc documentation. - * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature. - (C++ Bison Interface): Fix lalr1.cc skeleton name. - (C++ Parser Interface): Fix semantic_type and location_type names. - Document yy::parser::token. - Reported by Jerry Quinn. + doc: fix typo. + * tests/synclines.at: here. + +2010-05-04 Akim Demaille + + tests: enhance AT_SYNCLINES_COMPILE. + * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns. + (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already + taken care of in AT_SYNCLINES_COMPILE. 2010-05-04 Akim Demaille lalr1.cc: don't generate location.hh when location_type is defined - * data/bison.m4 (b4_percent_define_use): New. - (b4_percent_define_get): Use it. - Accept a default value. + * data/bison.m4 (b4_percent_define_get): Accept a default value. * data/c++.m4: Do not provide a default value for the %define variable location_type, rather, use b4_percent_define_get with a default argument where its value is needed. * data/lalr1.cc: Do not load location.cc (which outputs both location.hh and position.hh) if the user defined location_type. Do not include location.hh either. - * data/glr.cc: Likewise. + +2010-05-04 Akim Demaille + + lalr1.cc: minor refactoring. + * data/lalr1.cc: Don't issue empty namespaces. + +2010-05-04 Akim Demaille + + tests: fix %printer. + Currently, there is no check that %printer ... (nor + %destructor) is about an existing type. This C++ test had + it wrong (<::std::string> vs. ). + + * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the + pretty-printing of lists into something better for parser traces. + Update the expected output. + Fix correspondance between %type/%token and %printer. 2010-05-04 Akim Demaille @@ -1143,14 +1259,6 @@ * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the location_type changes. -2010-05-04 Akim Demaille - - tests: enhance AT_SYNCLINES_COMPILE. - * tests/synclines.at (AT_TEST_SYNCLINE): Move GCC 4.5 protection - into... - (AT_SYNCLINES_COMPILE): here. - Add more distcc patterns. - 2010-05-01 Joel E. Denny tests: fix maintainer-xml-check. @@ -1314,7 +1422,7 @@ portability: fix for BSD make. Reported by Johan van Selst at . - * tests/Makefile.am ($(TESTSUITE)): Qualify package.m4 in + * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in this dependency list as in package.m4's target rule. 2010-03-23 Joel E. Denny @@ -1324,6 +1432,8 @@ . * NEWS (2.4.3): New. * THANKS (Johan van Selst): Add. + * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile + targets so that gnulib's new c++defs.h is matched. * gnulib: Update to latest. 2010-03-20 Joel E. Denny @@ -1376,7 +1486,7 @@ * bootstrap.conf (gnulib_modules): Add pipe. * gnulib: Update to latest to make sure we have all the latest fixes. - * lib/Makefile.am (libbison_a_SOURCES): Remove subpipe.h and + * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and subpipe.c. * po/POTFILES.in (lib/subpipe.c): Remove. * src/files.c (compute_output_file_names): Update invocations @@ -1412,6 +1522,15 @@ * tests/atlocal.in (abs_top_srcdir): Remove shell variable, which is already defined in atconfig. +2010-01-22 Joel E. Denny + + tests: fix missing include caught by g++ 4.4.1. + Reported by Tys Lefering. + * HACKING (Release checks): Add note about trying a recent GCC. + * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include + cstdlib for abort. + (_AT_DATA_EXPECT2_Y): Likewise. + 2010-01-21 Joel E. Denny * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory. @@ -1497,45 +1616,6 @@ * HACKING (Release Procedure): Recommend a secure automake. -2008-12-11 Akim Demaille - - Propagate i18n changes into glr.c. - * data/glr.c (yyreportSyntaxError): Use "switch" instead of - building the error message format dynamically. - * data/lalr1.java: Formatting changes. - -2009-12-22 Joel E. Denny - - Port small part of master's 11707b2b so future ports are easier. - * data/lalr1.java (YYParser::yysyntax_error): Untabify. - -2008-12-11 Akim Demaille - - Simplify the i18n of the error messages. - * data/lalr1.cc: Comment changes. - -2008-11-11 Akim Demaille - - Prefer M4 to CPP. - * data/lalr1.cc: Use b4_error_verbose_if instead of #if - YYERROR_VERBOSE. - -2008-11-11 Akim Demaille - - Support i18n of the parse error messages. - * TODO (lalr1.cc/I18n): Remove. - * data/lalr1.cc (yysyntax_error_): Support the translation of the - error messages, as done in yacc.c. - Stay within the yy* pseudo namespace. - -2009-12-22 Joel E. Denny - - Port small part of master's 8901f32e so future ports are easier. - * data/lalr1.cc (yy::parser::yysyntax_error_): Always add second - argument, but name it in the function definition only when - verbose error messages are enabled and it'll thus be used. - (yy::parser::parse): Update use of yysyntax_error_. - 2009-12-29 Joel E. Denny portability: `<' and `>' are not always defined on addresses. @@ -1581,7 +1661,7 @@ action): New test group checking that translation happens before lookahead destructor calls at parser return. Previously, incorrect destructors were called. - * tests/conflicts.at (%error-verbose and consistent + * tests/conflicts.at (parse.error=verbose and consistent errors): New test group checking that translation happens at syntax error detection before the associated verbose error message and the associated lookahead destructor calls. While @@ -1609,6 +1689,19 @@ documentation. (LocalWords): Remove YYFAIL. +2009-12-20 Joel E. Denny + + tests: cleanup. + * tests/c++.at (Syntax error discarding no lookahead): Don't + ignore stderr. Instead, eliminate remaining warnings. + +2009-12-18 Joel E. Denny + + lalr1.cc: don't discard non-existent lookahead on syntax error. + * data/lalr1.cc (yy::parser::parse): Check yyempty first. + * tests/c++.at (Syntax error discarding no lookahead): New test + group. + 2009-12-17 Joel E. Denny Code cleanup. @@ -1673,6 +1766,14 @@ * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add lib/libbison.a so gnulib libraries can be linked. +2009-12-15 Joel E. Denny + + gnulib: update for fix of fprintf-posix, which we'll use soon. + * etc/prefix-gnulib-mk (prefix): Adjust regex for make file + targets so that gnulib's new arg-nonnull.h and link-warning.h + are matched. + * gnulib: Update. + 2009-12-14 Joel E. Denny Enable assertion output and --disable-assert for configure. @@ -1726,27 +1827,20 @@ * data/bison.m4: Update comments for rename to muscle-tab.h. -2009-10-08 Joel E. Denny - - Rename muscle_tab.* to muscle-tab.* for consistency with master. - * src/Makefile.am (bison_SOURCES): Update. - * src/getargs.c, src/ielr.c, src/lalr.c, src/main.c, - src/output.c, src/parse-gram.y, src/print.c, src/reader.c, - src/tables.c: Update include. - * src/muscle_tab.c, src/muscle_tab.h: Rename to... - * src/muscle-tab.c, src/muscle-tab.h: ... these and update - include. - 2009-10-07 Joel E. Denny Minor code cleanup. - * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and + * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and replace all uses with UNIQSTR_CONCAT. * src/uniqstr.c (uniqstr_vsprintf): New function. * src/uniqstr.h (uniqstr_vsprintf): Add prototype. (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New macros. +2009-10-06 Joel E. Denny + + * TODO (Complaint submessage indentation): New. + 2009-10-04 Joel E. Denny Minor code cleanup. @@ -1781,30 +1875,25 @@ message buffer, import and clean up memory management code from... (yyparse, yypush_parse): ... here. - * tests/regression.at (%error-verbose overflow): No longer an - expected failure. + * tests/regression.at (parse.error=verbose overflow): No longer + an expected failure. 2009-09-23 Joel E. Denny yysyntax_error: test memory management more. * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro. - * tests/regression.at (%error-verbose and YYSTACK_USE_ALLOCA): - New test group. - (%error-verbose overflow): New test group that reveals an + * tests/regression.at (parse.error=verbose and + YYSTACK_USE_ALLOCA): New test group. + (parse.error=verbose overflow): New test group that reveals an obscure bug. Expected fail for now. -2008-12-11 Akim Demaille - - Pass the token type to yysyntax_error. - * data/yacc.c (yysyntax_error): Take the transated token instead - of the raw number. - Adjust callers. - -2008-12-11 Akim Demaille +2009-10-04 Joel E. Denny - Simplify the i18n of the error messages. - * data/yacc.c (yysyntax_error): Rewrite, using a switch instead - of building dynamically the format string. + benchmarks: use %debug consistently among grammars. + * etc/bench.pl.in (generate_grammar_triangular): Do not activate + %debug by default. It can affect the timings even if yydebug=0. + (generate_grammar_calc): For consistency with other grammars, + use YYDEBUG environment variable to set yydebug. 2009-10-03 Joel E. Denny @@ -1838,16 +1927,6 @@ * tests/regression.at (parse-gram.y: LALR = IELR): New test group. -2009-09-16 Akim Demaille - - doc: comment changes. - * doc/bison.texinfo: Comment changes. - -2009-09-16 Akim Demaille - - doc: spell checking. - * doc/bison.texinfo: here. - 2009-09-19 Alex Rozenman Keep sub-messages aligned. Fix strings for translation. @@ -1864,6 +1943,62 @@ * tests/named-ref.at: Adjust test-cases. * NEWS (2.5): Add an announcement about named references. +2009-09-17 Akim Demaille + + doc: fixes. + * doc/bison.texinfo: here. + Reported by Alex Rozenman. + +2009-09-16 Akim Demaille + + doc: lalr1.cc and variants. + * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and + "variant" %define variables. + (C++ Semantic Values): Split into... + (C++ Unions, C++ Variants): these. + The latter is new. + (C++ Parser Interface): Fix type names. + Document parser::syntax_error. + Document the fact that locations are not mandatory. + (C++ Scanner Interface): Split into... + (Split Symbols, Complete Symbols): these. + The later is new. + (Calc++ Parsing Driver): Use variants. + Add more comments. + Adjust style. + (Calc++ Parser): Declare all the tokens, no + longer accept raw characters. + Remove %union. + Adjust types and printers. + Remove destructors. + (Calc++ Scanner): Use make_ functions. + Use strerror in error message. + +2009-09-16 Akim Demaille + + doc: spell checking. + * doc/bison.texinfo: here. + +2009-09-16 Akim Demaille + + doc: comment changes. + * doc/bison.texinfo: Comment changes. + +2009-09-16 Akim Demaille + + lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS. + * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the + constructor to take a token_type instead of the (internal) symbol + number. + Call yytranslate_. + * data/variant.hh (b4_symbol_constructor_define_): Therefore, + don't call yytranslate_ here. + +2009-09-16 Akim Demaille + + TODO: statistics. + * TODO (Figures): New. + 2009-09-13 Joel E. Denny tests: clean up push.at test group titles. @@ -1887,19 +2022,79 @@ comment, instead of saying "yyparse or yypush_parse", say either "yyparse" or "yypush_parse" depending on which it actually is. -2009-09-03 Joel E. Denny +2009-09-10 Joel E. Denny - Complain about unused %define variables and %code qualifiers. - * NEWS (2.5): Document. - * data/bison.m4 (b4_check_user_names): Complain instead of warn. - * doc/bison.texinfo (Decl Summary): Document complaint, and - improve %define documentation a little otherwise. - * tests/input.at (Reject unused %code qualifiers): Update. - (%define errors): Update. - (%define, --define, --force-define): Update. - (%define backward compatibility): Update. - (Unused %define api.pure): Update. - * tests/push.at (Push Parsing: Unsupported Skeletons): Update. + Fix --enable-gcc-warnings. + * src/parse-gram.y (%printer ): Handle param_none. + +2009-09-09 Akim Demaille + + lalr1.cc: syntax_error as exceptions. + It is common to use sort of factories in the user actions. These + factories may check some "syntactic" constraints that are not + enforced by the grammar itself. This is possible using YYERROR + within the action itself. Provide the user with a means to throw + a syntax_error exception. + + * data/c++.m4 (b4_public_types_declare, b4_public_types_define): + Declare and define yy::parser::syntax_error. + * data/lalr1.cc: Include stdexcept. + (yy::parser::parse): Wrap the user action within a try/catch. + * data/glr.cc: Include stdexcept. + +2009-09-09 Akim Demaille + + lalr1.cc: add missing "inline". + * data/c++.m4 (b4_public_types_define): Add missing inline to + implementations provided in headers. + +2009-09-09 Akim Demaille + + %param: documentation. + * NEWS (2.6): Document %param, %lex-param, and %parse-param + changes. + * doc/bison.texinfo: Document that %lex-param and %parse-param + are n-ary. + Changes some examples to demonstrate it. + (Calc++ Parser): Use %param. + +2009-09-09 Akim Demaille + + Regen. + +2009-09-09 Akim Demaille + + style changes. + * src/parse-gram.y (add_param): Scope changes. + +2009-09-09 Akim Demaille + + %parse: support several arguments. + * src/parse-gram.y (current_param): New. + (param_type): Add param_none. + (params): New nonterminal. + Use it. + +2009-09-09 Akim Demaille + + Regen. + +2009-09-09 Akim Demaille + + %param. + Provide a means to factor lex-param and parse-param common + declarations. + + * src/parse-gram.y (param_type): New. + Define a %printer for it. + (add_param): Use it. + (%parse-param, %lex-param): Merge into... + (%parse): this new token. + Adjust the grammar to use it. + * src/scan-gram.l (RETURN_VALUE): New. + (RETURN_PERCENT_FLAG): Use it. + (RETURN_PERCENT_PARAM): New. + Use it to support %parse-param, %lex-param and %param. 2009-09-03 Joel E. Denny @@ -1918,6 +2113,34 @@ rename variable "exact_mode" to "explicit_bracketing". * tests/named-ref.at: Adjust existing tests and add a new one. +2009-09-04 Akim Demaille + + Adjust synclines in src/parse-gram.[ch]. + * tests/bison.in: Do some magic (including working around issues + with ylwrap) when this wrapper is used to compile + src/parse-gram.y. + +2009-09-03 Joel E. Denny + + Complain about unused %define variables and %code qualifiers. + * NEWS (2.5): Document. + * data/bison.m4 (b4_check_user_names): Complain instead of warn. + * doc/bison.texinfo (Decl Summary): Document complaint, and + improve %define documentation a little otherwise. + * tests/input.at (Reject unused %code qualifiers): Update. + (%define errors): Update. + (%define, --define, --force-define): Update. + (%define backward compatibility): Update. + (Unused %define api.pure): Update. + * tests/push.at (Push Parsing: Unsupported Skeletons): Update. + +2009-09-03 Joel E. Denny + + Don't suppress warnings about unused parse.error. + * data/bison.m4 (b4_error_verbose_flag): Don't examine value of + %define variable parse.error unless b4_error_verbose_flag is + actually expanded in a skeleton. + 2009-09-03 Akim Demaille * NEWS (2.4.2): Add "Internationalization" item. @@ -1948,7 +2171,8 @@ (Table of Symbols): Likewise. * src/ielr.c (LrType): Update documentation. * src/parse-gram.y (content.opt): Add production for ID. - * tests/calc.at: Remove quotes in most tests. + * tests/actions.at: Remove quotes in most tests. + * tests/calc.at: Likewise. * tests/existing.at: Likewise. * tests/input.at: Likewise. * tests/local.at: Likewise. @@ -2002,8 +2226,8 @@ 2009-08-26 Joel E. Denny Actually handle the yytable zero value correctly this time. - * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't - mention zero values in the YYTABLE comments. + * data/bison.m4 (b4_integral_parser_tables_map): Don't mention + zero values in the YYTABLE comments. * data/glr.c (yytable_value_is_error): Don't check for zero value. * data/lalr1.cc (yy_table_value_is_error_): Likewise. @@ -2016,11 +2240,10 @@ 2009-08-25 Joel E. Denny More fixes related to last two patches. + * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE + comments: zero indicates syntax error not default action. * data/c.m4 (b4_table_value_equals): Comment that YYID must be defined. - * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix - yytable comments: zero indicates syntax error not default - action. * data/glr.c (yyis_pact_ninf): Rename to... (yypact_value_is_default): ... this. (yyisDefaultedState): Update for rename. @@ -2134,12 +2357,67 @@ 2009-08-19 Akim Demaille - doc: %initial-action to initialize yylloc. + tests: distcc compliance. + * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's + error messages from the output. + +2009-08-19 Akim Demaille + + variables: simplify the upgrade of namespace into api.namespace. + + This patch simplifies "variables: rename namespace as + api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c. + Suggested by Joel E. Denny in + http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html + + * src/muscle-tab.c (muscle_percent_variable_update): New. + (muscle_percent_define_insert): Use it in replacement of the + previous tr invocation. + Remove variable_tr, no longer needed. + * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy): + Remove. + * data/c++.m4: No longer handle namespace -> api.namespace. + * tests/input.at (%define backward compatibility): Check that + namespace is treated as api.namespace. + +2009-08-19 Akim Demaille + + doc: %initial-action to initialize yylloc. Reported by Bill Allombert. * doc/bison.texinfo: Set fill-column to 76. (Location Type): Document the use of %initial-action to initialize yylloc. +2009-08-19 Akim Demaille + + lalr1.cc: use state_type. + * data/lalr1.cc (yysyntax_error_): Use state_type. + Move argument names into yy*. + +2009-08-19 Akim Demaille + + lalr1.cc: get rid of yyparse's yystate. + yystate and yystack_[0].state are equal, keep only the latter. + The former was also used as a temporary variable to compute the + post-reduction state. Move this computation into an auxiliary + function. + + * data/glr.c (yyLRgotoState): Fuse variable definition and first + assignment. + * data/lalr1.cc (yy_lr_goto_state_): New. + (yyparse): Use it. + Replace remaining uses of yystate by yystate_[0].state. + Remove the former. + +2009-08-19 Akim Demaille + + lalr1.cc: destroy $$ when YYERROR is called. + * data/lalr1.cc (yyreduce): Compute the resulting state before + running the user action so that yylhs is a valid symbol. + (yyerrorlab): Since yylhs is complete (it knows its type), we can + simply call yy_destroy_ to destroy $$ on YYERROR invocations. + * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants. + 2009-08-18 Joel E. Denny maint: update for gnulib's recent update-copyright changes @@ -2202,13 +2480,78 @@ 2009-08-12 Akim Demaille + tests: GCC 4.5 compliance. + * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's + messages about #error. + +2009-08-12 Akim Demaille + + build: fix the generation of the documentation. + Some of our targets use "bison --help", but they can't depend on + "bison" itself (to avoid additional requirements on the user), so + they used to call "make src/bison" in the commands. Then + concurrent builds may fail: one make might be aiming one of its + jobs at compiling src/bison, and another job at generating the man + page. If the latter is faster than the former, then we have two + makes that concurrently try to compile src/bison. + + This might also be a more convincing explanation for the failure + described in the patch "build: fix paths". + + * Makefile.am (SUFFIXES): Initialize. + * build-aux/move-if-change: New, symlink to gnulib's. + * build-aux/local.mk: Ship it. + * doc/common.x: Remove, merged into... + * doc/bison.x: here. + * doc/local.mk (doc/bison.help): New. + ($(CROSS_OPTIONS_TEXI)): Depend on it. + Use src/bison. + (.x.1): Replace with... + (doc/bison.1): this explicit, simpler, target. + (common_dep): Remove, inlined where appropriate. + (SUFFIXES, PREPATH): Remove, unused. + +2009-08-12 Akim Demaille + + gnulib: improve prefixing. + * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather, + change the value of... + (gl_LIBOBJS): this. + Adjust more variables. + * etc/prefix-gnulib-mk (prefix_assignment): Don't rename + gl_LIBOBJS. + (prefix): Also transform rules whose targets have slashes. + Use $prefix liberally. + Map @MKDIR_P@ to $(MKDIR_P). + Prefix directories that are mkdir'd. + +2009-08-12 Akim Demaille + + build: fix paths. + When using $(top_builddir) inconsistently, Make (including GNU + Make) is sometimes confused. As a result it may want to build + lib/libbison.la and $(top_builddir)/lib/libbison.la (the same + file, different names) concurrently, which, amusingly enough, + might end with: + + ranlib lib/libbison.a + ranlib lib/libbison.a + make[2]: *** [lib/libbison.a] Segmentation fault + + on OS X. + + * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not + needed. + +2009-08-12 Akim Demaille + distcheck: fix. * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp. 2009-08-10 Joel E. Denny - * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at. + * tests/local.mk (TESTSUITE_AT): Add named-refs.at. 2009-08-10 Joel E. Denny @@ -2273,7 +2616,7 @@ maint: automate b4_copyright updates. * Makefile.am (update-b4-copyright): New target rule. - * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright. + * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright. * build-aux/update-b4-copyright: New. * data/yacc.c: Remove stray characters around b4_copyright invocations. @@ -2330,14 +2673,6 @@ * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length variable. -2009-07-24 Alex Rozenman - - Fix some memory leaks. - * src/named-ref.c: Add a pointer check (named_ref_free). - * src/scan-code.l: New function (variant_table_free). Called in - code_scanner_free. - * src/symlist.c: Call to named_ref_free (symbol_list_free). - 2009-07-24 Joel E. Denny Warn about character literals not of length one. @@ -2347,6 +2682,14 @@ (SC_ESCAPED_CHARACTER): Warn if length is wrong. * tests/input.at (Bad character literals): New test group. +2009-07-24 Alex Rozenman + + Fix some memory leaks. + * src/named-ref.c: Add a pointer check (named_ref_free). + * src/scan-code.l: New function (variant_table_free). Called in + code_scanner_free. + * src/symlist.c: Call to named_ref_free (symbol_list_free). + 2009-07-24 Joel E. Denny * src/lalr.c (state_lookahead_tokens_count): Correct comment. @@ -2371,10 +2714,6 @@ do not distinguish between a missing value and an empty string value. -2009-07-21 Joel E. Denny - - * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4. - 2009-07-15 Joel E. Denny Revert unnecessary column realignment in --help output. @@ -2384,8 +2723,8 @@ 2009-07-04 Alex Rozenman - Alphabetical order in src/Makefile.am. - * src/Makefile.am: Adjust. + Alphabetical order in src/local.mk. + * src/local.mk: Adjust. 2009-07-04 Alex Rozenman @@ -2415,6 +2754,35 @@ Not only this is inefficient, this also builds incorrect sources with several extractions mixed together. +2009-06-29 Akim Demaille + + parse.error: fix. + * data/bison.m4: Move code related to specific variables after the + definition of the variable-maintaining macros so that we don't + "invoke" b4_percent_define_check_values before it is defined. + +2009-06-29 Akim Demaille + + variables: parse.error + + Implement, document, and test the replacement of %error-verbose + by %define parse.error "verbose". + * data/bison.m4 (b4_error_verbose_if): Reimplement to track the + values of the parse.error variable. + Make "simple" its default value. + Check the valid values. + * src/parse-gram.y: Use %define parse.error. + (PERCENT_ERROR_VERBOSE): New token. + Support it. + * src/scan-gram.l: Support %error-verbose. + + * doc/bison.texinfo (Decl Summary): Replace the documentation of + %define error-verbose by that of %define parse.error. + * NEWS: Document it. + + * tests/actions.at, tests/calc.at: Use parse.error instead of + %error-verbose. + 2009-06-27 Alex Rozenman Implement support for named symbol references. @@ -2441,6 +2809,27 @@ hash: check insertion for memory exhaustion. * src/uniqstr.c (uniqstr_new): New. +2009-06-24 Akim Demaille + + variables: rename namespace as api.namespace. + Discussed in + http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html + + * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy): + New. + (b4_percent_define_use): New. + Use it where applicable. + * data/c++.m4: Replace uses of the variable "namespace" by + "api.namespace". + Default the latter to the former. + * doc/bison.texinfo (Decl Summary): Document "namespace" as + obsolete. + Document api.namespace. + Use @samp to document %define uses, keep @code for identifiers. + * NEWS: Likewise. + * tests/c++.at, tests/input.at: Test api.namespace instead of + namespace. (The tests passed with namespace.) + 2009-06-11 Akim Demaille style changes. @@ -2462,6 +2851,13 @@ * src/state.c (state_hash_insert): Check the return value of hash_insert. +2009-06-11 Akim Demaille + + tests: honor TESTSUITEFLAGS in every check target. + * tests/local.mk (RUN_TESTSUITE): New. + (check-local, installcheck-local, maintainer-check-g++) + (maintainer-check-posix, maintainer-check-valgrind): Use it. + 2009-06-10 Akim Demaille deterministic test suite. @@ -2480,6 +2876,17 @@ 2009-06-10 Akim Demaille + gnulib: update. + * gnulib: Update to latest. + * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, + * m4/.gitignore: Regen. + * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr): + Call xalloc_die on hash_insert failures. + Requested by the new __warn_unused_result__ attribute of + hash_insert. + +2009-06-10 Akim Demaille + deterministic user-token-number redeclaration errors. Address nondeterminism reported by Joel E. Denny. http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html @@ -2492,14 +2899,9 @@ 2009-05-25 Akim Demaille - gnulib: update. - * gnulib: Update to latest. - * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, - * m4/.gitignore: Regen. - * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr): - Call xalloc_die on hash_insert failures. - Requested by the new __warn_unused_result__ attribute of - hash_insert. + build: avoid ignored errors. + * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored + errors, they pollute the output. 2009-05-22 Joel E. Denny @@ -2507,8 +2909,8 @@ * NEWS (2.5): Add a new entry for that change. * doc/bison.texinfo (Decl Summary): Update %define entry. (Bison Options): Update -D/--define/-F/--force-define entry. - * src/muscle_tab.c (muscle_percent_define_insert): Implement. - * src/muscle_tab.h (muscle_percent_define_insert): Update + * src/muscle-tab.c (muscle_percent_define_insert): Implement. + * src/muscle-tab.h (muscle_percent_define_insert): Update comments. * tests/input.at (`%define errors'): Update. (`%define, --define, --force-define'): Update. @@ -2526,11 +2928,13 @@ * src/getargs.c (usage): Document -F/--force-define. Realign options in output. (short_options, long_options, getargs): Parse -F/--force-define, - and update muscle_percent_define_insert invocation. - * src/muscle_tab.h (muscle_percent_define_how): New enum type. + and update muscle_percent_define_insert invocations. + * src/muscle-tab.h (muscle_percent_define_how): New enum type. (muscle_percent_define_insert): Add argument with that type. - * src/muscle_tab.c (muscle_percent_define_insert): Implement + * src/muscle-tab.c (muscle_percent_define_insert): Implement -F/--force-define behavior and priorities. + (muscle_percent_define_ensure): Update + muscle_percent_define_insert invocation. * src/parse-gram.y (prologue_declaration): Update muscle_percent_define_insert invocations. * tests/input.at (`%define, --define'): Rename to... @@ -2541,13 +2945,9 @@ Update some comments to make sense for -D. * data/bison.m4 (b4_check_user_names): In header comments, say "user occurrence" instead of "grammar occurrence". - * src/muscle_tab.h (muscle_percent_define_insert): Likewise. + * src/muscle-tab.h (muscle_percent_define_insert): Likewise. (muscle_percent_code_grow): Likewise just for consistency. -2009-05-22 Joel E. Denny - - * data/c++.m4: Update copyright year. - 2009-05-20 Joel E. Denny * data/c++.m4 (b4_namespace_close): Simplify slightly. @@ -2566,21 +2966,34 @@ * src/getargs.c (skeleton_arg): Remove now useless variable. Should help the compiler see that this printf-like call is sane. +2009-05-15 Akim Demaille + + Rename token.prefix as api.tokens.prefix. + Discussed here. + http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html. + + * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo, + * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at + (token.prefix): Rename as... + (api.tokens.prefix): this. + 2009-05-11 Akim Demaille doc: use C++ headers. * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C headers. -2009-05-05 Akim Demaille - - fix hexadecimal token number support. - * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers. - -2009-05-05 Akim Demaille +2009-05-11 Akim Demaille - tests: check token numbers. - * tests/input.at (Numbered tokens): New. + doc: token.prefix + * doc/bison.simple (Decl Summary): Document token.prefix. + (Calc++ Parser): Various fixes. + Formatting changes. + Use token.prefix. + Introduce a macro TOKEN to shorten the code and make it more + readable. + (Calc++ Scanner): Adjust. + * NEWS (Variable token.prefix): New. 2009-05-04 Akim Demaille @@ -2590,11 +3003,6 @@ 2009-05-04 Akim Demaille - space changes. - * src/scan-gram.l: Untabify to be robust to zealous editors. - -2009-05-04 Akim Demaille - identifiers: dashes are letters. Dashes can now start identifiers (symbols and directives). @@ -2622,7 +3030,7 @@ * data/c.m4 (b4_identification): Update comment. * data/yacc.c: Update access. * doc/bison.texinfo: Update. - * etc/bench.pl.in (bench_grammar): Update use. + * etc/bench.pl.in (bench_push_parser): Update use. * src/files.c (tr): Move to... * src/getargs.c, src/getargs.h (tr): ... here because I can't think of a better place to expose it. My logic is that, for all @@ -2664,38 +3072,11 @@ Pacify ./configure --enable-gcc-warnings. * tests/input.at (Symbols): Prototype yyerror and yylex. -2009-04-21 Akim Demaille - - tests: check the use of dashes and periods in symbols. - * tests/input.at (Symbol): New test group. - 2009-04-29 Joel E. Denny Document how `%define "var" "value"' is not M4-friendly. * src/parse-gram.y (variable): In comments here. -2009-04-29 Joel E. Denny - - Add copyright updates missed during previous cherry pick. - * src/output.c: Here. - * src/parse-gram.y: Here. - * src/scan-gram.l: Here. - -2009-04-20 Akim Demaille - - variables: accept dashes. - * src/scan-gram.l ({id}): Also accept dashes after the initial - letter. - ({directive}): Use {id}. - * src/parse-gram.y: Comment and formatting changes. - * doc/bison.texinfo (Symbols): Adjust the lexical definitions of - symbols. - * src/complain.h, src/complain.c (yacc_at): New. - * src/symtab.c (symbol_new): Use yacc_at to report inappropriate - symbol names. - * src/output.c (token_definitions_output): Do not #define token - names with dashes. - 2009-04-24 Joel E. Denny Clean up recent patches a little. @@ -2709,7 +3090,7 @@ Suggested by Akim Demaille at . * data/bison.m4 (_b4_percent_define_check_values): Implement. - * src/muscle_tab.c (muscle_percent_define_check_values): Implement. + * src/muscle-tab.c (muscle_percent_define_check_values): Implement. * tests/input.at (%define lr.default_reductions invalid values): Merge into... (%define enum variables): ... here, and update output. @@ -2721,8 +3102,9 @@ comments, and renaming %define lr.default_rules to %define lr.default_reductions. * NEWS (2.5): Update IELR documentation. - * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: - Adjust YYDEFACT and yydefact_ documentation. + * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT + documentation. + * data/glr.c, data/lalr1.java: Sync copyright dates. * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions and lr.type documentation. Make some other wording improvements. @@ -2744,6 +3126,11 @@ * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to... (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update. +2009-04-21 Akim Demaille + + tests: check the use of dashes and periods in symbols. + * tests/input.at (Symbol): New test group. + 2009-04-21 Joel E. Denny Document %define lr.type and lr.default_rules. @@ -2875,6 +3262,45 @@ 2009-04-20 Akim Demaille + Formatting change. + +2009-04-20 Akim Demaille + + bison: factoring. + * src/output.c (token_definitions_output): Use symbol_id_get + instead of duplicating its logic. + * TODO (YYERRCODE): Extend. + +2009-04-20 Akim Demaille + + variables: prefer error-verbose to error_verbose. + * data/bison.m4 (b4_error_verbose_if): Based on error-verbose + instead of error_verbose. + * src/scan-gram.l (%error-verbose): Map to the error-verbose + variable. + * doc/bison.texinfo: Promote %define error-verbose instead of + %error-verbose. + * tests/actions.at: Prefer %define error-verbose to %error-verbose. + +2009-04-15 Akim Demaille + + variables: accept dashes. + * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to + underscores. + * src/scan-gram.l ({id}): Also accept dashes after the initial + letter. + ({directive}): Use {id}. + * src/parse-gram.y: Comment and formatting changes. + * doc/bison.texinfo (Symbols): Adjust the lexical definitions of + symbols. + * src/complain.h, src/complain.c (yacc_at): New. + * src/symtab.c (symbol_new): Use yacc_at to report inappropriate + symbol names. + * src/output.c (token_definitions_output): Do not #define token + names with dashes. + +2009-04-20 Akim Demaille + Consistently refer to Yacc, not YACC. * src/getargs.c (usage, warnings_args): s/YACC/Yacc/. @@ -2889,30 +3315,31 @@ Document semicolon warnings. * NEWS (2.5): Here. -2008-12-08 Akim Demaille +2009-04-14 Akim Demaille - Fix portability issue in the test suite. - * tests/local.at (AT_MATCHES_CHECK): New. - Based on Perl instead of Sed. Sed has too many portability - pitfalls, not ever Sed is GNU Sed. - * tests/actions.at (Fix user actions without a trailing semicolon): - Use it. + variables: use `parse.assert' instead of `assert'. + * TODO (assert): Remove. + * data/bison.m4 (b4_assert_if): Replace with... + (b4_parse_assert_if): this. + * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust. + * doc/bison.texinfo (Decl Summary): Document parse.assert. -2008-12-07 Di-an Jan +2009-04-14 Akim Demaille - Implement the FIXME that ends an user action with a semicolon - if it seems necessary. - * src/scan-code.l (flex rules section): Flag cpp directive from - any `#' to the first unescaped end-of-line. Semicolon is not - needed after `;', `{', '}', or cpp directives and is needed after - any other token (whitespaces and comments have no effect). - * tests/actions.at (Fix user actions without a trailing semicolon): - New test. - * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to - to make user actions complete statements. - Adjust column numbers in error messages. - * tests/regression.at (Fix user actions without a trailing semicolon): - Remove. Covered by new test. + variables: use `parse.trace' instead of `debug'. + * src/getargs.c (getargs): Map -t to %define trace.parse. + * src/scan-gram.l (%debug): Map to %define trace.parse. + * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable + names to `_' in macro names. + (b4_debug_if): Replace with... + (b4_parse_trace_if): this. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, + * data/yacc.c: Adjust. + * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted. + Use @code to label the variable list. + Document the variable parse.trace. + (Tracing): Promote the parse.trace variable. + * TODO: %printer is not documented. 2009-04-14 Akim Demaille @@ -2933,161 +3360,131 @@ 2009-04-06 Joel E. Denny - * NEWS (2.5): Describe new -D/--define feature. - -2008-11-10 Akim Demaille - - --trace=muscles - * src/getargs.h, src/getargs.c (trace_muscle): New. - (trace_types, trace_args): Support it. - * src/output.c (output_skeleton): Use it. + * NEWS (2.5): New section. Describe new -D/--define feature. -2008-11-10 Akim Demaille +2009-04-06 Akim Demaille - muscles_output. - * src/output.c (muscles_output): New, extracted from... - (output_skeleton): here. - Adjust. + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. -2008-11-21 Akim Demaille +2009-04-06 Akim Demaille - Display the changes in cross-options.texi. - * build-aux/cross-options.pl ($sep): New, to separate items. - * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display - the changes. + rename muscle_tab.* as muscle-tab.* for consistency. + * src/muscle_tab.h, src/muscle_tab.c: Rename as... + * src/muscle-tab.h, src/muscle-tab.c: these. + * src/getargs.c, src/local.mk, src/main.c, src/output.c, + * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust. -2008-11-20 Di-an Jan +2009-04-06 Akim Demaille - Improves options in the manual. - * doc/bison.texinfo (-g, -x): Add space before argument. - (Option Cross Key): Implement FIXME: listing directives also. - * build-aux/cross-options.pl: Read from rather than <>. - (Short Option): Special case -d. Put arguments inside @option. - (Bison Directive): Add column, automatically extracted from - src/scan-gram.l (actual name passed as the first argument) - with special case for %define. - * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l - to build-aux/cross-options.pl. - * src/getargs.c (usage): Document limitations of cross-options.pl. - * src/scan-gram.l: Likewise. + Makefile: introduce $(BISON). + * src/local.mk (BISON): New. + (YACC): Use it. -2009-02-25 Akim Demaille +2009-04-06 Akim Demaille - Copyright years. - * data/glr.c: Add 2007 and 2008 here, consistenly with the comments. + parser: handle %locations as %define locations. + * src/getargs.h, src/getargs.c (locations_flag): Remove. + * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure + to set "locations" to true. + * src/output.c (prepare): Don't output "locations". + * src/scan-gram.l (%locations): Handle it as a %. + * src/parse-gram.y: It's no longer a token. + Don't handle it. + * data/bison.m4 (b4_locations_if): Define it with + b4_percent_define_if_define. + * data/c.m4, data/glr.cc: Adjust. -2008-12-08 Akim Demaille +2009-04-06 Akim Demaille - Install autoconf as a submodule to get m4sugar. - * .gitmodules: Add submodules/autoconf. - * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into - submodules/autoconf. + Regen. + * src/parse-gram.c: Regen. -2008-11-17 Joel E. Denny +2009-04-06 Akim Demaille - Simplify last patch slightly. - * src/getargs.c (getargs): Here. + muscle: factor the handling of obsolete of obsolete directives. + Suggested by Joel E. Denny. -2008-11-17 Joel E. Denny + * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure): + New, extracted from... + * src/parse-gram.y (prologue_declaration: pure-parser): here. + Remove it. + (prologue_declaration: "%"): Use + muscle_percent_define_ensure. + (%error-verbose, %pure-parser): No longer tokens. + * src/scan-gram.l (pure-parser): Return as a %. - Fix last warning from --enable-gcc-warnings. - * src/getargs.c (getargs): Don't assign const address to non-const - pointer. +2009-04-06 Joel E. Denny -2008-11-17 Di-an Jan + Fix options documentation. + * build-aux/cross-options.pl: As in --help output, write optional + arguments as [=ARG] not =[ARG]. + * doc/bison.texinfo (Bison Options): Add -W/--warnings argument. - Handle --enable-gcc-warnings. - * src/getargs.c (command_line_location): Set parameters to void. +2009-04-04 Joel E. Denny -2008-11-11 Akim Demaille + Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4. + If the first m4 in $PATH is wrong, it keeps looking. Moreover, its + requirements for a correct m4 are stricter. + * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4. + * configure.ac: Update to use AC_PROG_GNU_M4. + Reported by Eric Blake. - AT_FULL_COMPILE. - * tests/actions.at, tests/regression.at: Use it. +2009-04-03 Joel E. Denny -2008-11-07 Akim Demaille + Help with updating web manual. + * HACKING: Incorporate instructions from gnulib/doc/README. + * bootstrap.conf (gnulib_modules): Add gendocs. - Pass command line location to skeleton_arg and language_argmatch. - * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch): - The location argument is now mandatory. - Adjust all dependencies. - (getargs): Use command_line_location. +2009-04-03 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2009-04-03 Akim Demaille + + Factor %FLAG at scan level. + * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token + definitions and associated rules, replaced by.... + (PERCENT_FLAG): this new token type, and rule. + * src/scan-gram.l (RETURN_PERCENT_FLAG): New. + Use it for %debug and %error-verbose. + +2009-04-03 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2009-04-03 Akim Demaille + + Treat %debug as %define debug. + * data/bison.m4 (b4_debug_if): New. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c, + * data/lalr1.java: Use it instead of b4_debug_flag. + * src/getargs.h, src/getargs.c (debug_flag): Remove. + * src/output.c (prepare): Don't output it. + * src/parse-gram.y: Treat %debug as %define debug. + +2009-04-03 Akim Demaille + + Treat %error-verbose as %define error_verbose. + This allows to pass -Derror_verbose on the command line. Better + yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with + ERROR_VERBOSE being defined as false or true. + * data/bison.m4 (b4_percent_define_if_define): Instead of relying + on b4_percent_define_ifdef, for does not check the defined value, + but only whether the symbol is defined, rely on + b4_percent_define_flag_if, so that a value of "false" is processed + as a false. + If not defined, define the flag to "false". + (b4_error_verbose_if): New. + * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of + b4_error_verbose_flag. + * src/getargs.h, src/getargs.c (error_verbose_flag): Remove. + * src/output.c (prepare): Don't output it. + * src/parse-gram.y (%error-verbose): Treat as %define error_verbose. -2008-11-07 Akim Demaille - - -D, --define. - * src/getargs.c (usage): Document -D. - Fix help string for --locations. - (command_line_location): New. - (short_options, long_options, getargs): Support -D, --define. - (getargs): Move -d support at the right place. - * doc/bison.texinfo (Bison Options): Update. - * tests/input.at (%define, --define): New. - -2008-11-07 Akim Demaille - - Initialize the muscle table before parsing the command line. - * src/getargs.c (quotearg.h, muscle_tab.h): Include. - (getargs): Define file_name. - * src/main.c (main): Initialize muscle_tab before calling - getargs. - * src/muscle_tab.c (muscle_init): No longer define file_name, as - its value is not available yet. - -2008-11-09 Akim Demaille - - Require the generation of parse-gram.output. - * src/Makefile.am (YACC): Pass --report=all. - -2009-04-06 Joel E. Denny - - * NEWS (2.5): New stub. - -2009-04-06 Joel E. Denny - - Fix options documentation. - * build-aux/cross-options.pl: As in --help output, write optional - arguments as [=ARG] not =[ARG]. - * doc/bison.texinfo (Bison Options): Add -W/--warnings argument. - -2008-11-07 Akim Demaille - - Fix --help. - * src/getargs.c (usage): Fix help string for -W. - -2008-11-07 Akim Demaille - - Handle more general types of option arguments. - * build-aux/cross-options.pl: The argument ends at the first - space, not the first non-symbol character. - Use @var for each word appearing the argument description. - -2009-04-04 Joel E. Denny - - Remove spurious initial empty lines. - * data/location.cc: End the @output lines with an @. - -2008-11-04 Akim Demaille - - Remove spurious initial empty lines. - * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, - * data/yacc.c: End the @output lines with an @. - -2009-04-04 Joel E. Denny - - Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4. - If the first m4 in $PATH is wrong, it keeps looking. Moreover, its - requirements for a correct m4 are stricter. - * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4. - * configure.ac: Update to use AC_PROG_GNU_M4. - Reported by Eric Blake. - -2009-04-03 Joel E. Denny - - Help with updating web manual. - * HACKING: Incorporate instructions from gnulib/doc/README. - * bootstrap.conf (gnulib_modules): Add gendocs. - -2009-04-03 Joel E. Denny +2009-04-03 Joel E. Denny Fix strange %define locations for default values. Reported by Akim Demaille at @@ -3106,16 +3503,12 @@ * tests/skeletons.at (%define Boolean variables: invalid skeleton defaults): Update output. -2008-11-07 Akim Demaille - - Locations without columns for command line arguments. - * src/location.c (location_print): Don't display negative columns. - * src/location.h: Document this. - -2009-02-03 Joel E. Denny +2009-04-03 Joel E. Denny - Add reminder about uploading public key to keys.gnupg.net. - * HACKING (Release Procedure): Here. + Pacify ./configure --enable-gcc-warnings. + * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files + in lib won't compile with it. + * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only. 2009-03-31 Akim Demaille @@ -3158,8 +3551,201 @@ gnulib: update. * gnulib: Update to latest. - * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so - use +=. + * src/local.mk (AM_CFLAGS): Move to... + * Makefile.am: here. + * etc/prefix-gnulib-mk (prefix_assignment): Also transform + AM_CFLAGS. + +2009-03-02 Akim Demaille + + Comment changes. + +2009-03-02 Akim Demaille + + Share b4_yytranslate_define. + * data/lalr1.cc (b4_yytranslate_define): Move to... + * data/c++.m4: here. + +2009-03-02 Akim Demaille + + Use locations in the variant example. + Yes, this obfuscates the point of this example, variants only. + But glr.cc cannot work (yet?) without locations. This change + makes it easier to use this example with glr.cc. + + * examples/variant.yy (assert): %define it. + (locations): Request them. + (yylex): Bind the location to the stage. + +2009-03-02 Akim Demaille + + Dub make_TOKEN as a public type interface. + * data/c++.m4 (b4_symbol_constructor_declare) + (b4_symbol_constructor_define): New empty stubs. + (b4_public_types_declare, b4_public_types_define): Use them. + * data/lalr1.cc (b4_symbol_constructor_declare) + (b4_symbol_constructor_declare_) + (b4_symbol_constructor_define_, b4_symbol_constructor_define): + Move to... + * data/variant.hh: here. + Remove the "b4_variant_if" parts, as variant.hh is loaded only if + needed. + * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and + b4_symbol_constructor_declare, as it is now done by + b4_public_types_define and b4_public_types_declare. + +2009-03-02 Akim Demaille + + Coding style changes. + * data/lalr1.cc (b4_symbol_constructor_declaration_) + (b4_symbol_constructor_declarations) + (b4_symbol_constructor_definition_) + (b4_symbol_constructor_definitions) + (b4_yytranslate_definition): Rename as... + (b4_symbol_constructor_declare_) + (b4_symbol_constructor_declare) + (b4_symbol_constructor_define_) + (b4_symbol_constructor_define) + (b4_yytranslate_define): these. + * data/variant.hh (b4_variant_definition): Rename as... + (b4_variant_define): this. + +2009-03-02 Akim Demaille + + Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if. + * data/bison.m4 (b4_percent_define_if_define): New. + * data/c++.m4 (b4_variant_if): Move to... + * data/bison.m4: Here, using b4_percent_define_if_define. + * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to... + * data/bison.m4: Here, using b4_percent_define_if_define. + +2009-03-02 Akim Demaille + + Dub symbol_type_base as a public type. + * data/c++.m4 (b4_public_types_declare): Now define + symbol_type_base and symbol_type. + (b4_public_types_define): New. + In both cases, the definitions are taken verbatim from lalr1.cc. + * data/lalr1.cc: Adjust. + +2009-03-02 Akim Demaille + + b4_public_types_declare. + * data/c++.m4 (b4_public_types_declare): New. + * data/glr.cc, data/lalr1.cc: Use it. + +2009-03-02 Akim Demaille + + b4_semantic_type_declare. + * data/c++.m4 (b4_semantic_type_declare): New. + Factors and generalizes what was in glr.cc and lalr1.cc. + * data/variant.hh (b4_semantic_type_declare): Redefine it for + variants. + * data/lalr1.cc, data/glr.cc: Use it. + +2009-02-26 Akim Demaille + + Upgrade gnulib. + * gnulib: Upgrade from master. + * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore: + Regen. + +2009-02-25 Akim Demaille + + Remove useless arguments. + * data/glr.c (yy_reduce_print): $$ and @$ are not used and not + relevant. + +2009-02-25 Akim Demaille + + Comment changes. + * data/lalr1.cc: here. + +2009-02-25 Akim Demaille + + Fix glr.cc's debug level handling. + * data/glr.cc (yydebug_): Remove, as it is actually yydebug from + glr.c which is used. + (debug_level, set_debug_level): Adjust. + +2009-02-25 Akim Demaille + + Copyright years. + * data/glr.c: Add 2007 and 2008 here, consistenly with the comments. + +2009-02-25 Akim Demaille + + Style changes. + * etc/bench.pl.in (generate_grammar_list): Consitently use + location_type, not yy::location. + +2009-02-25 Akim Demaille + + Comment change. + * data/lalr1.cc: here. + +2009-02-19 Akim Demaille + + Make yyparser::error public. + * data/lalr1.cc: here. + There is no good reason to keep it private (and it is convenient + to use it from the scanner for instance). It is already public in + glr.cc. + +2009-02-19 Akim Demaille + + Comment changes. + * data/glr.cc: here. + +2009-02-19 Akim Demaille + + Remove trailing blanks. + The epilogue has its own ending \n, no need to add another. + + * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the + epilogue. + * data/glr.cc: dnl when extending the epilogue. + Remove stray "private:". + +2009-02-19 Akim Demaille + + Use b4_c_modern. + * data/c.m4 (b4_c_function_decl): Here. + +2009-02-19 Akim Demaille + + Comment changes. + * data/lalr1.cc: here. + +2009-02-19 Akim Demaille + + Extract variant.hh + * data/variant.hh: New, extracted from... + * data/lalr1.cc: here. + Adjust. + * data/local.mk: Adjust. + +2009-02-19 Akim Demaille + + Extract stack.hh from lalr1.cc. + * data/stack.hh: New. + * data/lalr1.cc: Extract from here. + * data/local.mk: Adjust. + +2009-02-03 Joel E. Denny + + Add reminder about uploading public key to keys.gnupg.net. + * HACKING (Release Procedure): Here. + +2009-01-28 Akim Demaille + + * NEWS: Update information about 2.4.1 and 2.4.2. + +2008-11-04 Akim Demaille + + Reformat NEWS. + * NEWS: Use more outline-mode markup. + Suggested by Jim Meyering. 2009-01-08 Akim Demaille @@ -3175,30 +3761,110 @@ * tests/java.at: Use $EGREP instead of egrep. Use AT_CHECK's ignore instead of grep's -q. -2008-12-11 Joel E. Denny +2008-12-11 Akim Demaille + + Pass the token type to yysyntax_error. + * data/yacc.c (yysyntax_error): Take the transated token instead + of the raw number. + Adjust callers. + * TODO: Update. - Version 2.4.1. - * NEWS: Set version and date. - * lib/Makefile.am: Update copyright year. - * tests/atlocal.in: Update copyright year. +2008-12-11 Akim Demaille -2008-12-11 Joel E. Denny + Formatting changes. + * data/glr.c: Formatting changes. - Semicolon feature removal is not about future language support. - * NEWS: The semicolon feature is no longer active for newer languages, - so don't claim that it causes trouble for them. +2008-12-11 Akim Demaille -2008-12-11 Joel E. Denny + Propagate i18n changes into glr.c. + * TODO: Update. + * data/glr.c (yyreportSyntaxError): Use "switch" instead of + building the error message format dynamically. + * data/lalr1.java: Formatting changes. - * gnulib: Update submodule to HEAD. +2008-12-11 Akim Demaille -2008-12-09 Akim Demaille + Use testsuite -C. + * tests/local.mk: Replace "cd && testsuite" by "testsuite -C". + Solves problems when top_srcdir is an absolute path. + Suggested by Eric Blake. + * configure.ac: Require Autoconf 2.62. + +2008-12-11 Akim Demaille + + Simplify the i18n of the error messages. + * data/lalr1.cc: Comment changes. + * data/yacc.c (yysyntax_error): Rewrite, using a switch as in + lalr1.cc instead of building dynamically the format string. + +2008-12-08 Akim Demaille + + Fix portability issue in the test suite. + * tests/local.at (AT_MATCHES_CHECK): New. + Based on Perl instead of Sed. Sed has too many portability + pitfalls, not ever Sed is GNU Sed. + * tests/actions.at (Fix user actions without a trailing semicolon): + Use it. + +2008-12-08 Akim Demaille Update data/README. * data/README: Document glr.cc, lalr1.java, m4sugar and xslt. +2008-12-08 Akim Demaille + + Install autoconf as a submodule to get m4sugar. + * .gitmodules: Add submodules/autoconf. + * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into + submodules/autoconf. + +2008-12-08 Akim Demaille + + Test token.prefix in all the skeletons. + * data/java.m4 (b4_token_enum): Use the token.prefix. + * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX. + * tests/calc.at (_AT_DATA_CALC_Y): Use it. + Add checks for yacc.c, glr.c, lalr1.cc and glr.cc. + * tests/java.at: Comment changes. + (AT_CHECK_JAVA_MINIMAL): Define the END token. + (Java parser class and package names): Add token.prefix check. + +2008-12-08 Akim Demaille + + Fix regeneration of atconfig. + * tests/local.mk (tests/atconfig): The rule was incorrect, but + remove it: now that there is no tests/Makefile.am, the top-level + Makefile properly updates atconfig when needed. + +2008-12-07 Di-an Jan + + Implement the FIXME that ends an user action with a semicolon + if it seems necessary. + * src/scan-code.l (flex rules section): Flag cpp directive from + any `#' to the first unescaped end-of-line. Semicolon is not + needed after `;', `{', '}', or cpp directives and is needed after + any other token (whitespaces and comments have no effect). + * tests/actions.at (Fix user actions without a trailing semicolon): + New test. + * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to + to make user actions complete statements. + Adjust column numbers in error messages. + * tests/regression.at (Fix user actions without a trailing semicolon): + Remove. Covered by new test. + +2008-12-07 Akim Demaille + + Update gnulib. + * gnulib: Update from master. + 2008-12-05 Eric Blake + Avoid compiler warning. + * src/output.c (muscle_insert_item_number_table): Delete unused + function. + +2008-12-02 Eric Blake + Build testsuite with newer autoconf. * tests/output.at (m4_expand): Don't override in newer autoconf, where the underlying implementation changed. @@ -3208,69 +3874,1383 @@ (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings, since some of them contain unbalanced ')'. -2008-11-19 Joel E. Denny +2008-12-01 Akim Demaille - * NEWS: Clarify a little. + Use b4_symbol for printers and destructors everywhere. + * data/bison.m4 (b4_symbol_action_location): New. + * data/c.m4 (b4_symbol_actions): Remove. + Adjust all callers to use by b4_symbol_foreach and the corresponding + b4_symbol_printer/destructor macro. + * data/glr.cc: Adjust. + * data/lalr1.java: Adjust the %destructor sanity check. + * src/output.c (symbol_code_props_output): Remove, we no longer + need the b4_symbol_printers/destructors tables. -2008-11-19 Joel E. Denny +2008-12-01 Akim Demaille - * NEWS: Update for recent changes. + Use b4_symbol_case_. + * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use + b4_symbol_case_. -2008-11-18 Joel E. Denny +2008-12-01 Akim Demaille - Fix unexpanded macros in GLR defines file. - Reported by Csaba Raduly at - . - * THANKS (Csaba Raduly): Add. - * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc. - * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate - lexer in a separate module that includes the defines file. - (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer - source. - * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF. - Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX. - (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF. - (AT_DATA_SOURCE_PROLOGUE): New. - (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE. - (AT_DATA_SOURCE): New. - (AT_FULL_COMPILE): New, copied from master branch and extended to - support an additional source file. + Move b4_symbol based macro to bison.m4. + * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if) + (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer) + (b4_symbol_case_, b4_symbol_foreach, b4_type_action_) + (b4_type_foreach): Move to... + * data/bison.m4: Here. + * data/lalr1.cc (b4_symbol_action): Specialize for C++: use + b4_symbol_value_template instead of b4_symbol_value. -2008-11-17 Joel E. Denny +2008-12-01 Akim Demaille - Don't let maintainer-*-check targets force a version update. - * cfg.mk (_is-dist-target): Implement. maintainer-check* was already - handled. + b4_symbol/type_foreach. + * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New. + Use them. -2008-11-17 Di-an Jan +2008-12-01 Akim Demaille + + Use the symbol properties to output the printer/destructor for lalr1.cc. + Instead of defining complex list of tuples to define various + properties of the symbols, we now prefer to define symbols as + "structs" in m4: using the symbol key (its number), and the + property name, b4_symbol gives it value. Use this to handle + destructors and printers. + + * src/output.c (CODE_PROP): New. + (prepare_symbol_definitions): Use it to define the printer and + destructor related attributes of the symbols. + * data/lalr1.cc (b4_symbol_actions): Rename as... + (b4_symbol_action): this. + Use b4_symbol instead of 6 arguments. + (b4_symbol_printer, b4_symbol_destructor): New. + Use them instead of b4_symbol_actions. + +2008-12-01 Akim Demaille + + Avoid capturing variables too easily. + * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use + v__ and p__ instead of v and p. + +2008-12-01 Akim Demaille + + Remove spurious empty line before syncline. + * data/bison.m4 (b4_syncline): Don't output an empty line before + the output. + +2008-11-26 Akim Demaille + + Convert lib/Makefile.am into lib/local.mk. + The real problem is rather gnulib.mk, which itself is extracted + from a Makefile.am that gnulib expects to the "recursive". The + tool prefix-gnulib-mk converts such a gnulib.mk to be + non-recursive. Also, some AC_SUBST variables need to be adjusted. + + * etc/prefix-gnulib-mk: New. + * bootstrap (slurp): Use it to convert further gnulib.mk. + No longer try to avoid re-creation of lib/gnulib.mk as the changes + are deeper. + * lib/Makefile.am: Rename as... + * lib/local.mk: this. + Adjust to be prefixed. + * Makefile.am, configure.ac: Adjust. + * src/local.mk (AM_CPPFLAGS): Extend it, don't define it. + +2008-11-26 Akim Demaille + + s/_FLAGS/FLAGS/. + * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as... + (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS. + Reported by Eric Blake. - * doc/bison.texinfo: Synchronize ``Detail Node Listing''. - Align menus. Adjust word wrapping. Use node names for menu names. - (Examples): Don't abbreviate node names. - (LocalWords): Remove abbreviations. - (Copying): Make description a sentence. - (Java Action Features): Remove period to match the rest of menu. +2008-11-26 Akim Demaille + + Use b4_parser_tables_define in glr.cc. + * data/glr.c: Use b4_parser_tables_define instead of defining the + (deterministic integral) tables by hand. + +2008-11-26 Akim Demaille + + Use b4_parser_tables_define in Java. + * data/java.m4 (b4_typed_parser_table): Rename as... + (b4_typed_parser_table_define): this, for consistency. + Accept a comment as $4. + Move $2 into yy*_. + (b4_integral_parser_table): Rename as... + (b4_integral_parser_table_define): this. + * data/lalr1.java: Adjust all uses. + Use b4_parser_tables_define instead of generation by hand. + +2008-11-26 Akim Demaille + + Prepare the convergence bw C style and Java table generation. + * data/bison.m4 (b4_tables_map, b4_tables_declare) + (b4_tables_define): Rename as... + (b4_integral_parser_tables_map, b4_parser_tables_declare) + (b4_parser_tables_define): these. + * data/c.m4 (b4_table_define): Rename as... + (b4_integral_parser_table_define): this. + * data/lalr1.cc: Adjust. + (b4_table_define, b4_table_declare): Rename as... + (b4_integral_parser_table_define) + (b4_integral_parser_table_declare): these. + (yyrline_): Move the comment where it is actually used. + * data/yacc.c: Adjust. + (yyrline): Use b4_integral_parser_table_define. + +2008-11-26 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2008-11-26 Akim Demaille + + Factor the generation of the (integral) tables bw yacc.c and lalr1.cc. + * data/lalr1.cc (b4_tables_map): Move to... + * data/bison.m4: here. + Update the comment for yytable during the flight. + (b4_tables_declare, b4_tables_define): New. + * data/lalr1.cc: Use them. + * data/c.m4 (b4_table_define): New. + * data/yacc.c: Use b4_tables_define instead of output the tables + by hand. + * tests/regression.at (Web2c Actions): Adjust the expected output, + the order of the tables changed. + +2008-11-26 Akim Demaille + + Get rid of (yy)rhs and (yy)prhs. + These tables are no longer needed in the parsers, and they don't seem to + be useful. They are not documented either. + + * src/output.c (prepare_rules): Get rid of rhs and prhs. + Adjust the computation of (yy)r2. + +2008-11-26 Akim Demaille + + Rule length is unsigned. + * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t. + +2008-11-26 Akim Demaille + + Get rid of lalr1-split.cc. + It was no longer maintainer. + + * data/lalr1-split.cc: Remove. + * etc/bench.pl.in (bench_fusion_parser): Remove. + Adjust. -2008-11-11 Paolo Bonzini +2008-11-26 Akim Demaille - * bootstrap.conf: Replace m4/warning.m4 with warnings module. - * configure.ac: Adjust usage. - * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS). - * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS). - * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS). + Use yy* consistently. + * data/glr.c: Now that yyrhs no longer exists as a global + variable, rename local "rhs" variables into "yyrhs" for + consistency. -2008-11-07 Joel E. Denny +2008-11-25 Akim Demaille - Don't add a semicolon to actions for %skeleton or %language. - It breaks Java test cases as reported by Akim Demaille. - * src/scan-code.l: Implement. + Get rid of yyrhs and yyprhs in glr.c. + * data/glr.c (yyrhs, yyprhs): Remove. + Instead, use the state stack and yystos. -2008-11-07 Joel E. Denny +2008-11-25 Akim Demaille - Clean up %skeleton and %language priority implementation. - * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and - remove static qualifier because others will soon need to see it. - (language_prio): Likewise. + Flag glr tests. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it + as an Autotest keyword. + +2008-11-25 Akim Demaille + + Prefer TESTSUITE_FLAGS. + TESTSUITEFLAGS is barely readable. + + * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS) + for backward compatibility. + Use the former instead of the latter. + +2008-11-25 Akim Demaille + + Get rid of yyrhs and yyprhs in larl1.java. + * data/lalr1.java (yyrhs_, yyprhs_): Remove. + (yy_reduce_print): Rather, use yystos_ and the state stack. + +2008-11-25 Akim Demaille + + Formatting changes. + +2008-11-25 Akim Demaille + + Get rid of yyrhs and yyprhs in yacc.c. + They were used to get the symbol types, given a rule number, when + displaying the top of the stack before a reduction. But the + symbol type is available from the state stack. This has two be + benefits: two tables less in the parser (making it smaller), and a + more consistent use of the three stacks which will help to fuse + them. + + * data/yacc.c (yyprhs, yyrhs): Remove. + (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print. + (yy_reduce_print): Take yyssp as argument. + Use it, together with yystos, to get the symbol type. + * tests/regression.at (Web2c Report): Remove these tables from the + expected output. + +2008-11-25 Akim Demaille + + b4_tables_map. + The point is to factor the generation of the tables across skeletons. + This is language dependant. + + * data/c.m4 (b4_comment_): New. + Should be usable to define how to generate tables independently of + the language. + (b4_c_comment): New. + (b4_comment): Bounce to b4_c_comment. + Now support $2 = [PREFIX] for indentation. + * data/lalr1.cc (b4_table_declare): Don't output a comment if + there is no comment. + Indent it properly when there is one. + Output the ending semicolon. + (b4_table_define): Space changes. + Output the ending semicolon. + (b4_tables_map): New. + Use it twice instead of declaring and defining the (integral) + tables by hand. + +2008-11-25 Akim Demaille + + b4_table_declare. + * data/lalr1.cc (b4_table_declare): New. + Use it to declare the tables defined with b4_table_define. + (b4_table_define): Declare a third arg to match b4_table_declare + signature. + Move all the comments around invocations of b4_table_define into + the invocations itselves. + Move things around to have the order for declarations and + definitions. + +2008-11-25 Akim Demaille + + Formatting changes. + * data/lalr1.java: here. + +2008-11-25 Akim Demaille + + b4_args is more general than only C++. + * data/lalr1.cc (b4_args, _b4_args): Move to... + * data/bison.m4: here. + +2008-11-21 Di-an Jan + + Implement no-XXX arguments for --warnings, --report, --trace. + * src/getargs.c (flags_argmatch): Handles no-XXX. + Fix typo in doxygen comment. + +2008-11-21 Akim Demaille + + Display the changes in cross-options.texi. + * build-aux/cross-options.pl ($sep): New, to separate items. + * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the + changes. + +2008-11-20 Di-an Jan + + Improves options in the manual. + * doc/bison.texinfo (-g, -x): Add space before argument. + (Option Cross Key): Implement FIXME: listing directives also. + * build-aux/cross-options.pl: Read from rather than <>. + (Short Option): Special case -d. Put arguments inside @option. + (Bison Directive): Add column, automatically extracted from + src/scan-gram.l (actual name passed as the first argument) + with special case for %define. + * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l + to build-aux/cross-options.pl. + * src/getargs.c (usage): Document limitations of cross-options.pl. + * src/scan-gram.l: Likewise. + +2008-11-18 Joel E. Denny + + Fix unexpanded macros in GLR defines file. + Reported by Csaba Raduly at + . + * THANKS (Csaba Raduly): Add. + * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc. + * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate + lexer in a separate module that includes the defines file. + (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer + source. + * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF. + Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX. + (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF. + (AT_DATA_SOURCE_PROLOGUE): New. + (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE. + (AT_DATA_SOURCE): New. + (AT_FULL_COMPILE): Extend to support an additional source file. + +2008-11-18 Akim Demaille + + More TODO. + * TODO: More short term issues. + +2008-11-18 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. + +2008-11-18 Akim Demaille + + Use b4_subtract where possible. + * data/lalr1.cc (b4_subtract): Move to... + * data/bison.m4: here. + * data/glr.c (b4_rhs_data): Use it. + * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it. + +2008-11-18 Akim Demaille + + Remove incorrect mode specification. + * data/glr.cc: Don't pretend it's C code. + +2008-11-17 Joel E. Denny + + Simplify last patch slightly. + * src/getargs.c (getargs): Here. + +2008-11-17 Joel E. Denny + + Fix last warning from --enable-gcc-warnings. + * src/getargs.c (getargs): Don't assign const address to non-const + pointer. + +2008-11-17 Joel E. Denny + + Don't let maintainer-*-check targets force a version update. + * cfg.mk (_is-dist-target): Implement. maintainer-check* was already + handled. + +2008-11-17 Di-an Jan + + * doc/bison.texinfo: Synchronize ``Detail Node Listing''. + Align menus. Adjust word wrapping. Use node names for menu names. + (Examples): Don't abbreviate node names. + (LocalWords): Remove abbreviations. + (Copying): Make description a sentence. + (Java Action Features): Remove period to match the rest of menu. + +2008-11-17 Di-an Jan + + Handles several --enable-gcc-warnings. + * src/getargs.c (command_line_location): Set parameters to void. + * src/output.c (symbol_type_name_cmp): Make static. + (symbols_by_type_name): Set parameters to void. + (symbol_definitions_output): Remove unused parameter. Rename as... + (prepare_symbol_definitions): this. + (muscles_output): Move symbol_definitions_output to... + (output): here as prepare_symbol_definitions. + * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main. + (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed. + +2008-11-17 Di-an Jan + + * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202. + Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests. + +2008-11-16 Akim Demaille + + Add missing $(EXEEXT). + * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is + "src/bison$(EXEEXT)". + Reported by Di-an Jan. + +2008-11-15 Akim Demaille + + * TODO: Update. + +2008-11-15 Akim Demaille + + Formatting changes. + * tests/input.at: here. + +2008-11-15 Akim Demaille + + Remove duplicate header inclusion. + * src/LR0.c: here. + +2008-11-15 Akim Demaille + + * src/parse-gram.h, src/parse-gram.c: Regen. + +2008-11-15 Akim Demaille + + Support parametric types. + + There are two issues to handle: first scanning nested angle + bracket pairs to support types such as std::pair< std::string, + std::list > >. + + Another issue is to address idiosyncracies of C++: do not glue two + closing angle brackets together (otherwise it's operator>>), and + avoid sticking blindly a TYPE to the opening <, as it can result + in '<:' which is a digraph for '['. + + * src/scan-gram.l (brace_level): Rename as... + (nesting): this. + (SC_TAG): New. + Implement support for complex tags. + (tag): Accept + , but not <. + * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template) + (b4_symbol_variant): Leave space around types as parameters. + * examples/variant.yy: Use nested template types and leading ::. + * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt): + Rename as... + (TAG, TAG_ANY, TAG_NONE, tag.opt): these. + * tests/c++.at: Test parametric types. + +2008-11-15 Akim Demaille + + Test token.prefix. + This is not sufficient, but we test at least that the make_SYMBOL + interface is not affected by token.prefix. A more general test + will be implemented when the support of token.prefix is generalized + to more skeletons. + + * tests/c++.at: One more variant test, using token.prefix. + +2008-11-15 Akim Demaille + + Test the make_TOKEN interface. + * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations. + Factor the common code in yylex. + Use it to test "%define lex_symbol". + +2008-11-15 Akim Demaille + + Formatting change. + +2008-11-15 Akim Demaille + + Simplify code for variants bench marks. + * etc/bench.pl.in (&generate_grammar_list): Define and use + location_type. + Factor the common code in yylex. + +2008-11-15 Akim Demaille + + Better error message. + * bootstrap (find_tool): Fix the error message. + +2008-11-15 Akim Demaille + + Update variant.yy to newest interface. + * examples/variant.yy: Define lex_symbol. + Adjust. + +2008-11-15 Akim Demaille + + Don't use locations in variant.yy. + * examples/variant.yy: Adjust to not using locations. + +2008-11-15 Akim Demaille + + Comment changes. + * data/local.mk, etc/local.mk, examples/local.mk: Use Automake + comments for the license. + +2008-11-15 Akim Demaille + + Remove tests/Makefile.am. + * tests/Makefile.am: Rename as... + * tests/local.mk: this. + * Makefile.am, configure.ac: Adjust. + * Makefile.am (DISTCLEANFILES): Define. + (maintainer-check, maintainer-xml-check, maintainer-push-check): + Remove, we no longer need to bounce to the real targets. + +2008-11-15 Akim Demaille + + Comment changes. + +2008-11-15 Akim Demaille + + djgpp/local.mk. + * Makefile.am (EXTRA_DIST): Move djgpp related part to... + * djgpp/local.mk: this new file. + +2008-11-15 Akim Demaille + + Remove doc/Makefile.am. + * doc/Makefile.am: Rename as... + * doc/local.mk: this. + Adjust paths + * Makefile.am, configure.ac: Adjust. + * Makefile.am (MOSTLYCLEANFILES): New. + * src/local.mk: Adjust. + +2008-11-15 Akim Demaille + + Move sc_tight_scope into maint.mk. + It does not work, and I don't know how it was supposed to work: it + seems to be looking for sources in the build tree. I just moved + it at a better place, fixing it is still required. + + * src/local.mk (echo): Remove. + (sc_tight_scope): Move to... + * maint.mk: here. + +2008-11-15 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.h: Regen. + +2008-11-15 Akim Demaille + + Remove src/Makefile.am. + * src/Makefile.am: Rename as... + * src/local.mk: this. + Prefix all the paths with src/. + (AUTOMAKE_OPTIONS): Build object files in the sub dirs. + (AM_CPPFLAGS): Find find in builddir/src. + (YACC): Move the flags into... + (AM_YFLAGS): here. + * maint.mk (sc_tight_scope): Disable. + It used to bounce to the version in src/Makefile.am which is now + part of this very Makefile. + * Makefile.am, configure.ac: Adjust. + * src/scan-code-c.c, src/scan-code.l: We can no longer rely on + include "..." to find files "here": we are no longer in src/, so + qualify the includes with src/. + * doc/Makefile.am (PREPATH): No longer include the top_builddir + prefix. + (.x.1): Adjust to be able to create src/foo from the top level + Makefile, instead of going bounce to src/Makefile the creation of + foo. + +2008-11-15 Akim Demaille + + Remove useless variable. + * doc/Makefile.am (srcsrcdir): Remove. + +2008-11-15 Akim Demaille + + Remove data/Makefile.am. + * data/Makefile.am: Rename as... + * data/local.mk: this. + Adjust paths. + * Makefile.am, configure.ac: Adjust. + +2008-11-15 Akim Demaille + + Remove etc/Makefile.am. + * etc/Makefile.am: Rename as... + * etc/local.mk: this. + Adjust. + * Makefile.am, configure.ac: Adjust. + +2008-11-15 Akim Demaille + + Remove examples/local.mk. + examples/calc++/Makefile.am might be interesting to keep as is, since + it is an example in itself. + + * examples/Makefile.am: Rename as... + * examples/local.mk: this. + Adjust. + * Makefile.am, configure.ac: Adjust. + +2008-11-15 Akim Demaille + + Remove build-aux/Makefile.am. + Recursive Makefiles are really way too slow, let's get rid of some of + them. + + * build-aux/Makefile.am: Rename as... + * build-aux/local.mk: this. + Adjust paths. + * Makefile.am, configure.ac: Adjust. + +2008-11-15 Akim Demaille + + Provide convenience constructors for locations and positions. + * data/location.cc (position::position): Accept file, line and + column as arguments with default values. + Always qualify initial line and column literals as unsigned. + (location::location): Provide convenience constructors. + +2008-11-15 Akim Demaille + + Instead of using make_symbol, generate make_FOO for each + token type. + Using template buys us nothing, and makes it uselessly complex to + construct a symbol. Besides, it could not be generalized to other + languages, while make_FOO would work in C/Java etc. + + * data/lalr1.cc (b4_symbol_): New. + (b4_symbol): Use it. + (b4_symbol_constructor_declaration_) + (b4_symbol_constructor_definition_): Instead of generating + specializations of an overloaded template function, just generate + several functions whose names are forged from the token names + without the token.prefix. + (b4_symbol_constructor_declarations): Generate them for all the + symbols, not just by class of symbol type, now that instead of + specializing a function template by the token, we generate a + function named after the token. + (b4_symbol_constructor_specialization_) + (b4_symbol_constructor_specializations): Remove. + * etc/bench.pl.in: Adjust to this new API. + +2008-11-13 Akim Demaille + + %define token.prefix. + Provide a means to add a prefix to the name of the tokens as + output in the generated files. Because of name clashes, it is + good to have such a prefix such as TOK_ that protects from names + such as EOF, FILE etc. But it clutters the grammar itself. + + * data/bison.m4 (token.prefix): Empty by default. + * data/c.m4 (b4_token_enum, b4_token_define): Use it. + * data/lalr1.cc (b4_symbol): Ditto. + +2008-11-13 Akim Demaille + + Compute at M4 time some of the subtractions. + * data/lalr1.cc (b4_subtract): New. + (b4_rhs_data): Use it. + +2008-11-13 Akim Demaille + + symbol::token. + This allows the user to get the type of a token returned by yylex. + + * data/lalr1.cc (symbol::token): New. + (yytoknum_): Define when %define lex_symbol, independently of + %debug. + (yytoken_number_): Move into... + (symbol::token): here, since that's the only use. + The other one is YYPRINT which was not officially supported + by lalr1.cc, and anyway it did not work since YYPRINT uses this + array under a different name (yytoknum). + +2008-11-13 Akim Demaille + + YYERRCODE. + * TODO (YYERRCODE): Mention the case of $undef. + +2008-11-13 Akim Demaille + + TODO: YYPRINT. + * TODO (YYPRINT): New. + +2008-11-13 Akim Demaille + + Comment changes. + * data/lalr1.cc, data/yacc.c: Fix the description of the + yytranslate and yytoknum tables. + +2008-11-13 Akim Demaille + + Define make_symbol in the header. + To reach good performances these functions should be inlined (yet + this is to measure precisely). To this end they must be available + to the caller. + + * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify + location_type with the class name. + Since will now be output in the header, declare "inline". + No longer use b4_symbol_constructor_specializations, but + b4_symbol_constructor_definitions in the header. + Don't call it in the *.cc file. + +2008-11-13 Akim Demaille + + Define yytranslate in the header for lex_symbol. + * data/lalr1.cc: Move the invocation of b4_yytranslate_definition + into the header file when using %define lex_symbol. + (yytranslate_): Declare inline. + +2008-11-13 Akim Demaille + + Define the constructors of symbol_type in + b4_symbol_constructor_definitions. + The constructors are called by the make_symbol functions, which a + forthcoming patch will move elsewhere. Hence the interest of + putting them together. + + The stack_symbol_type does not need to be moved, it is used only + by the parser. + + * data/lalr1.cc: Move symbol_type and symbol_base_type + constructors into... + (b4_symbol_constructor_definitions): here. + Adjust. + +2008-11-13 Akim Demaille + + Make it easier to move the definition of yytranslate_. + Forthcoming changes will make it possible to use yytranslate_ + from outside the parser implementation file. + + * data/lalr1.cc (b4_yytranslate_definition): New. + Use it. + +2008-11-13 Akim Demaille + + Remove useless class specification. + * data/lalr1.cc (b4_symbol_constructor_specialization_): No need + to refer to the class name to use a type defined by the class for + arguments of member functions. + +2008-11-13 Akim Demaille + + Finer input type for yytranslate. + This patch is debatable: the tradition expects yylex to return an int + which happens to correspond to token_number (which is an enum). This + allows for instance to return characters (such as '*' etc.). But this + goes against the stronger typing I am trying to have with the new + lex interface which return a symbol_type. So in this case, feed + yytranslate_ with a token_type. + + * data/lalr1.cc (yytranslate_): When in %define lex-symbol, + expect a token_type. + +2008-11-13 Akim Demaille + + Honor lex-params in %define lex_symbol mode. + * data/lalr1.cc: Use b4_lex_param. + +2008-11-13 Akim Demaille + + Simplify names. + * src/output.c (symbol_definitions_output): Rename symbol + attributes type_name and has_type_name as type and has_type. + * data/lalr1.cc: Adjust uses. + +2008-11-13 Akim Demaille + + Use b4_type_names for the union type. + The union used to compute the size of the variant used to iterate + over the type of all the symbols, with a lot of redundancy. Now + iterate over the lists of symbols having the same type-name. + + * data/lalr1.cc (b4_char_sizeof_): New. + (b4_char_sizeof): Use it. + Adjust to be called with a list of numbers instead of a single + number. + Adjust its caller for new-line issues. + +2008-11-13 Akim Demaille + + Define the "identifier" of a symbol. + Symbols may have several string representations, for instance if + they have an alias. What I call its "id" is a string that can be + used as an identifier. May not exist. + + Currently the symbols which have the "tag_is_id" flag set are + those that don't have an alias. Look harder for the id. + + * src/output.c (is_identifier): Move to... + * src/symtab.c (is_identifier): here. + * src/symtab.h, src/symtab.c (symbol_id_get): New. + * src/output.c (symbol_definitions_output): Use it to define "id" + and "has_id". + Remove the definition of "tag_is_id". + * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and + "tag_is_id" were used to produce code. + We still use "tag" for documentation. + +2008-11-11 Akim Demaille + + Locations are no longer required by lalr1.cc. + * data/lalr1.cc (_b4_args, b4_args): New. + Adjust all uses of locations to make them optional. + * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations. + (AT_CHECK_NAMESPACE): Check the use of locations. + * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or + without locations with lalr1.cc. + Test these cases. + * tests/output.at: Check lalr1.cc with and without location + support. + * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y): + Don't use locations. + +2008-11-11 Akim Demaille + + AT_FULL_COMPILE. + * tests/local.at (AT_FULL_COMPILE): New. + * tests/actions.at, tests/calc.at, tests/regression.at: Use it. + +2008-11-11 Akim Demaille + + Support parens in calc++. + * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens. + * examples/calc++/test (run): Check the expected output. + Adjust callers. + Check parens too. + +2008-11-11 Akim Demaille + + Simplify lalr1.cc since %defines is mandatory. + * data/lalr1.cc: Remove useless calls to b4_defines_if. + +2008-11-11 Akim Demaille + + TODO: yyfmt. + * TODO (yysyntax_error): New item. + +2008-11-11 Akim Demaille + + Prefer M4 to CPP. + * data/lalr1.cc: Use b4_error_verbose_if instead of #if + YYERROR_VERBOSE. + +2008-11-11 Akim Demaille + + Support i18n of the parse error messages. + * TODO (lalr1.cc/I18n): Remove. + * data/lalr1.cc (yysyntax_error_): Support the translation of the + error messages, as done in yacc.c. + Stay within the yy* pseudo namespace. + +2008-11-11 Akim Demaille + + More TODO. + * TODO (single stack, yysyntax_error): New. + +2008-11-11 Akim Demaille + + Make it possible to return a symbol_type from yylex. + * data/lalr1.cc (b4_lex_symbol_if): New. + (parse): When lex_symbol is defined, expected yylex to return the + complete lookahead. + * etc/bench.pl.in (generate_grammar_list): Extend to support this + yylex interface. + (bench_variant_parser): Exercise it. + +2008-11-11 Akim Demaille + + Remove useless bench case. + * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is + no longer used. + +2008-11-11 Akim Demaille + + Improve display of directives. + * etc/bench.pl.in (parse_term): Don't add useless eol. + +2008-11-11 Akim Demaille + + Use string_cast in the bench. + * etc/bench.pl.in (generate_grammar_list): Define and use + string_cast. + +2008-11-11 Akim Demaille + + Replace yychar with a Boolean. + * data/lalr1.cc (parse::yychar): Replace by... + (parse::yyempty): this. + +2008-11-11 Akim Demaille + + Factor the tables. + * TODO: New item. + +2008-11-11 Akim Demaille + + Let yytranslate handle the eof case. + * data/lalr1.cc (yytranslate_): Handle the EOF case. + Adjust callers. + No longer expect yychar to be equal to yyeof_, rather, test the + lookahead's (translated) kind. + +2008-11-11 Akim Demaille + + yychar cannot be empty in yyerrlab. + * TODO (yychar == yyempty_): New. + * data/lalr1.cc: Remove the handling of this case. + This eases forthcoming changes related to yychar and yytranslate. + +2008-11-11 Akim Demaille + + Bench: syntactic sugar for %define/#define. + * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments. + (&bench_push_parser, bench_variant_parser): Use this feature. + (&eat): New. + Use it. + +2008-11-11 Akim Demaille + + Less memory pressure on the "list" bench. + * etc/bench.pl.in (generate_grammar_list): Do not accumulate all + the values, to limit memory pressure. + +2008-11-11 Akim Demaille + + Introduce make_symbol. + make_symbol provides a means to construct a full symbol (kind, + value, location) in a single shot. It is meant to be a Symbol + constructor, parameterized by the symbol kind so that overloading + would prevent incorrect kind/value pairs. Unfortunately + parameterized constructors do not work well in C++ (unless the + parameter also appears as an argument, which is not acceptable), + hence the use of a function instead of a constructor. + + * data/lalr1.cc (b4_symbol_constructor_declaration_) + (b4_symbol_constructor_declarations) + (b4_symbol_constructor_specialization_) + (b4_symbol_constructor_specializations) + (b4_symbol_constructor_definition_) + (b4_symbol_constructor_definitions): New. + Use them where appropriate to generate declaration, declaration of + the specializations, and implementations of the templated + overloaded function "make_symbol". + (variant::variant): Always define a default ctor. + Also provide a copy ctor. + (symbol_base_type, symbol_type): New ctor overloads for value-less + symbols. + (symbol_type): Now public, so that functions such as yylex can use + it. + +2008-11-11 Akim Demaille + + Inform m4 whether a tag is a valid id. + * src/output.c (is_identifier): New. + (symbol_definitions_output): Use it to define tag_is_id. + But maybe this should be done at m4 level? + +2008-11-11 Akim Demaille + + Test 214 was failing: it greps with a pattern containing [ ]* + which obviously meant to catch spaces and tabs, but contained only + spaces. Tabulations in sources are a nuisance, so to simplify the + matter, get rid of all the tabulations in the Java sources. The + other skeletons will be treated equally later. + + * data/java.m4, data/lalr1.java: Untabify. + * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations: + tabulations are no longer generated. + +2008-11-11 Paolo Bonzini + + * bootstrap.conf: Replace m4/warning.m4 with warnings module. + * configure.ac: Adjust usage. + * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS). + * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS). + * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS). + +2008-11-10 Di-an Jan + + Workaround Java's ``code too large'' problem for parser tables + in most cases, by using one function per initialization. + * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New. + * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_, + yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_ + yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table. + (yytname_): Use b4_typed_parser_table. + * doc/bison.texinfo (Java Bison Interface): Add note on Java's + ``code too large'' error. + +2008-11-10 Di-an Jan + + * NEWS: Document them. + + General Java skeleton improvements. + * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows + using gcj < 4.3 in the testsuite, according to comments in + gnulib/m4/javacomp.m4. + * data/java.m4 (stype, parser_class_name, lex_throws, throws, + location_type, position_type): Remove extraneous brackets from + b4_percent_define_default. + (b4_lex_param, b4_parse_param): Remove extraneous brackets from + m4_define and m4_define_default. + * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue, + which marks the end of user code with appropriate syncline, like all + the other skeletons. + (b4_user_post_prologue): Add. Don't silently drop. + (yylex): Remove. + (parse): Inline yylex. + * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document. + (%{...%}): Fix typo of %code imports. + * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword. + + Support annotations on parser class with %define annotations. + * data/lalr1.java (annotations): Add to parser class modifier. + * doc/bison.texinfo (Java Parser Interface): Document + %define annotations. + (Java Declarations Summary): Document %define annotations. + * tests/java.at (Java parser class modifiers): Test annotations. + + Do not generate code for %error-verbose unless requested. + * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose. + Make private. Make conditional on %error-verbose. + (getErrorVerbose, setErrorVerbose): New. + (yytnamerr_): Make conditional on %error-verbose. + (yysyntax_error): Make some code conditional on %error-verbose. + * doc/bison.texinfo (Java Bison Interface): Remove the parts + about %error-verbose having no effect. + (getErrorVerbose, setErrorVerbose): Document. + + Move constants for token names to Lexer interface. + * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here. + * data/java.m4 (b4_token_enum): Indent for move to Lexer interface. + (parse): Qualify EOF to Lexer.EOF. + * doc/bison.texinfo (Java Parser Interface): Move documentation of + EOF and token names to Java Lexer Interface. + * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier. + + Make yyerror public. + * data/lalr1.java (Lexer.yyerror): Use longer parameter name. + (yyerror): Change to public. Add Javadoc comments. Use longer + parameter names. Make the body rather than the declarator + conditional on %locations. + * doc/bison.texinfo (yyerror): Document. Don't mark as protected. + + Allow user to add code to the constructor with %code init. + * data/java.m4 (b4_init_throws): New, for %define init_throws. + * data/lalr1.java (YYParser.YYParser): Add b4_init_throws. + Add %code init to the front of the constructor body. + * doc/bison.texinfo (YYParser.YYParser): Document %code init + and %define init_throws. + (Java Declarations Summary): Document %code init and + %define init_throws. + * tests/java.at (Java %parse-param and %lex-param): Adjust grep. + (Java constructor init and init_throws): Add tests. + +2008-11-10 Akim Demaille + + Update TODO. + * TODO (-D): is implemented. + (associativity): Same precedence must have the same associativity. + For instance, how can a * b / c be parsed if * is %left and / is + %right? + (YYERRORCODE, YYFAIL, YYBACKUP): New. + +2008-11-10 Akim Demaille + + Formatting changes. + +2008-11-10 Akim Demaille + + More information about the symbols. + * src/output.c (type_names_output): Document all the symbols, + including those that don't have a type-name. + (symbol_definitions_output): Define "is_token" and + "has_type_name". + * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty + type-name, now that they are defined too in b4_type_names. + +2008-11-10 Akim Demaille + + Regen. + +2008-11-10 Akim Demaille + + Make parser::yytranslate static. + Small speedup (1%) on the list grammar. And makes yytranslate_ + available in non member functions. + + * data/lalr1.cc (yytranslate_): Does not need to be a instance + function. + +2008-11-10 Akim Demaille + + Avoid trailing spaces. + * data/c.m4: b4_comment(TEXT): Don't indent empty lines. + * data/lalr1.cc: Don't indent before rule and symbol actions, as + they can be empty, and anyway this incorrectly indents the first + action. + +2008-11-10 Akim Demaille + + Comment changes. + +2008-11-10 Akim Demaille + + Use "enum" for integral constants. + This is just nicer to read, I observed no speedup. + + * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_) + (yterror_, yyerrcode_, yyntokens_): Define as members of an enum. + (yyuser_token_number_max_, yyundef_token_): Move into... + (yytranslate_): here. + +2008-11-10 Akim Demaille + + Shortcuts in bench directives. + * etc/bench.pl.in (parse_dirs): New. + Use it. + (bench_variant_parser, bench_fusion_parser): Use %s and %d. + Create the benches in "benches/". + +2008-11-10 Akim Demaille + + Formatting changes. + * data/lalr1.cc: here. + +2008-11-10 Akim Demaille + + Adjust verbose message to using emacs. + * etc/bench.pl.in: Inform compilation-mode when we change the + directory. + (generate_grammar_list): Recognize %define "variant" in addition + to %define variant. + +2008-11-10 Akim Demaille + + Classify symbols by type-name. + * src/uniqstr.h (UNIQSTR_CMP): New. + * src/output.c (symbol_type_name_cmp, symbols_by_type_name) + (type_names_output): New. + (muscles_output): Use it. + * data/lalr1.cc (b4_symbol_action_): Remove. + (b4_symbol_case_, b4_type_action_): New. + Adjust uses of b4_symbol_action_ to use b4_type_action_. + +2008-11-10 Akim Demaille + + Change the handling of the symbols in the skeletons. + Before we were using tables which lines were the symbols and which + columns were things like number, tag, type-name etc. It is was + difficult to extend: each time a column was added, all the numbers had + to be updated (you asked for colon $2, not for "tag"). Also, it was + hard to filter these tables when only a subset of the symbols (say the + tokens, or the nterms, or the tokens that have and external number + *and* a type-name) was of interest. + + Now instead of monolithic tables, we define one macro per cell. For + instance "b4_symbol(0, tag)" is a macro name which contents is + self-decriptive. The macro "b4_symbol" provides easier access to + these cells. + + * src/output.c (type_names_output): Remove. + (symbol_numbers_output, symbol_definitions_output): New. + (muscles_output): Call them. + (prepare_symbols): Define b4_symbols_number. + +2008-11-10 Akim Demaille + + --trace=muscles + * src/getargs.h, src/getargs.c (trace_muscle): New. + (trace_types, trace_args): Support it. + * src/output.c (output_skeleton): Use it. + +2008-11-10 Akim Demaille + + muscles_output. + * src/output.c (muscles_output): New, extracted from... + (output_skeleton): here. + Adjust. + +2008-11-10 Akim Demaille + + Formatting changes. + +2008-11-10 Akim Demaille + + Update the variant example. + * examples/variant.yy: Formatting changes. + One stage build. + +2008-11-10 Akim Demaille + + Support constructor with an argument. + This improves the "list" bench by 2%. + + * data/lalr1.cc (variant::build): Add an overloaded version with + an argument. + * tests/c++.at (AT_CHECK_VARIANT): Check it. + +2008-11-10 Akim Demaille + + Test variants. + * tests/c++.at (AT_CHECK_VARIANTS): New. + Use it with and without %define assert. + +2008-11-10 Akim Demaille + + Add %precedence support. + Unfortunately it is not possible to reuse the %prec directive. This + is because to please POSIX, we do not require to end the rules with a + semicolon. As a result, + + foo: bar %prec baz + + is ambiguous: either a rule which precedence is that of baz, or a rule, + and then a declaration of the precedence of the token baz. + + * doc/bison.texinfo: Document %precedence. + (Precedence Only): New. + * src/assoc.h, src/assoc.c (precedence_assoc): New. + * src/conflicts.c (resolve_sr_conflict): Support it. + * src/scan-gram.l, src/parse-gram.y (%precedence): New token. + Parse it. + * tests/calc.at: Use %precedence for NEG. + * tests/conflicts.at (%precedence does not suffice) + (%precedence suffices): New tests. + +2008-11-09 Akim Demaille + + Make benches in a sub dirs. + * etc/bench.pl.in ($dir): New. + Use it. + Check the use of constructors with an argument. + (bench_variant_parser): Fix. + +2008-11-09 Akim Demaille + + fix eof condition + +2008-11-09 Akim Demaille + + Fix --help. + +2008-11-09 Akim Demaille + + Require the generation of parse-gram.output. + * src/Makefile.am (YACC): Pass --report=all. + +2008-11-09 Akim Demaille + + Formatting changes. + +2008-11-09 Akim Demaille + + Update TODO. + * TODO: Remove obsolete items. + Update others. + +2008-11-09 Akim Demaille + + Enhance bench.pl. + * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact) + (@token, $grammar, $bench): New. + (generate_grammar_variant): Rename as... + (generate_grammar_list): this. + (generate_grammar): Adjust. + (bench_grammar): Rename as... + (bench): this. + Use it in the various bench-marking routines. + (-b, -g): New options. + +2008-11-09 Akim Demaille + + Use a static hierarchy for symbols in the C++ parser. + * data/lalr1.cc (symbol_base_type, symbol_type) + (stack_symbol_type): Make it a static hierarchy. + Adjust dependencies. + +2008-11-09 Akim Demaille + + bench.pl -d, --directive. + * etc/bench.pl.in (@directive): New. + (&bench_grammar): Use it. + (&bench_list_grammar): New, to provide access to the "variant" + grammar. + Use it. + (getopts): Support -d, --directive. + +2008-11-09 Akim Demaille + + Use inline for small operations. + * data/lalr1.cc (symbol_base_type, symbol_type) + (stack_symbol_type): Declare constructor and other operations as + inline. + (yy_destroy_): Inline. + +2008-11-09 Akim Demaille + + Introduce a hierarchy for symbols. + * data/lalr1.cc (symbol_base_type, symbol_type): New. + (data_type): Rename as... + (stack_symbol_type): this. + Derive from symbol_base_type. + (yy_symbol_value_print_): Merge into... + (yy_symbol_print_): this. + Rename as... + (yy_print_): this. + (yydestruct_): Rename as... + (yy_destroy_): this. + (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust. + (parser::parse): yyla is now of symbol_type. + Use its type member instead of yytoken. + +2008-11-09 Akim Demaille + + Rename data_type and stack_symbol_type. + * data/lalr1.cc (data_type): Rename as... + (stack_symbol_type): this. + +2008-11-09 Akim Demaille + + Handle semantic value and location together. + * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to + yydata.value and yydata.location. + (yy_symbol_value_print_, yy_symbol_print_, yydestruct_) + (YY_SYMBOL_PRINT): Now take semantic value and location as a + single arg. + Adjust all callers. + (yydestruct_): New overload for a stack symbol. + +2008-11-09 Akim Demaille + + Push a complete symbol, not connected parts. + * data/lalr1.cc (yypush_): Take a data_type&, not disconnected + state, value and location. + Adjust callers. + +2008-11-09 Akim Demaille + + Agregate yylval and yylloc. + * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by... + (parser::yyla): this. + +2008-11-09 Akim Demaille + + Rely on the state stack to display reduction traces. + To display rhs symbols before a reduction, we used information + about the rule reduced, which required the tables yyrhs and + yyprhs. Now use rely only on the state stack to get the same + information. + + * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New. + Use them. + (parser::yyrhs_, parser::yyprhs_): Remove. + (parser::yy_reduce_print_): Use the state stack. + +2008-11-09 Akim Demaille + + Fuse yyval and yyloc into yylhs. + * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using + yylhs. + (parse): Replace yyval and yyloc with yylhs.value and + yylhs.location. + After a user action, compute yylhs.state earlier. + (yyerrlab1): Do not play tricks with yylhs.location, rather, use a + fresh error_token. + +2008-11-09 Di-an Jan + + Remove unused variable. + * src/output.c (type_names_output): Remove unused variable sep. + +2008-11-09 Paolo Bonzini + + Change tests/output.at quoting. + * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when + expanding arguments. + +2008-11-07 Joel E. Denny + + Don't add a semicolon to actions for %skeleton or %language. + It breaks Java test cases as reported by Akim Demaille. + * src/scan-code.l: Implement. + +2008-11-07 Joel E. Denny + + Clean up %skeleton and %language priority implementation. + * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and + remove static qualifier because others will soon need to see it. + (language_prio): Likewise. (getargs): Use command_line_prio rather than 0. * src/getargs.h (command_line_prio, grammar_prio, default_prio): New enum fields. @@ -3278,15 +5258,119 @@ (language_prio): Extern it. * src/parse-gram.y: Use grammar_prio rather than 1. -2008-11-04 Akim Demaille +2008-11-07 Akim Demaille - * NEWS: Mention the trailing semicolon in action. + Moving push traces into yypush_. + * data/lalr1.cc (yypush_): Now takes a optional trace message. + Adjust all uses. -2008-11-04 Akim Demaille +2008-11-07 Akim Demaille - Reformat NEWS. - * NEWS: Use more outline-mode markup. - Suggested by Jim Meyering. + The single-stack C++ parser is now the standard one. + * data/lalr1.cc: Rename as... + * data/lalr1-split.cc: this. + * data/lalr1-fusion.cc: Rename as... + * data/lalr1.cc: this. + * etc/bench.pl.in: Adjust. + +2008-11-07 Akim Demaille + + Avoid empty-if warnings. + Reported by Quentin Hocquet. + + * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT) + (YY_STACK_PRINT): Provide some contents even when !YYDEBUG. + +2008-11-07 Akim Demaille + + Pass command line location to skeleton_arg and language_argmatch. + * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch): + The location argument is now mandatory. + Adjust all dependencies. + (getargs): Use command_line_location. + +2008-11-07 Akim Demaille + + -D, --define. + * src/getargs.c (usage): Document -D. + Fix help string for --locations. + (command_line_location): New. + (short_options, long_options, getargs): Support -D, --define. + (getargs): Move -d support at the right place. + * doc/bison.texinfo (Bison Options): Update. + * tests/input.at (%define, --define): New. + +2008-11-07 Akim Demaille + + Initialize the muscle table before parsing the command line. + * src/getargs.c (quotearg.h, muscle_tab.h): Include. + (getargs): Define file_name. + * src/main.c (main): Initialize muscle_tab before calling + getargs. + * src/muscle_tab.c (muscle_init): No longer define file_name, as + its value is not available yet. + +2008-11-07 Akim Demaille + + Locations without columns for command line arguments. + * src/location.c (location_print): Don't display negative columns. + * src/location.h: Document this. + +2008-11-07 Akim Demaille + + Fix --help. + * src/getargs.c (usage): Fix help string for -W. + +2008-11-07 Akim Demaille + + Handle more general types of option arguments. + * build-aux/cross-options.pl: The argument ends at the first + space, not the first non-symbol character. + Use @var for each word appearing the argument description. + +2008-11-07 Akim Demaille + + Destroy the variants that remain on the stack in case of error. + * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's + destructor. + Display the value only if yymsg is nonnull. + (yyreduce): Invoke yydestruct_ when popping lhs symbols. + +2008-11-07 Akim Demaille + + Add "%define assert" to variants. + This is used to help the user catch cases where some value gets + ovewritten by a new one. This should not happen, as this will + probably leak. + + Unfortunately this uncovered a bug in the C++ parser itself: the + lookahead value was not destroyed between two calls to yylex. For + instance if the previous lookahead was a std::string, and then an int, + then the value of the std::string was correctly taken (i.e., the + lookahead was now an empty string), but std::string structure itself + was not reclaimed. + + This is now done in variant::build(other&) (which is used to take the + value of the lookahead): other is not only stolen from its value, it + is also destroyed. This incurs a new performance penalty of a few + percent, and union becomes faster again. + + * data/lalr1-fusion.cc (variant::build(other&)): Destroy other. + (b4_variant_if): New. + (variant::built): New. + Use it whereever the status of the variant changes. + * etc/bench.pl.in: Check the penalty of %define assert. + +2008-11-07 Akim Demaille + + Use "%define variant" in bench.pl. + * etc/bench.pl.in: No longer use the pseudo directive %variants, + just use %define variants. + +2008-11-07 Akim Demaille + + Regen. + * src/parse-gram.h, src/parse-gram.c: Regen. 2008-11-04 Joel E. Denny @@ -3298,6 +5382,369 @@ * tests/regression.at (Fix user actions without a trailing semicolon): New test case. +2008-11-04 Akim Demaille + + Use b4_copyright_years. + * data/yacc.c (b4_copyright_years): New. + Fix its value according to the comments in the file. + Use it and undefine it. + +2008-11-04 Akim Demaille + + Formatting changes. + * data/lalr1-fusion.cc, src/parse-gram.y: here. + +2008-11-04 Akim Demaille + + Formatting changes. + * data/lalr1-fusion.cc: here. + +2008-11-04 Akim Demaille + + Use strict on bench.pl. + * etc/bench.pl.in (&run, &generate_grammar): New. + Rename the grammar generating functions for consistency. + Change the interface so that the list of benches to run is passed + as (optionless) arguments. + (&compile): Use &run. + +2008-11-04 Akim Demaille + + Remove spurious initial empty lines. + * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, + * data/yacc.c: End the @output lines with an @. + +2008-11-04 Akim Demaille + + Improve the display of sizes. + * etc/bench.p.in: Higher precision. + Sort by decreasing size. + +2008-11-04 Akim Demaille + + Don't memcpy C++ structures. + * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional + arguments. + (variant::build): New overload for + copy-construction-that-destroys. + (variant::swap): New. + (parser::yypush_): Use it in variant mode. + +2008-11-04 Akim Demaille + + Better defaults for bench.pl. + * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the + default values. + Adjust &verbose uses. + (-q, --quiet): New. + +2008-11-04 Akim Demaille + + Make variant.yy more complex. + std::list cannot be copied via memcpy, they are more demanding than + std::string. Use one std::list to strengthen the test. + + * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc. + Adjust. + Create a list of strings, instead of a single large string. + +2008-11-04 Akim Demaille + + bench.pl --bench. + * etc/bench.pl.in (--bench, $bench): New. + +2008-11-04 Akim Demaille + + Sort methods. + * data/lalr1-fusion.cc (destroy): Use as() in its definition. + Define it after as(). + +2008-11-04 Akim Demaille + + Useless parens. + * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens. + +2008-11-04 Akim Demaille + + Issue missing synclines after user actions. + * data/c.m4 (b4_case): Issue synclines on the output file. + +2008-11-04 Akim Demaille + + Remove trailing empty line. + * data/lalr1-fusion.cc: Don't add an empty line after the user's + epilogue. + +2008-11-04 Akim Demaille + + Fix output of copyright years. + * data/bison.m4 (b4_copyright): Fix the indentation of the + copyright year paragraph. + Use b4_copyright_years when no years are given. + * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc + (b4_copyright_years): New. + Use it. + +2008-11-04 Akim Demaille + + Avoid the spurious initial empty line. + * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at + the end of @output request to suppress the empty line that + results. + +2008-11-04 Akim Demaille + + Remove parser::rhs_number_type. + * data/lalr1-fusion.cc (rhs_number_type): No longer define it. + (yyrhs_): Use b4_table_define. + +2008-11-04 Akim Demaille + + Fix iteration type. + * data/lalr1-fusion.cc: Use an int to iterate up to an int. + +2008-11-04 Akim Demaille + + Factor the declaration of the integer tables. + * data/lalr1-fusion.cc (b4_table_define): New. + Use it. + +2008-11-03 Akim Demaille + + Fix indentation of tables in lalr1.cc + * data/lalr1-fusion.cc: Fix the indentation. + +2008-11-03 Akim Demaille + + Destroy the lhs symbols after reduction. + * data/lalr1-fusion.cc (parse): After the user action, when in + variant mode, destroy the lhs symbols. + +2008-11-03 Akim Demaille + + Simplify yysyntax_error_ use. + * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token + type, but make it unnamed in the declaration when it is not used. + +2008-11-03 Akim Demaille + + Let yy::variant::build return an lvalue. + * data/lalr1-fusion.cc (variant::build): Return a reference to the + object. + +2008-11-03 Akim Demaille + + Define yy::variant only when needed. + * data/lalr1-fusion.cc (yy::variant): Define only if variants are + used. + +2008-11-03 Akim Demaille + + Bench the three-stack lalr1.cc. + * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the + one-stack one. + +2008-11-03 Akim Demaille + + Fail on parse error in calc++. + * doc/bison.texinfo (calc++.cc): Propagate failures to the exit + status. + * examples/calc++/test ($me, $number, $exit, run): New. + Use them to propagate errors to the exit status. + +2008-11-03 Akim Demaille + + Don't specify the skeleton twice in the example. + * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar + file does what is needed. + +2008-11-03 Akim Demaille + + bench: Improve output. + * etc/bench.pl.in (bench_grammar): Tune the printf format. + +2008-11-03 Akim Demaille + + bench: check impact of %debug on variants. + * etc/bench.pl.in (variant_grammar): Fix the computation of + $variant. + Generate a grammar file that can work with or without %debug. + Do use the @directive. + (bench_variant_parser): Check impact of %debug. + (@directives): Rename all the occurrences to... + (@directive): this, for consistency. + +2008-11-03 Akim Demaille + + bench: report the size too. + * etc/bench.pl.in ($iterations): Defaults to -3. + (&bench_grammar): Require hireswallclock. + Compute and display the size of the result. + More comments. + +2008-11-03 Akim Demaille + + bench: More use of the verbosity level. + * etc/bench.pl.in ($verbose, &verbose): New. + Use them. + More POD documentation. + +2008-11-03 Akim Demaille + + bench.pl: a command line interface + * etc/bench.pl.in: More doc. + Some fixes in the documentation. + ($cflags, $iterations, &help, &getopt): New. + Use them. + (&variant_grammar): Let the number of stages be 10 times what is + specified. + +2008-11-03 Akim Demaille + + Bench the use of Boost.Variants. + * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser): + New. + (&compile): Be ready to compile C++ parsers. + (&bench_push_parser): Move debug information to the outermost + level. + * THANKS: Add Michiel De Wilde. + +2008-11-03 Akim Demaille + + bench.pl: Pass directives as a list instead of as a string. + * etc/bench.pl.in (&directives): New. + (&triangular_grammar, &calc_grammar): Use it to format the Bison + directives. + (&triangular_grammar): Do use the directives (were ignored). + (&bench_grammar, &bench_push_parser): Adjust to pass lists of + directives. + +2008-11-03 Akim Demaille + + Improve genericity of bench.pl. + * etc/bench.pl.in (&bench_grammar): Take the set of benches as + argument. + (&bench_push_parser): New. + Call it. + +2008-11-03 Akim Demaille + + Add documentation to bench.pl. + * etc/bench.pl.in: Comment changes. + +2008-11-03 Akim Demaille + + Fuse the three stacks into a single one. + + In order to make it easy to perform benchmarks to ensure that + there are no performance loss, lalr1.cc is forked into + lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace + lalr1.cc. + + Meanwhile, to make sure that lalr1-fusion.cc is correctly + exercized by the test suite, the user must install a symbolic link + from lalr1.cc to it. + + Instead of having three stacks (state, value, location), use a + stack of triples. This considerably simplifies the code (and it + will be easier not to require locations as currently does the C++ + parser), and also gives a 10% speedup according to + etc/bench (probably mainly since memory allocation is done once + instead of three times). + + Another motivation is to make it easier to destruct properly + semantic values: now that they are bound to their state (hence + symbol type) it will be easier to call the appropriate destructor. + + These changes should probably benefit the C parser too. + + * data/lalr1.cc: Copy as... + * data/lalr1-fusion.cc: this new file. + (b4_rhs_value, b4_rhs_location): New definitions overriding those + from c++.m4. + (state_stack_type, semantic_stack_type, location_stack_type) + (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove. + (data_type, stack_type, yystack_): New. + (YYLLOC_DEFAULT, yypush_): Adjust. + (yyerror_range): Now based on data_type, not location_type. + +2008-11-03 Akim Demaille + + Push the state, value, and location at the same time. + This is needed to prepare a forthcoming patch that fuses the three + stacks into one. + + * data/lalr1.cc (parser::yypush_): New. + (parser::yynewstate): Change the semantics: instead of arriving to + this label when value and location have been pushed, but yystate + is to be pushed on the state stack, now the three of them must + have been pushed before. yystate still must be the new state. + This allows to use yypush_ everywhere instead of individual + handling of the stacks. + +2008-11-03 Akim Demaille + + Prefer references to pointers. + * data/lalr1.cc (b4_symbol_actions): New, overrides the default C + definition to use references instead of pointers. + (yy_symbol_value_print_, yy_symbol_print_, yydestruct_): + Take the value and location as references. + Adjust callers. + +2008-11-03 Akim Demaille + + stack::size instead of stack::height. + * data/lalr1.cc (stack::height): Rename as... + (stack::size): this. + Fix the output type. + Comment changes. + +2008-11-03 Akim Demaille + + Use variants to support objects as semantic values. + This patch was inspired by work by Michiel De Wilde. But he used + Boost variants which (i) requires Boost on the user side, (ii) is + slow, and (iii) has useless overhead (the parser knows the type of + the semantic value there is no reason to duplicate this + information as Boost.Variants do). + + This implementation reserves a buffer large enough to store the + largest objects. yy::variant implements this buffer. It was + implemented with Quentin Hocquet. + + * src/output.c (type_names_output): New. + (output_skeleton): Invoke it. + * data/c++.m4 (b4_variant_if): New. + (b4_symbol_value): If needed, provide a definition for variants. + * data/lalr1.cc (b4_symbol_value, b4_symbol_action_) + (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy) + (b4_char_sizeof, yy::variant): New. + (parser::parse): If variants are requested, define + parser::union_type, parser::variant, change the definition of + semantic_type, construct $$ before running the user action instead + of performing a default $$ = $1. + * examples/variant.yy: New. + Based on an example by Michiel De Wilde. + +2008-11-03 Akim Demaille + + Parameterize the extraction of semantic values. + To make future changes easier, no longer rely on ".TYPE" being the + way to get a semantic value. + + * data/c.m4 (b4_symbol_value): New. + Use it. + * data/c++.m4, data/yacc.c: Use it. + * data/glr.c: Use b4_symbol_value. + (b4_rhs_data): New. + Use it. + +2008-11-03 Akim Demaille + + Prepare easier M4 changes. + * data/lalr1.cc: Use escaped [] instead of literals to prepare + future changes. + 2008-11-02 Joel E. Denny Initiate further development. @@ -24286,8 +26733,8 @@ ----- - Copyright (C) 1987-1988, 1991-2013 Free Software Foundation, - Inc. + Copyright (C) 1987-1988, 1991-2015, 2018 Free Software + Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this diff --git a/GNUmakefile b/GNUmakefile index 8759034..7ee0965 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -5,7 +5,7 @@ # It is necessary if you want to build targets usually of interest # only to the maintainer. -# Copyright (C) 2001, 2003, 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2006-2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # If the user runs GNU make but has not yet run ./configure, # give them a diagnostic. diff --git a/INSTALL b/INSTALL index 007e939..8865734 100644 --- a/INSTALL +++ b/INSTALL @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -Inc. + Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software +Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -12,97 +12,96 @@ without warranty of any kind. Basic Installation ================== - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for + Briefly, the shell command './configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented +'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. - The `configure' shell script attempts to guess correct values for + The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you +some point 'config.cache' contains results you don't want to keep, you may remove or edit it. - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. The simplest way to compile this package is: - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. - Running `configure' might take a while. While running, it prints + Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. - 2. Type `make' to compile the package. + 2. Type 'make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with + 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. - 4. Type `make install' to install the programs and any data files and + 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root + user, and only the 'make install' phase executed with root privileges. - 5. Optionally, type `make installcheck' to repeat any self-tests, but + 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required + regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. - 7. Often, you can also type `make uninstall' to remove the installed + 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. - 8. Some packages, particularly those that use Automake, provide `make + 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. + targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' +the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix @@ -113,21 +112,21 @@ Compiling For Multiple Architectures You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the +own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. - With a non-GNU `make', it is safer to compile the package for one + With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before +installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ @@ -136,105 +135,104 @@ this: This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. +using the 'lipo' tool if you have problems. Installation Names ================== - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or +correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without +'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each -affected directory. For example, `make install +affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the package recognizes. - For packages that use the X Window System, `configure' can usually + For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure +execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure +overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. +overridden with 'make V=0'. Particular systems ================== - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. + HP-UX 'make' updates targets which have the same time stamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try ./configure CC="cc" @@ -242,26 +240,26 @@ and if that doesn't work, try ./configure CC="cc -nodtk" - On Solaris, don't put `/usr/ucb' early in your `PATH'. This + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== - There may be some features `configure' cannot figure out + There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints +_same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM @@ -270,101 +268,101 @@ where SYSTEM can have one of these forms: OS KERNEL-OS - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will +use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. +eventually be run) with '--host=TYPE'. Sharing Defaults ================ - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run +environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: +them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc -causes the specified `gcc' to be used as the C compiler (unless it is +causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf limitation. Until the limitation is lifted, you can use -this workaround: +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash -`configure' Invocation +'configure' Invocation ====================== - `configure' recognizes the following options to control how it + 'configure' recognizes the following options to control how it operates. -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. -`--help=short' -`--help=recursive' +'--help=short' +'--help=recursive' Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' script, and exit. -`--cache-file=FILE' +'--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to + traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. -`--quiet' -`--silent' -`-q' +'--quiet' +'--silent' +'-q' Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error + suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). -`--srcdir=DIR' +'--srcdir=DIR' Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. + 'configure' can determine that directory automatically. -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. -`--no-create' -`-n' +'--no-create' +'-n' Run the configure checks, but stop before creating any output files. -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/Makefile.am b/Makefile.am index 798704d..d03a65b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ -## Process this file with automake to produce Makefile.in -*-Makefile-*- - -## Copyright (C) 2001-2013 Free Software Foundation, Inc. +## Process this file with automake to produce Makefile.in. +# Copyright (C) 2001-2015, 2018 Free Software Foundation, Inc. +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -15,29 +15,54 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +AUTOMAKE_OPTIONS = subdir-objects ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = build-aux po runtime-po lib data src doc examples tests etc +SUBDIRS = po runtime-po . # Files installed for use by Automake. aclocaldir = @aclocaldir@ aclocal_DATA = m4/bison-i18n.m4 -EXTRA_DIST = .prev-version .version \ - cfg.mk ChangeLog-1998 ChangeLog-2012 PACKAGING \ - djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \ - djgpp/config.sed djgpp/config.site djgpp/config_h.sed \ - djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \ - djgpp/fnchange.lst djgpp/testsuite.sed +EXTRA_DIST = .prev-version .version cfg.mk PACKAGING \ + ChangeLog-1998 ChangeLog-2012 ChangeLog + +dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO + +## Running the bison from this tarball. To generate our own parser, +## but also to run the tests. Of course, you ought to keep a sane +## version of Bison nearby... +BISON = $(top_builddir)/tests/bison +BISON_IN = $(top_srcdir)/tests/bison.in +YACC = $(BISON) -o y.tab.c +AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all + +# Initialization before completion by local.mk's. +AM_CFLAGS = $(WARN_CFLAGS) +# Find builddir/src/scan-code.c etc. For some reason "-I./lib" +# instead of "-Ilib" avoids infinite recursions on #include_next. +AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib +BUILT_SOURCES = +CLEANFILES = +DISTCLEANFILES = +EXTRA_DIST += $(dist_TESTS) +MOSTLYCLEANDIRS = +MOSTLYCLEANFILES = +SUFFIXES = +TESTS = $(dist_TESTS) +check_PROGRAMS = +dist_TESTS = +noinst_LIBRARIES = -MAINTAINER_CHECKS = \ - maintainer-check \ - maintainer-push-check \ - maintainer-xml-check \ - maintainer-release-check -.PHONY: $(MAINTAINER_CHECKS) -$(MAINTAINER_CHECKS): - $(AM_V_GEN)cd tests && $(MAKE) $(AM_MAKEFLAGS) $@ +include build-aux/local.mk +include data/local.mk +include djgpp/local.mk +include doc/local.mk +include etc/local.mk +include examples/local.mk +include lib/local.mk +include src/local.mk +include tests/local.mk # See comments in build-aux/git-version-gen. However, we make .version depend # on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the @@ -48,11 +73,11 @@ $(MAINTAINER_CHECKS): # a developer might naively reference .version in a test case while the bison # executable still compiles with VERSION, and so the test case might fail or # pass incorrectly. -BUILT_SOURCES = $(top_srcdir)/.version +BUILT_SOURCES += $(top_srcdir)/.version $(top_srcdir)/.version: configure - $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@ + echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: gen-ChangeLog - $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version + echo $(VERSION) > $(distdir)/.tarball-version .PHONY: update-b4-copyright update-package-copyright-year update-b4-copyright: diff --git a/Makefile.in b/Makefile.in index cf98845..3824acd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,154 @@ @SET_MAKE@ +# Copyright (C) 2001-2015, 2018 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2000-2015, 2018 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2005, 2008-2015, 2018 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2005-2006, 2008-2015, 2018 Free Software Foundation, +# Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2005-2006, 2008-2015, 2018 Free Software Foundation, +# Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2005-2006, 2008-2015, 2018 Free Software Foundation, +# Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2001-2015, 2018 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see . +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# Generated by gnulib-tool. +# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libbison --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl argmatch assert c-strcase calloc-posix close closeout config-h configmake dirname error extensions fdl fopen-safer fprintf-posix getopt-gnu gettext git-version-gen gitlog-to-changelog gpl-3.0 hash inttypes isnan javacomp-script javaexec-script ldexpl malloc-gnu mbswidth non-recursive-gnulib-prefix-hack obstack obstack-printf perror printf-posix progname quote quotearg readme-release realloc-posix snprintf-posix spawn-pipe sprintf-posix stdbool stpcpy strdup-posix strerror strverscmp unistd unistd-safer unlink unlocked-io unsetenv update-copyright verify vsnprintf-posix vsprintf-posix warnings xalloc xalloc-die xconcat-filename xmemdup0 xstrndup + +# Copyright (C) 2001-2015, 2018 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (C) 2000-2015, 2018 Free Software Foundation, Inc. +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -27,24 +175,65 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . + + + VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -62,33 +251,30 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +check_PROGRAMS = $(am__EXEEXT_1) examples/mfcalc/mfcalc$(EXEEXT) \ + examples/rpcalc/rpcalc$(EXEEXT) +@CROSS_COMPILING_FALSE@am__append_1 = $(top_srcdir)/doc/bison.help +@FLEX_CXX_WORKS_TRUE@am__append_2 = examples/calc++/calc++ +@FLEX_CXX_WORKS_TRUE@am__append_3 = examples/calc++/calc++.test +@FLEX_CXX_WORKS_FALSE@am__append_4 = examples/calc++/calc++.test +@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__append_5 = lib/uniwidth/width.c +bin_PROGRAMS = src/bison$(EXEEXT) subdir = . -DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ - $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(top_srcdir)/build-aux/javacomp.sh.in \ - $(top_srcdir)/build-aux/javaexec.sh.in ABOUT-NLS COPYING \ - THANKS TODO $(top_srcdir)/build-aux/compile \ - $(top_srcdir)/build-aux/config.guess \ - $(top_srcdir)/build-aux/config.rpath \ - $(top_srcdir)/build-aux/config.sub \ - $(top_srcdir)/build-aux/install-sh \ - $(top_srcdir)/build-aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ - $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/bison-i18n.m4 \ - $(top_srcdir)/m4/c-working.m4 $(top_srcdir)/m4/calloc.m4 \ - $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \ - $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ - $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \ - $(top_srcdir)/m4/cxx.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dmalloc.m4 \ + $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \ + $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \ + $(top_srcdir)/m4/bison-i18n.m4 $(top_srcdir)/m4/c-working.m4 \ + $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/close-stream.m4 \ + $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closeout.m4 \ + $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \ + $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/cxx.m4 \ + $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dmalloc.m4 \ $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ - $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \ - $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ - $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \ + $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \ + $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \ + $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/extern-inline.m4 \ $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl-o.m4 \ $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ @@ -97,35 +283,39 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \ $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ $(top_srcdir)/m4/fseterr.m4 $(top_srcdir)/m4/fstat.m4 \ - $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getdtablesize.m4 \ - $(top_srcdir)/m4/getline.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ - $(top_srcdir)/m4/gnulib-common.m4 \ - $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/gnulib-comp.m4 \ + $(top_srcdir)/m4/hard-locale.m4 \ + $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/include_next.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnan.m4 \ $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \ - $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/iswblank.m4 \ - $(top_srcdir)/m4/javacomp.m4 $(top_srcdir)/m4/javaexec.m4 \ - $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/ldexp.m4 \ - $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/javacomp.m4 \ + $(top_srcdir)/m4/javaexec.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libunistring-base.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ - $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ - $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/lock.m4 \ + $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/malloc.m4 \ - $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ - $(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/memchr.m4 \ + $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/math_h.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbswidth.m4 \ + $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \ $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \ $(top_srcdir)/m4/msvc-inval.m4 \ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ - $(top_srcdir)/m4/obstack-printf.m4 $(top_srcdir)/m4/off_t.m4 \ + $(top_srcdir)/m4/non-recursive-gnulib-prefix-hack.m4 \ + $(top_srcdir)/m4/obstack-printf.m4 $(top_srcdir)/m4/obstack.m4 \ + $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \ $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe2.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \ @@ -133,6 +323,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/printf-frexpl.m4 \ $(top_srcdir)/m4/printf-posix-rpl.m4 \ $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/sched_h.m4 \ @@ -143,21 +334,22 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/snprintf-posix.m4 \ $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/spawn-pipe.m4 \ $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/sprintf-posix.m4 \ - $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \ - $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ - $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \ - $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \ - $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ - $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strverscmp.m4 \ + $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat-time.m4 \ + $(top_srcdir)/m4/stat.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ + $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/stdio_h.m4 \ + $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/stpcpy.m4 \ + $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/strerror_r.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \ + $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strverscmp.m4 \ $(top_srcdir)/m4/sys_socket_h.m4 \ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_types_h.m4 \ $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/threadlib.m4 \ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/timevar.m4 \ $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ - $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/unlink.m4 $(top_srcdir)/m4/unlocked-io.m4 \ + $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vfprintf-posix.m4 \ $(top_srcdir)/m4/vsnprintf-posix.m4 \ $(top_srcdir)/m4/vsnprintf.m4 \ @@ -171,39 +363,27 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(dist_noinst_SCRIPTS) \ + $(srcdir)/doc/version.texi $(srcdir)/doc/stamp-vti \ + $(dist_doc_DATA) $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) \ + $(dist_xslt_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/config.h -CONFIG_CLEAN_FILES = javacomp.sh javaexec.sh +CONFIG_CLEAN_FILES = javacomp.sh javaexec.sh etc/bench.pl \ + tests/atlocal tests/bison doc/yacc.1 CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(aclocaldir)" \ + "$(DESTDIR)$(calcxxdir)" "$(DESTDIR)$(docdir)" \ + "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)" \ + "$(DESTDIR)$(xsltdir)" "$(DESTDIR)$(mfcalcdir)" \ + "$(DESTDIR)$(rpcalcdir)" +@FLEX_CXX_WORKS_TRUE@am__EXEEXT_1 = examples/calc++/calc++$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -231,8 +411,368 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(aclocaldir)" -DATA = $(aclocal_DATA) +LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES) +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +lib_libbison_a_AR = $(AR) $(ARFLAGS) +am__DEPENDENCIES_1 = +am__lib_libbison_a_SOURCES_DIST = lib/argmatch.c lib/binary-io.h \ + lib/binary-io.c lib/bitrotate.h lib/bitrotate.c lib/c-ctype.h \ + lib/c-ctype.c lib/c-strcase.h lib/c-strcasecmp.c \ + lib/c-strncasecmp.c lib/cloexec.c lib/close-stream.c \ + lib/closeout.c lib/concat-filename.c lib/dirname.c \ + lib/basename.c lib/dirname-lgpl.c lib/basename-lgpl.c \ + lib/stripslash.c lib/exitfail.c lib/fatal-signal.h \ + lib/fatal-signal.c lib/fd-hook.c lib/fd-safer-flag.c \ + lib/dup-safer-flag.c lib/fopen-safer.c lib/getprogname.h \ + lib/getprogname.c lib/gettext.h lib/hard-locale.c lib/hash.c \ + lib/localcharset.h lib/localcharset.c lib/glthread/lock.h \ + lib/glthread/lock.c lib/malloca.c lib/math.c lib/mbswidth.h \ + lib/mbswidth.c lib/minmax.h lib/pipe2.c lib/pipe2-safer.c \ + lib/printf-frexp.c lib/printf-frexpl.c lib/progname.h \ + lib/progname.c lib/quotearg.c lib/sig-handler.c lib/size_max.h \ + lib/spawn-pipe.h lib/spawn-pipe.c lib/w32spawn.h \ + lib/stat-time.c lib/glthread/threadlib.c lib/unistd.c \ + lib/dup-safer.c lib/fd-safer.c lib/pipe-safer.c \ + lib/uniwidth/width.c lib/wait-process.h lib/wait-process.c \ + lib/wctype-h.c lib/xmalloc.c lib/xalloc-die.c \ + lib/xconcat-filename.c lib/xsize.h lib/xsize.c lib/xstrndup.h \ + lib/xstrndup.c lib/abitset.c lib/abitset.h lib/bbitset.h \ + lib/bitset.c lib/bitset.h lib/bitset_stats.c \ + lib/bitset_stats.h lib/bitsetv.c lib/bitsetv.h lib/ebitset.c \ + lib/ebitset.h lib/lbitset.c lib/lbitset.h lib/libiberty.h \ + lib/vbitset.c lib/vbitset.h lib/bitsetv-print.h \ + lib/bitsetv-print.c lib/timevar.h lib/timevar.c \ + lib/timevar.def lib/get-errno.h lib/get-errno.c +am__dirstamp = $(am__leading_dot)dirstamp +@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__objects_1 = lib/uniwidth/width.$(OBJEXT) +am_lib_libbison_a_OBJECTS = lib/argmatch.$(OBJEXT) \ + lib/binary-io.$(OBJEXT) lib/bitrotate.$(OBJEXT) \ + lib/c-ctype.$(OBJEXT) lib/c-strcasecmp.$(OBJEXT) \ + lib/c-strncasecmp.$(OBJEXT) lib/cloexec.$(OBJEXT) \ + lib/close-stream.$(OBJEXT) lib/closeout.$(OBJEXT) \ + lib/concat-filename.$(OBJEXT) lib/dirname.$(OBJEXT) \ + lib/basename.$(OBJEXT) lib/dirname-lgpl.$(OBJEXT) \ + lib/basename-lgpl.$(OBJEXT) lib/stripslash.$(OBJEXT) \ + lib/exitfail.$(OBJEXT) lib/fatal-signal.$(OBJEXT) \ + lib/fd-hook.$(OBJEXT) lib/fd-safer-flag.$(OBJEXT) \ + lib/dup-safer-flag.$(OBJEXT) lib/fopen-safer.$(OBJEXT) \ + lib/getprogname.$(OBJEXT) lib/hard-locale.$(OBJEXT) \ + lib/hash.$(OBJEXT) lib/localcharset.$(OBJEXT) \ + lib/glthread/lock.$(OBJEXT) lib/malloca.$(OBJEXT) \ + lib/math.$(OBJEXT) lib/mbswidth.$(OBJEXT) lib/pipe2.$(OBJEXT) \ + lib/pipe2-safer.$(OBJEXT) lib/printf-frexp.$(OBJEXT) \ + lib/printf-frexpl.$(OBJEXT) lib/progname.$(OBJEXT) \ + lib/quotearg.$(OBJEXT) lib/sig-handler.$(OBJEXT) \ + lib/spawn-pipe.$(OBJEXT) lib/stat-time.$(OBJEXT) \ + lib/glthread/threadlib.$(OBJEXT) lib/unistd.$(OBJEXT) \ + lib/dup-safer.$(OBJEXT) lib/fd-safer.$(OBJEXT) \ + lib/pipe-safer.$(OBJEXT) $(am__objects_1) \ + lib/wait-process.$(OBJEXT) lib/wctype-h.$(OBJEXT) \ + lib/xmalloc.$(OBJEXT) lib/xalloc-die.$(OBJEXT) \ + lib/xconcat-filename.$(OBJEXT) lib/xsize.$(OBJEXT) \ + lib/xstrndup.$(OBJEXT) lib/abitset.$(OBJEXT) \ + lib/bitset.$(OBJEXT) lib/bitset_stats.$(OBJEXT) \ + lib/bitsetv.$(OBJEXT) lib/ebitset.$(OBJEXT) \ + lib/lbitset.$(OBJEXT) lib/vbitset.$(OBJEXT) \ + lib/bitsetv-print.$(OBJEXT) lib/timevar.$(OBJEXT) \ + lib/get-errno.$(OBJEXT) +lib_libbison_a_OBJECTS = $(am_lib_libbison_a_OBJECTS) +lib_liby_a_AR = $(AR) $(ARFLAGS) +lib_liby_a_LIBADD = +am__lib_liby_a_SOURCES_DIST = lib/main.c lib/yyerror.c +@ENABLE_YACC_TRUE@am_lib_liby_a_OBJECTS = lib/main.$(OBJEXT) \ +@ENABLE_YACC_TRUE@ lib/yyerror.$(OBJEXT) +lib_liby_a_OBJECTS = $(am_lib_liby_a_OBJECTS) +am__objects_2 = examples/calc++/calc__-calc++-driver.$(OBJEXT) \ + examples/calc++/calc__-calc++-scanner.$(OBJEXT) \ + examples/calc++/calc__-calc++.$(OBJEXT) +am__objects_3 = examples/calc++/calc__-calc++-parser.$(OBJEXT) +am__objects_4 = $(am__objects_2) $(am__objects_3) +@FLEX_CXX_WORKS_TRUE@nodist_examples_calc___calc___OBJECTS = \ +@FLEX_CXX_WORKS_TRUE@ $(am__objects_4) +examples_calc___calc___OBJECTS = \ + $(nodist_examples_calc___calc___OBJECTS) +examples_calc___calc___LDADD = $(LDADD) +examples_calc___calc___DEPENDENCIES = lib/libbison.a \ + $(am__DEPENDENCIES_1) +examples_calc___calc___LINK = $(CXXLD) \ + $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__objects_5 = examples/mfcalc/mfcalc-mfcalc.$(OBJEXT) +am__objects_6 = $(am__objects_5) +nodist_examples_mfcalc_mfcalc_OBJECTS = $(am__objects_6) +examples_mfcalc_mfcalc_OBJECTS = \ + $(nodist_examples_mfcalc_mfcalc_OBJECTS) +examples_mfcalc_mfcalc_DEPENDENCIES = +am__objects_7 = examples/rpcalc/rpcalc-rpcalc.$(OBJEXT) +am__objects_8 = $(am__objects_7) +nodist_examples_rpcalc_rpcalc_OBJECTS = $(am__objects_8) +examples_rpcalc_rpcalc_OBJECTS = \ + $(nodist_examples_rpcalc_rpcalc_OBJECTS) +examples_rpcalc_rpcalc_DEPENDENCIES = +am_src_bison_OBJECTS = src/bison-AnnotationList.$(OBJEXT) \ + src/bison-InadequacyList.$(OBJEXT) src/bison-LR0.$(OBJEXT) \ + src/bison-Sbitset.$(OBJEXT) src/bison-assoc.$(OBJEXT) \ + src/bison-closure.$(OBJEXT) src/bison-complain.$(OBJEXT) \ + src/bison-conflicts.$(OBJEXT) src/bison-derives.$(OBJEXT) \ + src/bison-files.$(OBJEXT) src/bison-getargs.$(OBJEXT) \ + src/bison-gram.$(OBJEXT) src/bison-graphviz.$(OBJEXT) \ + src/bison-lalr.$(OBJEXT) src/bison-ielr.$(OBJEXT) \ + src/bison-location.$(OBJEXT) src/bison-main.$(OBJEXT) \ + src/bison-muscle-tab.$(OBJEXT) src/bison-named-ref.$(OBJEXT) \ + src/bison-nullable.$(OBJEXT) src/bison-output.$(OBJEXT) \ + src/bison-parse-gram.$(OBJEXT) src/bison-print-xml.$(OBJEXT) \ + src/bison-print.$(OBJEXT) src/bison-print_graph.$(OBJEXT) \ + src/bison-reader.$(OBJEXT) src/bison-reduce.$(OBJEXT) \ + src/bison-relation.$(OBJEXT) src/bison-scan-code-c.$(OBJEXT) \ + src/bison-scan-gram-c.$(OBJEXT) \ + src/bison-scan-skel-c.$(OBJEXT) src/bison-state.$(OBJEXT) \ + src/bison-symlist.$(OBJEXT) src/bison-symtab.$(OBJEXT) \ + src/bison-tables.$(OBJEXT) src/bison-uniqstr.$(OBJEXT) +src_bison_OBJECTS = $(am_src_bison_OBJECTS) +src_bison_LDADD = $(LDADD) +src_bison_DEPENDENCIES = lib/libbison.a $(am__DEPENDENCIES_1) +src_bison_LINK = $(CCLD) $(src_bison_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SCRIPTS = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS) \ + $(nodist_noinst_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = \ + examples/calc++/$(DEPDIR)/calc__-calc++-driver.Po \ + examples/calc++/$(DEPDIR)/calc__-calc++-parser.Po \ + examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Po \ + examples/calc++/$(DEPDIR)/calc__-calc++.Po \ + examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Po \ + examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Po \ + lib/$(DEPDIR)/abitset.Po lib/$(DEPDIR)/argmatch.Po \ + lib/$(DEPDIR)/asnprintf.Po lib/$(DEPDIR)/basename-lgpl.Po \ + lib/$(DEPDIR)/basename.Po lib/$(DEPDIR)/binary-io.Po \ + lib/$(DEPDIR)/bitrotate.Po lib/$(DEPDIR)/bitset.Po \ + lib/$(DEPDIR)/bitset_stats.Po lib/$(DEPDIR)/bitsetv-print.Po \ + lib/$(DEPDIR)/bitsetv.Po lib/$(DEPDIR)/c-ctype.Po \ + lib/$(DEPDIR)/c-strcasecmp.Po lib/$(DEPDIR)/c-strncasecmp.Po \ + lib/$(DEPDIR)/calloc.Po lib/$(DEPDIR)/cloexec.Po \ + lib/$(DEPDIR)/close-stream.Po lib/$(DEPDIR)/close.Po \ + lib/$(DEPDIR)/closeout.Po lib/$(DEPDIR)/concat-filename.Po \ + lib/$(DEPDIR)/dirname-lgpl.Po lib/$(DEPDIR)/dirname.Po \ + lib/$(DEPDIR)/dup-safer-flag.Po lib/$(DEPDIR)/dup-safer.Po \ + lib/$(DEPDIR)/dup2.Po lib/$(DEPDIR)/ebitset.Po \ + lib/$(DEPDIR)/error.Po lib/$(DEPDIR)/exitfail.Po \ + lib/$(DEPDIR)/fatal-signal.Po lib/$(DEPDIR)/fcntl.Po \ + lib/$(DEPDIR)/fd-hook.Po lib/$(DEPDIR)/fd-safer-flag.Po \ + lib/$(DEPDIR)/fd-safer.Po lib/$(DEPDIR)/float.Po \ + lib/$(DEPDIR)/fopen-safer.Po lib/$(DEPDIR)/fopen.Po \ + lib/$(DEPDIR)/fpending.Po lib/$(DEPDIR)/fprintf.Po \ + lib/$(DEPDIR)/frexp.Po lib/$(DEPDIR)/frexpl.Po \ + lib/$(DEPDIR)/fseterr.Po lib/$(DEPDIR)/fstat.Po \ + lib/$(DEPDIR)/get-errno.Po lib/$(DEPDIR)/getdtablesize.Po \ + lib/$(DEPDIR)/getopt.Po lib/$(DEPDIR)/getopt1.Po \ + lib/$(DEPDIR)/getprogname.Po lib/$(DEPDIR)/hard-locale.Po \ + lib/$(DEPDIR)/hash.Po lib/$(DEPDIR)/isnan.Po \ + lib/$(DEPDIR)/isnand.Po lib/$(DEPDIR)/isnanf.Po \ + lib/$(DEPDIR)/isnanl.Po lib/$(DEPDIR)/itold.Po \ + lib/$(DEPDIR)/lbitset.Po lib/$(DEPDIR)/ldexpl.Po \ + lib/$(DEPDIR)/localcharset.Po lib/$(DEPDIR)/lstat.Po \ + lib/$(DEPDIR)/main.Po lib/$(DEPDIR)/malloc.Po \ + lib/$(DEPDIR)/malloca.Po lib/$(DEPDIR)/math.Po \ + lib/$(DEPDIR)/mbrtowc.Po lib/$(DEPDIR)/mbsinit.Po \ + lib/$(DEPDIR)/mbswidth.Po lib/$(DEPDIR)/memchr.Po \ + lib/$(DEPDIR)/msvc-inval.Po lib/$(DEPDIR)/msvc-nothrow.Po \ + lib/$(DEPDIR)/obstack.Po lib/$(DEPDIR)/obstack_printf.Po \ + lib/$(DEPDIR)/open.Po lib/$(DEPDIR)/perror.Po \ + lib/$(DEPDIR)/pipe-safer.Po lib/$(DEPDIR)/pipe2-safer.Po \ + lib/$(DEPDIR)/pipe2.Po lib/$(DEPDIR)/printf-args.Po \ + lib/$(DEPDIR)/printf-frexp.Po lib/$(DEPDIR)/printf-frexpl.Po \ + lib/$(DEPDIR)/printf-parse.Po lib/$(DEPDIR)/printf.Po \ + lib/$(DEPDIR)/progname.Po lib/$(DEPDIR)/quotearg.Po \ + lib/$(DEPDIR)/raise.Po lib/$(DEPDIR)/rawmemchr.Po \ + lib/$(DEPDIR)/realloc.Po lib/$(DEPDIR)/sig-handler.Po \ + lib/$(DEPDIR)/sigaction.Po lib/$(DEPDIR)/signbitd.Po \ + lib/$(DEPDIR)/signbitf.Po lib/$(DEPDIR)/signbitl.Po \ + lib/$(DEPDIR)/sigprocmask.Po lib/$(DEPDIR)/snprintf.Po \ + lib/$(DEPDIR)/spawn-pipe.Po \ + lib/$(DEPDIR)/spawn_faction_addclose.Po \ + lib/$(DEPDIR)/spawn_faction_adddup2.Po \ + lib/$(DEPDIR)/spawn_faction_addopen.Po \ + lib/$(DEPDIR)/spawn_faction_destroy.Po \ + lib/$(DEPDIR)/spawn_faction_init.Po \ + lib/$(DEPDIR)/spawnattr_destroy.Po \ + lib/$(DEPDIR)/spawnattr_init.Po \ + lib/$(DEPDIR)/spawnattr_setflags.Po \ + lib/$(DEPDIR)/spawnattr_setsigmask.Po lib/$(DEPDIR)/spawni.Po \ + lib/$(DEPDIR)/spawnp.Po lib/$(DEPDIR)/sprintf.Po \ + lib/$(DEPDIR)/stat-time.Po lib/$(DEPDIR)/stat-w32.Po \ + lib/$(DEPDIR)/stat.Po lib/$(DEPDIR)/stpcpy.Po \ + lib/$(DEPDIR)/strchrnul.Po lib/$(DEPDIR)/strdup.Po \ + lib/$(DEPDIR)/strerror-override.Po lib/$(DEPDIR)/strerror.Po \ + lib/$(DEPDIR)/strerror_r.Po lib/$(DEPDIR)/stripslash.Po \ + lib/$(DEPDIR)/strndup.Po lib/$(DEPDIR)/strnlen.Po \ + lib/$(DEPDIR)/strverscmp.Po lib/$(DEPDIR)/timevar.Po \ + lib/$(DEPDIR)/unistd.Po lib/$(DEPDIR)/unlink.Po \ + lib/$(DEPDIR)/unsetenv.Po lib/$(DEPDIR)/vasnprintf.Po \ + lib/$(DEPDIR)/vbitset.Po lib/$(DEPDIR)/vfprintf.Po \ + lib/$(DEPDIR)/vsnprintf.Po lib/$(DEPDIR)/vsprintf.Po \ + lib/$(DEPDIR)/wait-process.Po lib/$(DEPDIR)/waitpid.Po \ + lib/$(DEPDIR)/wctype-h.Po lib/$(DEPDIR)/wcwidth.Po \ + lib/$(DEPDIR)/xalloc-die.Po lib/$(DEPDIR)/xconcat-filename.Po \ + lib/$(DEPDIR)/xmalloc.Po lib/$(DEPDIR)/xmemdup0.Po \ + lib/$(DEPDIR)/xsize.Po lib/$(DEPDIR)/xstrndup.Po \ + lib/$(DEPDIR)/yyerror.Po lib/glthread/$(DEPDIR)/lock.Po \ + lib/glthread/$(DEPDIR)/threadlib.Po \ + lib/uniwidth/$(DEPDIR)/width.Po \ + src/$(DEPDIR)/bison-AnnotationList.Po \ + src/$(DEPDIR)/bison-InadequacyList.Po \ + src/$(DEPDIR)/bison-LR0.Po src/$(DEPDIR)/bison-Sbitset.Po \ + src/$(DEPDIR)/bison-assoc.Po src/$(DEPDIR)/bison-closure.Po \ + src/$(DEPDIR)/bison-complain.Po \ + src/$(DEPDIR)/bison-conflicts.Po \ + src/$(DEPDIR)/bison-derives.Po src/$(DEPDIR)/bison-files.Po \ + src/$(DEPDIR)/bison-getargs.Po src/$(DEPDIR)/bison-gram.Po \ + src/$(DEPDIR)/bison-graphviz.Po src/$(DEPDIR)/bison-ielr.Po \ + src/$(DEPDIR)/bison-lalr.Po src/$(DEPDIR)/bison-location.Po \ + src/$(DEPDIR)/bison-main.Po src/$(DEPDIR)/bison-muscle-tab.Po \ + src/$(DEPDIR)/bison-named-ref.Po \ + src/$(DEPDIR)/bison-nullable.Po src/$(DEPDIR)/bison-output.Po \ + src/$(DEPDIR)/bison-parse-gram.Po \ + src/$(DEPDIR)/bison-print-xml.Po src/$(DEPDIR)/bison-print.Po \ + src/$(DEPDIR)/bison-print_graph.Po \ + src/$(DEPDIR)/bison-reader.Po src/$(DEPDIR)/bison-reduce.Po \ + src/$(DEPDIR)/bison-relation.Po \ + src/$(DEPDIR)/bison-scan-code-c.Po \ + src/$(DEPDIR)/bison-scan-code.Po \ + src/$(DEPDIR)/bison-scan-gram-c.Po \ + src/$(DEPDIR)/bison-scan-gram.Po \ + src/$(DEPDIR)/bison-scan-skel-c.Po \ + src/$(DEPDIR)/bison-scan-skel.Po src/$(DEPDIR)/bison-state.Po \ + src/$(DEPDIR)/bison-symlist.Po src/$(DEPDIR)/bison-symtab.Po \ + src/$(DEPDIR)/bison-tables.Po src/$(DEPDIR)/bison-uniqstr.Po +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) +AM_V_LEX = $(am__v_LEX_@AM_V@) +am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) +am__v_LEX_0 = @echo " LEX " $@; +am__v_LEX_1 = +YLWRAP = $(top_srcdir)/build-aux/ylwrap +am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ + -e s/c++$$/h++/ -e s/c$$/h/ +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_@AM_V@) +am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) +am__v_YACC_0 = @echo " YACC " $@; +am__v_YACC_1 = +SOURCES = $(lib_libbison_a_SOURCES) $(EXTRA_lib_libbison_a_SOURCES) \ + $(lib_liby_a_SOURCES) $(nodist_examples_calc___calc___SOURCES) \ + $(nodist_examples_mfcalc_mfcalc_SOURCES) \ + $(nodist_examples_rpcalc_rpcalc_SOURCES) $(src_bison_SOURCES) \ + $(EXTRA_src_bison_SOURCES) +DIST_SOURCES = $(am__lib_libbison_a_SOURCES_DIST) \ + $(EXTRA_lib_libbison_a_SOURCES) $(am__lib_liby_a_SOURCES_DIST) \ + $(src_bison_SOURCES) $(EXTRA_src_bison_SOURCES) +AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) +am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) +am__v_DVIPS_0 = @echo " DVIPS " $@; +am__v_DVIPS_1 = +AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) +am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) +am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; +am__v_MAKEINFO_1 = +AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) +am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) +am__v_INFOHTML_0 = @echo " INFOHTML" $@; +am__v_INFOHTML_1 = +AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) +am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) +am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; +am__v_TEXI2DVI_1 = +AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) +am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) +am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; +am__v_TEXI2PDF_1 = +AM_V_texinfo = $(am__v_texinfo_@AM_V@) +am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) +am__v_texinfo_0 = -q +am__v_texinfo_1 = +AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) +am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) +am__v_texidevnull_0 = > /dev/null +am__v_texidevnull_1 = +INFO_DEPS = $(srcdir)/doc/bison.info +TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux +DVIS = doc/bison.dvi +PDFS = doc/bison.pdf +PSS = doc/bison.ps +HTMLS = doc/bison.html +TEXINFOS = doc/bison.texi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(dist_man_MANS) $(nodist_man_MANS) +DATA = $(aclocal_DATA) $(calcxx_DATA) $(dist_doc_DATA) \ + $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) $(dist_xslt_DATA) \ + $(mfcalc_DATA) $(rpcalc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -240,7 +780,8 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck + cscope check recheck distdir distdir-am dist dist-all \ + distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -261,7 +802,211 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags CSCOPE = cscope +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(dist_man_MANS) $(doc_bison_TEXINFOS) \ + $(srcdir)/Makefile.in $(srcdir)/build-aux/local.mk \ + $(srcdir)/data/local.mk $(srcdir)/djgpp/local.mk \ + $(srcdir)/doc/local.mk $(srcdir)/etc/local.mk \ + $(srcdir)/examples/calc++/local.mk $(srcdir)/examples/local.mk \ + $(srcdir)/examples/mfcalc/local.mk \ + $(srcdir)/examples/rpcalc/local.mk $(srcdir)/lib/gnulib.mk \ + $(srcdir)/lib/local.mk $(srcdir)/src/local.mk \ + $(srcdir)/tests/local.mk $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/javacomp.sh.in \ + $(top_srcdir)/build-aux/javaexec.sh.in \ + $(top_srcdir)/build-aux/mdate-sh \ + $(top_srcdir)/build-aux/missing \ + $(top_srcdir)/build-aux/test-driver \ + $(top_srcdir)/build-aux/texinfo.tex \ + $(top_srcdir)/build-aux/ylwrap $(top_srcdir)/doc/yacc.1.in \ + $(top_srcdir)/etc/bench.pl.in $(top_srcdir)/lib/config.in.h \ + $(top_srcdir)/tests/atlocal.in $(top_srcdir)/tests/bison.in \ + ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README \ + README-alpha THANKS TODO build-aux/compile \ + build-aux/config.guess build-aux/config.rpath \ + build-aux/config.sub build-aux/depcomp build-aux/install-sh \ + build-aux/mdate-sh build-aux/missing build-aux/texinfo.tex \ + build-aux/ylwrap src/parse-gram.c src/parse-gram.h \ + src/scan-code.c src/scan-gram.c src/scan-skel.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -358,8 +1103,10 @@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ EXEEXT = @EXEEXT@ +FLEX_SCANNER_CXXFLAGS = @FLEX_SCANNER_CXXFLAGS@ FLOAT_H = @FLOAT_H@ GCC = @GCC@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ GETOPT_H = @GETOPT_H@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIBC21 = @GLIBC21@ @@ -391,6 +1138,7 @@ GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@ GNULIB_COSF = @GNULIB_COSF@ GNULIB_COSHF = @GNULIB_COSHF@ GNULIB_COSL = @GNULIB_COSL@ +GNULIB_CTIME = @GNULIB_CTIME@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ @@ -402,6 +1150,7 @@ GNULIB_EXP2F = @GNULIB_EXP2F@ GNULIB_EXP2L = @GNULIB_EXP2L@ GNULIB_EXPF = @GNULIB_EXPF@ GNULIB_EXPL = @GNULIB_EXPL@ +GNULIB_EXPLICIT_BZERO = @GNULIB_EXPLICIT_BZERO@ GNULIB_EXPM1 = @GNULIB_EXPM1@ GNULIB_EXPM1F = @GNULIB_EXPM1F@ GNULIB_EXPM1L = @GNULIB_EXPM1L@ @@ -465,6 +1214,7 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ @@ -492,6 +1242,7 @@ GNULIB_LDEXPF = @GNULIB_LDEXPF@ GNULIB_LDEXPL = @GNULIB_LDEXPL@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ +GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ GNULIB_LOG = @GNULIB_LOG@ GNULIB_LOG10 = @GNULIB_LOG10@ GNULIB_LOG10F = @GNULIB_LOG10F@ @@ -554,6 +1305,8 @@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ GNULIB_OPEN = @GNULIB_OPEN@ GNULIB_OPENAT = @GNULIB_OPENAT@ +GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -593,6 +1346,7 @@ GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PUTS = @GNULIB_PUTS@ GNULIB_PWRITE = @GNULIB_PWRITE@ +GNULIB_QSORT_R = @GNULIB_QSORT_R@ GNULIB_RAISE = @GNULIB_RAISE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ @@ -600,6 +1354,7 @@ GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ +GNULIB_REALLOCARRAY = @GNULIB_REALLOCARRAY@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_REMAINDER = @GNULIB_REMAINDER@ @@ -642,6 +1397,7 @@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ +GNULIB_STRFTIME = @GNULIB_STRFTIME@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ @@ -665,12 +1421,15 @@ GNULIB_TANHF = @GNULIB_TANHF@ GNULIB_TANL = @GNULIB_TANL@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ GNULIB_TIME_R = @GNULIB_TIME_R@ +GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ GNULIB_TRUNC = @GNULIB_TRUNC@ +GNULIB_TRUNCATE = @GNULIB_TRUNCATE@ GNULIB_TRUNCF = @GNULIB_TRUNCF@ GNULIB_TRUNCL = @GNULIB_TRUNCL@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ +GNULIB_TZSET = @GNULIB_TZSET@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ @@ -701,6 +1460,7 @@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ GNULIB_WCSCPY = @GNULIB_WCSCPY@ GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ GNULIB_WCSDUP = @GNULIB_WCSDUP@ +GNULIB_WCSFTIME = @GNULIB_WCSFTIME@ GNULIB_WCSLEN = @GNULIB_WCSLEN@ GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ @@ -738,6 +1498,7 @@ HAVE_ATANF = @HAVE_ATANF@ HAVE_ATANL = @HAVE_ATANL@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CBRT = @HAVE_CBRT@ HAVE_CBRTF = @HAVE_CBRTF@ @@ -748,6 +1509,7 @@ HAVE_COPYSIGNL = @HAVE_COPYSIGNL@ HAVE_COSF = @HAVE_COSF@ HAVE_COSHF = @HAVE_COSHF@ HAVE_COSL = @HAVE_COSL@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ @@ -775,11 +1537,13 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@ @@ -799,6 +1563,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@ HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@ HAVE_DECL_SINL = @HAVE_DECL_SINL@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ @@ -825,6 +1590,7 @@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_EXPF = @HAVE_EXPF@ HAVE_EXPL = @HAVE_EXPL@ +HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@ HAVE_EXPM1 = @HAVE_EXPM1@ HAVE_EXPM1F = @HAVE_EXPM1F@ HAVE_FABSF = @HAVE_FABSF@ @@ -902,6 +1668,7 @@ HAVE_LOGF = @HAVE_LOGF@ HAVE_LOGL = @HAVE_LOGL@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBRLEN = @HAVE_MBRLEN@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ @@ -941,6 +1708,7 @@ HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RAISE = @HAVE_RAISE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ @@ -948,6 +1716,7 @@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_REMAINDER = @HAVE_REMAINDER@ HAVE_REMAINDERF = @HAVE_REMAINDERF@ @@ -992,6 +1761,7 @@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ @@ -1000,7 +1770,10 @@ HAVE_TANF = @HAVE_TANF@ HAVE_TANHF = @HAVE_TANHF@ HAVE_TANL = @HAVE_TANL@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_TRUNCATE = @HAVE_TRUNCATE@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_TZSET = @HAVE_TZSET@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -1022,6 +1795,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@ HAVE_WCSCPY = @HAVE_WCSCPY@ HAVE_WCSCSPN = @HAVE_WCSCSPN@ HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ HAVE_WCSLEN = @HAVE_WCSLEN@ HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ HAVE_WCSNCAT = @HAVE_WCSNCAT@ @@ -1050,6 +1824,8 @@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ HELP2MAN = @HELP2MAN@ +HOST_CPU = @HOST_CPU@ +HOST_CPU_C_ABI = @HOST_CPU_C_ABI@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ @@ -1084,6 +1860,8 @@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ +LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@ +LIMITS_H = @LIMITS_H@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ LOCALE_JA = @LOCALE_JA@ @@ -1107,6 +1885,7 @@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@ NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ @@ -1128,6 +1907,7 @@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_MATH_H = @NEXT_MATH_H@ NEXT_SCHED_H = @NEXT_SCHED_H@ NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ @@ -1144,7 +1924,6 @@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ -NO_STRICT_ALIAS_CXXFLAGS = @NO_STRICT_ALIAS_CXXFLAGS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -1164,6 +1943,10 @@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_ACOSF = @REPLACE_ACOSF@ +REPLACE_ASINF = @REPLACE_ASINF@ +REPLACE_ATAN2F = @REPLACE_ATAN2F@ +REPLACE_ATANF = @REPLACE_ATANF@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ @@ -1174,14 +1957,19 @@ REPLACE_CEILF = @REPLACE_CEILF@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_COSF = @REPLACE_COSF@ +REPLACE_COSHF = @REPLACE_COSHF@ +REPLACE_CTIME = @REPLACE_CTIME@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_EXP2 = @REPLACE_EXP2@ REPLACE_EXP2L = @REPLACE_EXP2L@ +REPLACE_EXPF = @REPLACE_EXPF@ REPLACE_EXPM1 = @REPLACE_EXPM1@ REPLACE_EXPM1F = @REPLACE_EXPM1F@ REPLACE_FABSL = @REPLACE_FABSL@ +REPLACE_FACCESSAT = @REPLACE_FACCESSAT@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ @@ -1214,16 +2002,19 @@ REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDELIM = @REPLACE_GETDELIM@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GMTIME = @REPLACE_GMTIME@ REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ REPLACE_HYPOT = @REPLACE_HYPOT@ REPLACE_HYPOTF = @REPLACE_HYPOTF@ REPLACE_HYPOTL = @REPLACE_HYPOTL@ REPLACE_ILOGB = @REPLACE_ILOGB@ REPLACE_ILOGBF = @REPLACE_ILOGBF@ +REPLACE_ILOGBL = @REPLACE_ILOGBL@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ REPLACE_ISINF = @REPLACE_ISINF@ @@ -1235,6 +2026,7 @@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LDEXPL = @REPLACE_LDEXPL@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ REPLACE_LOG = @REPLACE_LOG@ REPLACE_LOG10 = @REPLACE_LOG10@ @@ -1290,10 +2082,12 @@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RAISE = @REPLACE_RAISE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_REMAINDER = @REPLACE_REMAINDER@ @@ -1309,9 +2103,12 @@ REPLACE_ROUNDL = @REPLACE_ROUNDL@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ +REPLACE_SINF = @REPLACE_SINF@ +REPLACE_SINHF = @REPLACE_SINHF@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_SQRTF = @REPLACE_SQRTF@ REPLACE_SQRTL = @REPLACE_SQRTL@ REPLACE_STAT = @REPLACE_STAT@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ @@ -1322,6 +2119,7 @@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ REPLACE_STRNDUP = @REPLACE_STRNDUP@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ @@ -1330,14 +2128,20 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TANF = @REPLACE_TANF@ +REPLACE_TANHF = @REPLACE_TANHF@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TRUNC = @REPLACE_TRUNC@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ REPLACE_TRUNCF = @REPLACE_TRUNCF@ REPLACE_TRUNCL = @REPLACE_TRUNCL@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ @@ -1350,6 +2154,7 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ @@ -1358,6 +2163,7 @@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WRITE = @REPLACE_WRITE@ SCHED_H = @SCHED_H@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ @@ -1371,30 +2177,30 @@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_NLS = @USE_NLS@ VALGRIND = @VALGRIND@ -VALGRIND_PREBISON = @VALGRIND_PREBISON@ +VALGRIND_OPTS_SUPPRESSION = @VALGRIND_OPTS_SUPPRESSION@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WARN_CFLAGS_TEST = @WARN_CFLAGS_TEST@ WARN_CXXFLAGS = @WARN_CXXFLAGS@ WARN_CXXFLAGS_TEST = @WARN_CXXFLAGS_TEST@ -WARN_NO_NULL_CONVERSION_CXXFLAGS = @WARN_NO_NULL_CONVERSION_CXXFLAGS@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WERROR_CFLAGS = @WERROR_CFLAGS@ WERROR_CXXFLAGS = @WERROR_CXXFLAGS@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ -YACC = @YACC@ -YACC_LIBRARY = @YACC_LIBRARY@ -YACC_SCRIPT = @YACC_SCRIPT@ +YACC = $(BISON) -o y.tab.c YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ @@ -1448,6 +2254,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -1456,22 +2263,136 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = subdir-objects ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = build-aux po runtime-po lib data src doc examples tests etc +SUBDIRS = po runtime-po . aclocal_DATA = m4/bison-i18n.m4 -EXTRA_DIST = .prev-version .version \ - cfg.mk ChangeLog-1998 ChangeLog-2012 PACKAGING \ - djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \ - djgpp/config.sed djgpp/config.site djgpp/config_h.sed \ - djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \ - djgpp/fnchange.lst djgpp/testsuite.sed -MAINTAINER_CHECKS = \ - maintainer-check \ - maintainer-push-check \ - maintainer-xml-check \ - maintainer-release-check +# Some of our targets (cross-option.texi, bison.1) use "bison --help". +# Since we want to ship the generated file to avoid additional +# requirements over the user environment, we used not depend on +# src/bison itself, but on src/getargs.c and other files. Yet, we +# need "bison --help" to work to make help2man happy, so we used to +# include "make src/bison" in the commands. Then we may have a +# problem with concurrent builds, since one make might be aiming one +# of its jobs at compiling src/bison, and another job at generating +# the man page. If the latter is faster than the former, then we have +# two makes that concurrently try to compile src/bison. Doomed to +# failure. +# +# As a simple scheme to get our way out, make a stamp file, +# bison.help, which contains --version then --help. This file can +# depend on bison, which ensures its correctness. But update it +# *only* if needed (content changes). This way, we avoid useless +# compilations of cross-option.texi and bison.1. At the cost of +# repeated builds of bison.help. + +# If your project uses "gettextize --intl" to put a source-code +# copy of libintl into the package, every Makefile.am needs +# -I$(top_builddir)/intl, so that can be found in this directory. +# Here's one way to do this: +#AM_CPPFLAGS += -I$(top_builddir)/intl +# This option has no effect when the user disables NLS (because then +# the intl directory contains no libintl.h file). This option is not +# enabled by default because the intl directory might not exist if +# your project does not use "gettext --intl", and some compilers +# complain about -I options applied to nonexistent directories. +EXTRA_DIST = .prev-version .version cfg.mk PACKAGING ChangeLog-1998 \ + ChangeLog-2012 ChangeLog $(dist_TESTS) \ + build-aux/Darwin.valgrind build-aux/Linux.valgrind \ + build-aux/cross-options.pl build-aux/move-if-change \ + build-aux/prev-version.txt build-aux/update-b4-copyright \ + djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \ + djgpp/config.sed djgpp/config.site djgpp/config_h.sed \ + djgpp/djunpack.bat djgpp/fnchange.lst djgpp/subpipe.c \ + djgpp/subpipe.h djgpp/testsuite.sed doc/refcard.tex \ + $(top_srcdir)/doc/bison.help $(dist_man_MANS:.1=.x) $(FIGS_GV) \ + $(FIGS_GV:.gv=.txt) $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) \ + $(FIGS_GV:.gv=.png) doc/Doxyfile.in $(am__append_4) \ + lib/alignof.h lib/alloca.in.h \ + $(top_srcdir)/build-aux/announce-gen lib/argmatch.h \ + lib/c-strcaseeq.h lib/calloc.c lib/cloexec.h lib/close.c \ + lib/close-stream.h lib/closeout.h lib/concat-filename.h \ + lib/stripslash.c lib/dirname.h \ + $(top_srcdir)/build-aux/do-release-commit-and-tag \ + lib/dosname.h lib/dup2.c lib/errno.in.h lib/error.c \ + lib/error.h lib/exitfail.h lib/fcntl.c lib/fcntl.in.h \ + lib/fd-hook.h lib/filename.h lib/float.c lib/float.in.h \ + lib/itold.c lib/fopen.c lib/stdio--.h lib/stdio-safer.h \ + lib/fpending.c lib/fpending.h lib/stdio-impl.h lib/fprintf.c \ + lib/fpucw.h lib/frexp.c lib/frexp.c lib/frexpl.c lib/fseterr.c \ + lib/fseterr.h lib/stdio-impl.h lib/fstat.c lib/stat-w32.c \ + lib/stat-w32.h $(top_srcdir)/build-aux/gendocs.sh \ + lib/getdtablesize.c lib/getopt-cdefs.in.h lib/getopt-core.h \ + lib/getopt-ext.h lib/getopt-pfx-core.h lib/getopt-pfx-ext.h \ + lib/getopt.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h \ + $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/git-version-gen \ + $(top_srcdir)/build-aux/gitlog-to-changelog \ + $(top_srcdir)/build-aux/gnu-web-doc-update \ + $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \ + lib/hard-locale.h lib/hash.h \ + $(top_srcdir)/build-aux/config.rpath lib/intprops.h \ + lib/inttypes.in.h lib/float+.h lib/isnan.c lib/isnand.c \ + lib/float+.h lib/isnan.c lib/isnand-nolibm.h lib/isnand.c \ + lib/float+.h lib/isnan.c lib/isnanf.c lib/float+.h lib/isnan.c \ + lib/isnanf-nolibm.h lib/isnanf.c lib/float+.h lib/isnan.c \ + lib/isnanl.c lib/float+.h lib/isnan.c lib/isnanl-nolibm.h \ + lib/isnanl.c $(top_srcdir)/build-aux/javacomp.sh.in \ + $(top_srcdir)/build-aux/javaexec.sh.in lib/ldexpl.c \ + lib/limits.in.h lib/config.charset lib/ref-add.sin \ + lib/ref-del.sin lib/lstat.c $(top_srcdir)/maint.mk \ + lib/malloc.c lib/malloc.c lib/malloca.h lib/math.in.h \ + lib/mbrtowc.c lib/mbsinit.c lib/memchr.c lib/memchr.valgrind \ + lib/msvc-inval.c lib/msvc-inval.h lib/msvc-nothrow.c \ + lib/msvc-nothrow.h $(top_srcdir)/build-aux/prefix-gnulib-mk \ + lib/obstack.c lib/obstack.h lib/obstack_printf.c lib/open.c \ + lib/pathmax.h lib/perror.c lib/spawn_int.h lib/spawni.c \ + lib/spawn_faction_addclose.c lib/spawn_int.h \ + lib/spawn_faction_adddup2.c lib/spawn_int.h \ + lib/spawn_faction_addopen.c lib/spawn_int.h \ + lib/spawn_faction_destroy.c lib/spawn_faction_init.c \ + lib/spawn_int.h lib/spawnattr_destroy.c lib/spawnattr_init.c \ + lib/spawnattr_setflags.c lib/spawnattr_setsigmask.c \ + lib/spawnp.c lib/printf-frexp.h lib/printf-frexp.c \ + lib/printf-frexpl.h lib/printf.c lib/quote.h lib/quote.h \ + lib/quotearg.h lib/raise.c lib/rawmemchr.c \ + lib/rawmemchr.valgrind lib/realloc.c lib/sched.in.h \ + lib/sig-handler.h lib/sigaction.c lib/signal.in.h lib/float+.h \ + lib/signbitd.c lib/signbitf.c lib/signbitl.c lib/sigprocmask.c \ + lib/_Noreturn.h lib/arg-nonnull.h lib/c++defs.h \ + lib/warn-on-use.h lib/snprintf.c lib/spawn.in.h lib/sprintf.c \ + lib/stat-w32.c lib/stat-w32.h lib/stat.c lib/stat-time.h \ + lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h \ + lib/stdio.in.h lib/stdlib.in.h lib/stpcpy.c lib/strchrnul.c \ + lib/strchrnul.valgrind lib/strdup.c lib/streq.h lib/strerror.c \ + lib/strerror-override.c lib/strerror-override.h \ + lib/strerror_r.c lib/string.in.h lib/strndup.c lib/strnlen.c \ + lib/strverscmp.c lib/sys_stat.in.h lib/sys_types.in.h \ + lib/sys_wait.in.h $(top_srcdir)/build-aux/config.rpath \ + lib/time.in.h lib/unistd.in.h lib/unistd--.h \ + lib/unistd-safer.h lib/unitypes.in.h lib/localcharset.h \ + lib/uniwidth.in.h lib/uniwidth/cjk.h lib/unlink.c \ + lib/unlocked-io.h lib/unsetenv.c \ + $(top_srcdir)/build-aux/update-copyright \ + $(top_srcdir)/build-aux/useless-if-before-free lib/asnprintf.c \ + lib/float+.h lib/printf-args.c lib/printf-args.h \ + lib/printf-parse.c lib/printf-parse.h lib/vasnprintf.c \ + lib/vasnprintf.h $(top_srcdir)/build-aux/vc-list-files \ + lib/verify.h lib/vfprintf.c lib/vsnprintf.c lib/vsprintf.c \ + lib/waitpid.c lib/wchar.in.h lib/wctype.in.h lib/wcwidth.c \ + lib/xalloc.h lib/xalloc-oversized.h lib/concat-filename.h \ + lib/xmemdup0.c lib/xmemdup0.h $(TESTSUITE_AT) tests/testsuite +dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO +BISON = $(top_builddir)/tests/bison +BISON_IN = $(top_srcdir)/tests/bison.in +AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all +# Initialization before completion by local.mk's. +AM_CFLAGS = $(WARN_CFLAGS) +# Find builddir/src/scan-code.c etc. For some reason "-I./lib" +# instead of "-Ilib" avoids infinite recursions on #include_next. +AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib # See comments in build-aux/git-version-gen. However, we make .version depend # on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the @@ -1482,37 +2403,424 @@ MAINTAINER_CHECKS = \ # a developer might naively reference .version in a test case while the bison # executable still compiles with VERSION, and so the test case might fail or # pass incorrectly. -BUILT_SOURCES = $(top_srcdir)/.version +BUILT_SOURCES = $(mfcalc_sources) $(rpcalc_sources) $(ALLOCA_H) \ + lib/configmake.h $(ERRNO_H) lib/fcntl.h $(FLOAT_H) $(GETOPT_H) \ + $(GETOPT_CDEFS_H) lib/inttypes.h $(LIMITS_H) lib/math.h \ + $(SCHED_H) lib/signal.h lib/spawn.h $(STDBOOL_H) $(STDDEF_H) \ + $(STDINT_H) lib/stdio.h lib/stdlib.h lib/string.h \ + lib/sys/stat.h lib/sys/types.h lib/sys/wait.h lib/time.h \ + lib/unistd.h $(LIBUNISTRING_UNITYPES_H) \ + $(LIBUNISTRING_UNIWIDTH_H) lib/wchar.h lib/wctype.h \ + src/parse-gram.c src/parse-gram.h src/scan-code.c \ + src/scan-gram.c src/scan-skel.c $(top_srcdir)/.version +CLEANFILES = doc/refcard.pdf $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) \ + $(FIGS_GV:.gv=.png) doc/Doxyfile $(extracted) \ + examples/extracted.stamp $(calcxx_sources_generated) \ + examples/calc++/calc++-parser.output \ + examples/calc++/calc++-parser.stamp \ + examples/calc++/calc++-scanner.cc examples/mfcalc/mfcalc.[ch] \ + examples/mfcalc/mfcalc.output examples/rpcalc/rpcalc.[ch] \ + examples/rpcalc/rpcalc.output lib/configmake.h \ + lib/configmake.h-t lib/charset.alias lib/ref-add.sed \ + lib/ref-del.sed +DISTCLEANFILES = tests/atconfig $(check_SCRIPTS) +MOSTLYCLEANDIRS = lib/sys lib/sys +MOSTLYCLEANFILES = $(top_srcdir)/doc/*.t lib/core lib/*.stackdump \ + lib/alloca.h lib/alloca.h-t lib/errno.h lib/errno.h-t \ + lib/fcntl.h lib/fcntl.h-t lib/float.h lib/float.h-t \ + lib/getopt.h lib/getopt.h-t lib/getopt-cdefs.h \ + lib/getopt-cdefs.h-t lib/inttypes.h lib/inttypes.h-t \ + lib/limits.h lib/limits.h-t lib/math.h lib/math.h-t \ + lib/sched.h lib/sched.h-t lib/signal.h lib/signal.h-t \ + lib/spawn.h lib/spawn.h-t lib/stdbool.h lib/stdbool.h-t \ + lib/stddef.h lib/stddef.h-t lib/stdint.h lib/stdint.h-t \ + lib/stdio.h lib/stdio.h-t lib/stdlib.h lib/stdlib.h-t \ + lib/string.h lib/string.h-t lib/sys/stat.h lib/sys/stat.h-t \ + lib/sys/types.h lib/sys/types.h-t lib/sys/wait.h \ + lib/sys/wait.h-t lib/time.h lib/time.h-t lib/unistd.h \ + lib/unistd.h-t lib/unitypes.h lib/unitypes.h-t lib/uniwidth.h \ + lib/uniwidth.h-t lib/wchar.h lib/wchar.h-t lib/wctype.h \ + lib/wctype.h-t src/yacc +SUFFIXES = .gv .eps .pdf .png .yy .stamp +TESTS = $(dist_TESTS) +dist_TESTS = $(am__append_3) examples/mfcalc/mfcalc.test \ + examples/rpcalc/rpcalc.test +# No GNU Make output. +noinst_LIBRARIES = lib/libbison.a +dist_pkgdata_DATA = \ + data/README \ + data/bison.m4 \ + data/c++-skel.m4 \ + data/c++.m4 \ + data/c-like.m4 \ + data/c-skel.m4 \ + data/c.m4 \ + data/glr.c \ + data/glr.cc \ + data/java-skel.m4 \ + data/java.m4 \ + data/lalr1.cc \ + data/lalr1.java \ + data/location.cc \ + data/stack.hh \ + data/variant.hh \ + data/yacc.c + +m4sugardir = $(pkgdatadir)/m4sugar +dist_m4sugar_DATA = \ + data/m4sugar/foreach.m4 \ + data/m4sugar/m4sugar.m4 + +xsltdir = $(pkgdatadir)/xslt +dist_xslt_DATA = \ + data/xslt/bison.xsl \ + data/xslt/xml2dot.xsl \ + data/xslt/xml2text.xsl \ + data/xslt/xml2xhtml.xsl + +AM_MAKEINFOFLAGS = --no-split +info_TEXINFOS = doc/bison.texi +doc_bison_TEXINFOS = \ + $(CROSS_OPTIONS_TEXI) \ + doc/fdl.texi \ + doc/gpl-3.0.texi + + +# Cannot express dependencies directly on file names because of Automake. +# Obfuscate with a variable. +doc_bison = doc/bison +TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc +CLEANDIRS = doc/bison.t2d doc/html +CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl +CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi +MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI) $(am__append_1) \ + $(dist_man_MANS) $(TESTSUITE) +dist_man_MANS = $(top_srcdir)/doc/bison.1 + +# Differences to ignore when comparing the man page (the date). +remove_time_stamp = \ + sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/' + + +# Depend on configure to get version number changes. +@CROSS_COMPILING_FALSE@MAN_DEPS = doc/bison.help doc/bison.x $(top_srcdir)/configure +@ENABLE_YACC_TRUE@nodist_man_MANS = doc/yacc.1 +FIGS_GV = \ + doc/figs/example.gv \ + doc/figs/example-reduce.gv doc/figs/example-shift.gv + +DOXYGEN = doxygen +edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ + -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ + -e 's,@PERL\@,$(PERL),g' \ + -e 's,@top_builddir\@,$(top_builddir),g' \ + -e 's,@top_srcdir\@,$(top_srcdir),g' + +nodist_noinst_SCRIPTS = etc/bench.pl +dist_noinst_SCRIPTS = examples/extexi examples/test +TEST_LOG_COMPILER = $(top_srcdir)/examples/test +AM_CXXFLAGS = \ + $(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS) + +doc = $(top_srcdir)/doc/bison.texi +extexi = $(top_srcdir)/examples/extexi +@ENABLE_GCC_WARNINGS_TRUE@extexiFLAGS = --synclines +extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(extexiFLAGS) $(doc) -- +extracted = $(calcxx_extracted) $(mfcalc_extracted) \ + $(rpcalc_extracted) +calcxx_sources_extracted = \ + examples/calc++/calc++-driver.cc \ + examples/calc++/calc++-driver.hh \ + examples/calc++/calc++-scanner.ll \ + examples/calc++/calc++.cc + +calcxx_extracted = \ + $(calcxx_sources_extracted) \ + examples/calc++/calc++-parser.yy + +calcxx_sources_generated = \ + examples/calc++/calc++-parser.cc \ + examples/calc++/calc++-parser.hh \ + examples/calc++/location.hh \ + examples/calc++/position.hh \ + examples/calc++/stack.hh + +calcxx_sources = \ + $(calcxx_sources_extracted) \ + $(calcxx_sources_generated) + +@FLEX_CXX_WORKS_TRUE@nodist_examples_calc___calc___SOURCES = \ +@FLEX_CXX_WORKS_TRUE@ $(calcxx_sources) + +@FLEX_CXX_WORKS_TRUE@examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++ +@FLEX_CXX_WORKS_TRUE@examples_calc___calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS) +calcxxdir = $(docdir)/examples/calc++ +calcxx_DATA = $(calcxx_extracted) +mfcalc_extracted = examples/mfcalc/calc.h examples/mfcalc/mfcalc.y +mfcalc_sources = $(mfcalc_extracted) +examples_mfcalc_mfcalc_LDADD = -lm +nodist_examples_mfcalc_mfcalc_SOURCES = $(mfcalc_sources) +examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc +mfcalcdir = $(docdir)/examples/mfcalc +mfcalc_DATA = $(mfcalc_extracted) +rpcalc_extracted = examples/rpcalc/rpcalc.y +rpcalc_sources = $(rpcalc_extracted) +examples_rpcalc_rpcalc_LDADD = -lm +nodist_examples_rpcalc_rpcalc_SOURCES = $(rpcalc_sources) +examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc +rpcalcdir = $(docdir)/examples/rpcalc +rpcalc_DATA = $(rpcalc_extracted) + +# Implementation of bitsets. + +# Additional bitset operations. + +# timevars, stolen from GCC. + +# Non-gnulib sources in Bison's internal library. +lib_libbison_a_SOURCES = lib/argmatch.c lib/binary-io.h \ + lib/binary-io.c lib/bitrotate.h lib/bitrotate.c lib/c-ctype.h \ + lib/c-ctype.c lib/c-strcase.h lib/c-strcasecmp.c \ + lib/c-strncasecmp.c lib/cloexec.c lib/close-stream.c \ + lib/closeout.c lib/concat-filename.c lib/dirname.c \ + lib/basename.c lib/dirname-lgpl.c lib/basename-lgpl.c \ + lib/stripslash.c lib/exitfail.c lib/fatal-signal.h \ + lib/fatal-signal.c lib/fd-hook.c lib/fd-safer-flag.c \ + lib/dup-safer-flag.c lib/fopen-safer.c lib/getprogname.h \ + lib/getprogname.c lib/gettext.h lib/hard-locale.c lib/hash.c \ + lib/localcharset.h lib/localcharset.c lib/glthread/lock.h \ + lib/glthread/lock.c lib/malloca.c lib/math.c lib/mbswidth.h \ + lib/mbswidth.c lib/minmax.h lib/pipe2.c lib/pipe2-safer.c \ + lib/printf-frexp.c lib/printf-frexpl.c lib/progname.h \ + lib/progname.c lib/quotearg.c lib/sig-handler.c lib/size_max.h \ + lib/spawn-pipe.h lib/spawn-pipe.c lib/w32spawn.h \ + lib/stat-time.c lib/glthread/threadlib.c lib/unistd.c \ + lib/dup-safer.c lib/fd-safer.c lib/pipe-safer.c \ + $(am__append_5) lib/wait-process.h lib/wait-process.c \ + lib/wctype-h.c lib/xmalloc.c lib/xalloc-die.c \ + lib/xconcat-filename.c lib/xsize.h lib/xsize.c lib/xstrndup.h \ + lib/xstrndup.c lib/abitset.c lib/abitset.h lib/bbitset.h \ + lib/bitset.c lib/bitset.h lib/bitset_stats.c \ + lib/bitset_stats.h lib/bitsetv.c lib/bitsetv.h lib/ebitset.c \ + lib/ebitset.h lib/lbitset.c lib/lbitset.h lib/libiberty.h \ + lib/vbitset.c lib/vbitset.h lib/bitsetv-print.h \ + lib/bitsetv-print.c lib/timevar.h lib/timevar.c \ + lib/timevar.def lib/get-errno.h lib/get-errno.c +lib_libbison_a_LIBADD = $(gl_LIBOBJS) +lib_libbison_a_DEPENDENCIES = $(gl_LIBOBJS) +EXTRA_lib_libbison_a_SOURCES = lib/calloc.c lib/close.c \ + lib/stripslash.c lib/dup2.c lib/error.c lib/fcntl.c \ + lib/float.c lib/itold.c lib/fopen.c lib/fpending.c \ + lib/fprintf.c lib/frexp.c lib/frexp.c lib/frexpl.c \ + lib/fseterr.c lib/fstat.c lib/stat-w32.c lib/getdtablesize.c \ + lib/getopt.c lib/getopt1.c lib/isnan.c lib/isnand.c \ + lib/isnan.c lib/isnand.c lib/isnan.c lib/isnanf.c lib/isnan.c \ + lib/isnanf.c lib/isnan.c lib/isnanl.c lib/isnan.c lib/isnanl.c \ + lib/ldexpl.c lib/lstat.c lib/malloc.c lib/malloc.c \ + lib/mbrtowc.c lib/mbsinit.c lib/memchr.c lib/msvc-inval.c \ + lib/msvc-nothrow.c lib/obstack.c lib/obstack_printf.c \ + lib/open.c lib/perror.c lib/spawni.c \ + lib/spawn_faction_addclose.c lib/spawn_faction_adddup2.c \ + lib/spawn_faction_addopen.c lib/spawn_faction_destroy.c \ + lib/spawn_faction_init.c lib/spawnattr_destroy.c \ + lib/spawnattr_init.c lib/spawnattr_setflags.c \ + lib/spawnattr_setsigmask.c lib/spawnp.c lib/printf-frexp.c \ + lib/printf.c lib/raise.c lib/rawmemchr.c lib/realloc.c \ + lib/sigaction.c lib/signbitd.c lib/signbitf.c lib/signbitl.c \ + lib/sigprocmask.c lib/snprintf.c lib/sprintf.c lib/stat-w32.c \ + lib/stat.c lib/stpcpy.c lib/strchrnul.c lib/strdup.c \ + lib/strerror.c lib/strerror-override.c lib/strerror_r.c \ + lib/strndup.c lib/strnlen.c lib/strverscmp.c lib/unlink.c \ + lib/unsetenv.c lib/asnprintf.c lib/printf-args.c \ + lib/printf-parse.c lib/vasnprintf.c lib/vfprintf.c \ + lib/vsnprintf.c lib/vsprintf.c lib/waitpid.c lib/wcwidth.c \ + lib/xmemdup0.c + +# Use this preprocessor expression to decide whether #include_next works. +# Do not rely on a 'configure'-time test for this, since the expression +# might appear in an installed header, which is used by some other compiler. +HAVE_INCLUDE_NEXT = lib/(__GNUC__ lib/|| lib/60000000 lib/<= lib/__DECC_VER) +charset_alias = $(DESTDIR)$(libdir)/charset.alias +charset_tmp = $(DESTDIR)$(libdir)/charset.tmp + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +_NORETURN_H = $(top_srcdir)/lib/_Noreturn.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +ARG_NONNULL_H = $(top_srcdir)/lib/arg-nonnull.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +CXXDEFS_H = $(top_srcdir)/lib/c++defs.h + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all makefiles that +# need it. This is ensured by the applicability 'all' defined above. +WARN_ON_USE_H = $(top_srcdir)/lib/warn-on-use.h + +# The Yacc compatibility library. +@ENABLE_YACC_TRUE@lib_LIBRARIES = lib/liby.a +@ENABLE_YACC_TRUE@EXTRA_LIBRARIES = lib/liby.a +@ENABLE_YACC_TRUE@lib_liby_a_SOURCES = lib/main.c lib/yyerror.c +LDADD = lib/libbison.a $(LIBINTL) +# Prettify Automake-computed names of compiled objects. +src_bison_SHORTNAME = bison +src_bison_CFLAGS = $(AM_CFLAGS) $(WERROR_CFLAGS) +src_bison_SOURCES = \ + src/AnnotationList.c \ + src/AnnotationList.h \ + src/InadequacyList.c \ + src/InadequacyList.h \ + src/LR0.c \ + src/LR0.h \ + src/Sbitset.c \ + src/Sbitset.h \ + src/assoc.c \ + src/assoc.h \ + src/closure.c \ + src/closure.h \ + src/complain.c \ + src/complain.h \ + src/conflicts.c \ + src/conflicts.h \ + src/derives.c \ + src/derives.h \ + src/files.c \ + src/files.h \ + src/flex-scanner.h \ + src/getargs.c \ + src/getargs.h \ + src/gram.c \ + src/gram.h \ + src/graphviz.c \ + src/graphviz.h \ + src/lalr.c \ + src/lalr.h \ + src/ielr.c \ + src/ielr.h \ + src/location.c \ + src/location.h \ + src/main.c \ + src/muscle-tab.c \ + src/muscle-tab.h \ + src/named-ref.c \ + src/named-ref.h \ + src/nullable.c \ + src/nullable.h \ + src/output.c \ + src/output.h \ + src/parse-gram.y \ + src/print-xml.c \ + src/print-xml.h \ + src/print.c \ + src/print.h \ + src/print_graph.c \ + src/print_graph.h \ + src/reader.c \ + src/reader.h \ + src/reduce.c \ + src/reduce.h \ + src/relation.c \ + src/relation.h \ + src/scan-code-c.c \ + src/scan-code.h \ + src/scan-gram-c.c \ + src/scan-gram.h \ + src/scan-skel-c.c \ + src/scan-skel.h \ + src/state.c \ + src/state.h \ + src/symlist.c \ + src/symlist.h \ + src/symtab.c \ + src/symtab.h \ + src/system.h \ + src/tables.c \ + src/tables.h \ + src/uniqstr.c \ + src/uniqstr.h + +EXTRA_src_bison_SOURCES = \ + src/scan-code.l \ + src/scan-gram.l \ + src/scan-skel.l + +@ENABLE_YACC_TRUE@bin_SCRIPTS = src/yacc +EXTRA_SCRIPTS = src/yacc +TESTSUITE_AT = \ + tests/testsuite.at \ + \ + tests/actions.at \ + tests/c++.at \ + tests/calc.at \ + tests/conflicts.at \ + tests/cxx-type.at \ + tests/existing.at \ + tests/glr-regression.at \ + tests/headers.at \ + tests/input.at \ + tests/java.at \ + tests/javapush.at \ + tests/local.at \ + tests/named-refs.at \ + tests/output.at \ + tests/package.m4 \ + tests/push.at \ + tests/reduce.at \ + tests/regression.at \ + tests/sets.at \ + tests/skeletons.at \ + tests/synclines.at \ + tests/torture.at \ + tests/types.at + +TESTSUITE = $(top_srcdir)/tests/testsuite +AUTOTEST = $(AUTOM4TE) --language=autotest +AUTOTESTFLAGS = -I $(top_srcdir)/tests + +# Move into tests/ so that testsuite.dir etc. be created there. +RUN_TESTSUITE = $(TESTSUITE) -C tests $(TESTSUITEFLAGS) +check_SCRIPTS = $(BISON) tests/atconfig tests/atlocal +RUN_TESTSUITE_deps = all $(TESTSUITE) $(check_SCRIPTS) +VALGRIND_OPTS = --leak-check=full --show-reachable=yes --gen-suppressions=all \ + $(VALGRIND_OPTS_SUPPRESSION) + gen_start_date = 2012-01-16 all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: +.SUFFIXES: .gv .eps .pdf .png .yy .stamp .c .cc .dvi .l .ll .log .o .obj .ps .sed .sin .test .test$(EXEEXT) .trs .y am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/build-aux/local.mk $(srcdir)/data/local.mk $(srcdir)/djgpp/local.mk $(srcdir)/doc/local.mk $(srcdir)/etc/local.mk $(srcdir)/examples/local.mk $(srcdir)/examples/calc++/local.mk $(srcdir)/examples/mfcalc/local.mk $(srcdir)/examples/rpcalc/local.mk $(srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(srcdir)/src/local.mk $(srcdir)/tests/local.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnits'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnits \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile -.PRECIOUS: Makefile + $(AUTOMAKE) --gnits Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; +$(srcdir)/build-aux/local.mk $(srcdir)/data/local.mk $(srcdir)/djgpp/local.mk $(srcdir)/doc/local.mk $(srcdir)/etc/local.mk $(srcdir)/examples/local.mk $(srcdir)/examples/calc++/local.mk $(srcdir)/examples/mfcalc/local.mk $(srcdir)/examples/rpcalc/local.mk $(srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(srcdir)/src/local.mk $(srcdir)/tests/local.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -1522,31 +2830,1875 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): + +lib/config.h: lib/stamp-h1 + @test -f $@ || rm -f lib/stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) lib/stamp-h1 + +lib/stamp-h1: $(top_srcdir)/lib/config.in.h $(top_builddir)/config.status + @rm -f lib/stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status lib/config.h +$(top_srcdir)/lib/config.in.h: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f lib/stamp-h1 + touch $@ + +distclean-hdr: + -rm -f lib/config.h lib/stamp-h1 javacomp.sh: $(top_builddir)/config.status $(top_srcdir)/build-aux/javacomp.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ javaexec.sh: $(top_builddir)/config.status $(top_srcdir)/build-aux/javaexec.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ -install-aclocalDATA: $(aclocal_DATA) +etc/bench.pl: $(top_builddir)/config.status $(top_srcdir)/etc/bench.pl.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +tests/atlocal: $(top_builddir)/config.status $(top_srcdir)/tests/atlocal.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +tests/bison: $(top_builddir)/config.status $(top_srcdir)/tests/bison.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +doc/yacc.1: $(top_builddir)/config.status $(top_srcdir)/doc/yacc.1.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(aclocaldir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" || exit 1; \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +installcheck-binPROGRAMS: $(bin_PROGRAMS) + bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | \ + sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +install-libLIBRARIES: $(lib_LIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; } + @$(POST_INSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(aclocaldir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(aclocaldir)" || exit $$?; \ + if test -f $$p; then \ + $(am__strip_dir) \ + echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \ + ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \ + else :; fi; \ done -uninstall-aclocalDATA: +uninstall-libLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir) + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +lib/$(am__dirstamp): + @$(MKDIR_P) lib + @: > lib/$(am__dirstamp) +lib/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/$(DEPDIR) + @: > lib/$(DEPDIR)/$(am__dirstamp) +lib/argmatch.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/binary-io.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitrotate.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/c-ctype.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/c-strcasecmp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/c-strncasecmp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/cloexec.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/close-stream.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/closeout.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/concat-filename.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/dirname.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/basename.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/dirname-lgpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/basename-lgpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/stripslash.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/exitfail.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fatal-signal.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fd-hook.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fd-safer-flag.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/dup-safer-flag.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fopen-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/getprogname.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/hard-locale.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/hash.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/localcharset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/glthread/$(am__dirstamp): + @$(MKDIR_P) lib/glthread + @: > lib/glthread/$(am__dirstamp) +lib/glthread/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/glthread/$(DEPDIR) + @: > lib/glthread/$(DEPDIR)/$(am__dirstamp) +lib/glthread/lock.$(OBJEXT): lib/glthread/$(am__dirstamp) \ + lib/glthread/$(DEPDIR)/$(am__dirstamp) +lib/malloca.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/math.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/mbswidth.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/pipe2.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/pipe2-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-frexp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-frexpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/progname.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/quotearg.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/sig-handler.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn-pipe.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/stat-time.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/glthread/threadlib.$(OBJEXT): lib/glthread/$(am__dirstamp) \ + lib/glthread/$(DEPDIR)/$(am__dirstamp) +lib/unistd.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/dup-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fd-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/pipe-safer.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/uniwidth/$(am__dirstamp): + @$(MKDIR_P) lib/uniwidth + @: > lib/uniwidth/$(am__dirstamp) +lib/uniwidth/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/uniwidth/$(DEPDIR) + @: > lib/uniwidth/$(DEPDIR)/$(am__dirstamp) +lib/uniwidth/width.$(OBJEXT): lib/uniwidth/$(am__dirstamp) \ + lib/uniwidth/$(DEPDIR)/$(am__dirstamp) +lib/wait-process.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/wctype-h.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xmalloc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xalloc-die.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xconcat-filename.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xsize.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/xstrndup.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/abitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitset_stats.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitsetv.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/ebitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/lbitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vbitset.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/bitsetv-print.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/timevar.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/get-errno.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/calloc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/close.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/dup2.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/error.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/fcntl.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/float.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/itold.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/fopen.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/fpending.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/frexp.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/frexpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fseterr.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/fstat.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/stat-w32.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/getdtablesize.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/getopt.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/getopt1.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/isnan.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/isnand.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/isnanf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/isnanl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/ldexpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/lstat.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/malloc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/mbrtowc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/mbsinit.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/memchr.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/msvc-inval.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/msvc-nothrow.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/obstack.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/obstack_printf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/open.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/perror.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawni.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_addclose.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_adddup2.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_addopen.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_destroy.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawn_faction_init.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnattr_destroy.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnattr_init.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnattr_setflags.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnattr_setsigmask.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/spawnp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/raise.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/rawmemchr.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/realloc.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/sigaction.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/signbitd.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/signbitf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/signbitl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/sigprocmask.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/snprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/sprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/stat.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/stpcpy.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strchrnul.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strdup.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strerror.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strerror-override.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strerror_r.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strndup.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strnlen.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strverscmp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/unlink.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/unsetenv.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/asnprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-args.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-parse.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vasnprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vfprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vsnprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vsprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/waitpid.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/wcwidth.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/xmemdup0.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) + +lib/libbison.a: $(lib_libbison_a_OBJECTS) $(lib_libbison_a_DEPENDENCIES) $(EXTRA_lib_libbison_a_DEPENDENCIES) lib/$(am__dirstamp) + $(AM_V_at)-rm -f lib/libbison.a + $(AM_V_AR)$(lib_libbison_a_AR) lib/libbison.a $(lib_libbison_a_OBJECTS) $(lib_libbison_a_LIBADD) + $(AM_V_at)$(RANLIB) lib/libbison.a +lib/main.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/yyerror.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) + +lib/liby.a: $(lib_liby_a_OBJECTS) $(lib_liby_a_DEPENDENCIES) $(EXTRA_lib_liby_a_DEPENDENCIES) lib/$(am__dirstamp) + $(AM_V_at)-rm -f lib/liby.a + $(AM_V_AR)$(lib_liby_a_AR) lib/liby.a $(lib_liby_a_OBJECTS) $(lib_liby_a_LIBADD) + $(AM_V_at)$(RANLIB) lib/liby.a +examples/calc++/$(am__dirstamp): + @$(MKDIR_P) examples/calc++ + @: > examples/calc++/$(am__dirstamp) +examples/calc++/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) examples/calc++/$(DEPDIR) + @: > examples/calc++/$(DEPDIR)/$(am__dirstamp) +examples/calc++/calc__-calc++-driver.$(OBJEXT): \ + examples/calc++/$(am__dirstamp) \ + examples/calc++/$(DEPDIR)/$(am__dirstamp) +examples/calc++/calc__-calc++-scanner.$(OBJEXT): \ + examples/calc++/$(am__dirstamp) \ + examples/calc++/$(DEPDIR)/$(am__dirstamp) +examples/calc++/calc__-calc++.$(OBJEXT): \ + examples/calc++/$(am__dirstamp) \ + examples/calc++/$(DEPDIR)/$(am__dirstamp) +examples/calc++/calc__-calc++-parser.$(OBJEXT): \ + examples/calc++/$(am__dirstamp) \ + examples/calc++/$(DEPDIR)/$(am__dirstamp) + +examples/calc++/calc++$(EXEEXT): $(examples_calc___calc___OBJECTS) $(examples_calc___calc___DEPENDENCIES) $(EXTRA_examples_calc___calc___DEPENDENCIES) examples/calc++/$(am__dirstamp) + @rm -f examples/calc++/calc++$(EXEEXT) + $(AM_V_CXXLD)$(examples_calc___calc___LINK) $(examples_calc___calc___OBJECTS) $(examples_calc___calc___LDADD) $(LIBS) +examples/mfcalc/mfcalc.h: examples/mfcalc/mfcalc.c + @if test ! -f $@; then rm -f examples/mfcalc/mfcalc.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) examples/mfcalc/mfcalc.c; else :; fi +examples/mfcalc/$(am__dirstamp): + @$(MKDIR_P) examples/mfcalc + @: > examples/mfcalc/$(am__dirstamp) +examples/mfcalc/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) examples/mfcalc/$(DEPDIR) + @: > examples/mfcalc/$(DEPDIR)/$(am__dirstamp) +examples/mfcalc/mfcalc-mfcalc.$(OBJEXT): \ + examples/mfcalc/$(am__dirstamp) \ + examples/mfcalc/$(DEPDIR)/$(am__dirstamp) + +examples/mfcalc/mfcalc$(EXEEXT): $(examples_mfcalc_mfcalc_OBJECTS) $(examples_mfcalc_mfcalc_DEPENDENCIES) $(EXTRA_examples_mfcalc_mfcalc_DEPENDENCIES) examples/mfcalc/$(am__dirstamp) + @rm -f examples/mfcalc/mfcalc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(examples_mfcalc_mfcalc_OBJECTS) $(examples_mfcalc_mfcalc_LDADD) $(LIBS) +examples/rpcalc/rpcalc.h: examples/rpcalc/rpcalc.c + @if test ! -f $@; then rm -f examples/rpcalc/rpcalc.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) examples/rpcalc/rpcalc.c; else :; fi +examples/rpcalc/$(am__dirstamp): + @$(MKDIR_P) examples/rpcalc + @: > examples/rpcalc/$(am__dirstamp) +examples/rpcalc/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) examples/rpcalc/$(DEPDIR) + @: > examples/rpcalc/$(DEPDIR)/$(am__dirstamp) +examples/rpcalc/rpcalc-rpcalc.$(OBJEXT): \ + examples/rpcalc/$(am__dirstamp) \ + examples/rpcalc/$(DEPDIR)/$(am__dirstamp) + +examples/rpcalc/rpcalc$(EXEEXT): $(examples_rpcalc_rpcalc_OBJECTS) $(examples_rpcalc_rpcalc_DEPENDENCIES) $(EXTRA_examples_rpcalc_rpcalc_DEPENDENCIES) examples/rpcalc/$(am__dirstamp) + @rm -f examples/rpcalc/rpcalc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(examples_rpcalc_rpcalc_OBJECTS) $(examples_rpcalc_rpcalc_LDADD) $(LIBS) +src/$(am__dirstamp): + @$(MKDIR_P) src + @: > src/$(am__dirstamp) +src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/$(DEPDIR) + @: > src/$(DEPDIR)/$(am__dirstamp) +src/bison-AnnotationList.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-InadequacyList.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-LR0.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-Sbitset.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-assoc.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-closure.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-complain.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-conflicts.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-derives.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-files.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-getargs.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-graphviz.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-lalr.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-ielr.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-location.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-main.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-muscle-tab.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-named-ref.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-nullable.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-output.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/parse-gram.h: src/parse-gram.c + @if test ! -f $@; then rm -f src/parse-gram.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/parse-gram.c; else :; fi +src/bison-parse-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-print-xml.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-print.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-print_graph.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-reader.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-reduce.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-relation.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-code-c.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-gram-c.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-skel-c.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-state.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-symlist.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-symtab.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-tables.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-uniqstr.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-code.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bison-scan-skel.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/bison$(EXEEXT): $(src_bison_OBJECTS) $(src_bison_DEPENDENCIES) $(EXTRA_src_bison_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/bison$(EXEEXT) + $(AM_V_CCLD)$(src_bison_LINK) $(src_bison_OBJECTS) $(src_bison_LDADD) $(LIBS) +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) + +installcheck-binSCRIPTS: $(bin_SCRIPTS) + bad=0; pid=$$$$; list="$(bin_SCRIPTS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f examples/calc++/*.$(OBJEXT) + -rm -f examples/mfcalc/*.$(OBJEXT) + -rm -f examples/rpcalc/*.$(OBJEXT) + -rm -f lib/*.$(OBJEXT) + -rm -f lib/glthread/*.$(OBJEXT) + -rm -f lib/uniwidth/*.$(OBJEXT) + -rm -f src/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@examples/calc++/$(DEPDIR)/calc__-calc++-driver.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@examples/calc++/$(DEPDIR)/calc__-calc++-parser.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@examples/calc++/$(DEPDIR)/calc__-calc++.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/abitset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/argmatch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/asnprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/basename-lgpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/binary-io.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitrotate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitset_stats.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitsetv-print.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bitsetv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/c-ctype.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/c-strcasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/c-strncasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/calloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/cloexec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/close-stream.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/close.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/closeout.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/concat-filename.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirname-lgpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dup-safer-flag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dup-safer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ebitset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/error.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/exitfail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fatal-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fd-hook.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fd-safer-flag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fd-safer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/float.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fopen-safer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fopen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fpending.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/frexp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/frexpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fseterr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/get-errno.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getprogname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hard-locale.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnan.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnand.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnanf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnanl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/itold.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lbitset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ldexpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/localcharset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/malloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/malloca.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/math.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbrtowc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbsinit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbswidth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/memchr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/msvc-inval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/msvc-nothrow.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/obstack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/obstack_printf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/perror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/pipe-safer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/pipe2-safer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-args.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-frexp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-frexpl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-parse.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/progname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/quotearg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/raise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/rawmemchr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/realloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sig-handler.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/snprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn-pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_addclose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_adddup2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_addopen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_destroy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawn_faction_init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnattr_destroy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnattr_init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnattr_setflags.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnattr_setsigmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawni.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/spawnp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stat-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stat-w32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stpcpy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strchrnul.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strdup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror-override.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror_r.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stripslash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strverscmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/timevar.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unistd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unsetenv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vasnprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vbitset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vfprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vsnprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vsprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/wait-process.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/waitpid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/wctype-h.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/wcwidth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xalloc-die.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xconcat-filename.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xmalloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xmemdup0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xsize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xstrndup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/yyerror.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/glthread/$(DEPDIR)/lock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/glthread/$(DEPDIR)/threadlib.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/uniwidth/$(DEPDIR)/width.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-AnnotationList.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-InadequacyList.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-LR0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-Sbitset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-assoc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-closure.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-complain.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-conflicts.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-derives.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-files.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-getargs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-gram.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-graphviz.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-ielr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-lalr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-location.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-muscle-tab.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-named-ref.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-nullable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-output.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-parse-gram.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print-xml.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print_graph.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-reader.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-reduce.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-relation.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-code-c.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-code.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-gram-c.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-gram.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-skel-c.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-scan-skel.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-state.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-symlist.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-symtab.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-tables.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-uniqstr.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +examples/mfcalc/mfcalc-mfcalc.o: examples/mfcalc/mfcalc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_mfcalc_mfcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT examples/mfcalc/mfcalc-mfcalc.o -MD -MP -MF examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Tpo -c -o examples/mfcalc/mfcalc-mfcalc.o `test -f 'examples/mfcalc/mfcalc.c' || echo '$(srcdir)/'`examples/mfcalc/mfcalc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Tpo examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/mfcalc/mfcalc.c' object='examples/mfcalc/mfcalc-mfcalc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_mfcalc_mfcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o examples/mfcalc/mfcalc-mfcalc.o `test -f 'examples/mfcalc/mfcalc.c' || echo '$(srcdir)/'`examples/mfcalc/mfcalc.c + +examples/mfcalc/mfcalc-mfcalc.obj: examples/mfcalc/mfcalc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_mfcalc_mfcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT examples/mfcalc/mfcalc-mfcalc.obj -MD -MP -MF examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Tpo -c -o examples/mfcalc/mfcalc-mfcalc.obj `if test -f 'examples/mfcalc/mfcalc.c'; then $(CYGPATH_W) 'examples/mfcalc/mfcalc.c'; else $(CYGPATH_W) '$(srcdir)/examples/mfcalc/mfcalc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Tpo examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/mfcalc/mfcalc.c' object='examples/mfcalc/mfcalc-mfcalc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_mfcalc_mfcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o examples/mfcalc/mfcalc-mfcalc.obj `if test -f 'examples/mfcalc/mfcalc.c'; then $(CYGPATH_W) 'examples/mfcalc/mfcalc.c'; else $(CYGPATH_W) '$(srcdir)/examples/mfcalc/mfcalc.c'; fi` + +examples/rpcalc/rpcalc-rpcalc.o: examples/rpcalc/rpcalc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_rpcalc_rpcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT examples/rpcalc/rpcalc-rpcalc.o -MD -MP -MF examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Tpo -c -o examples/rpcalc/rpcalc-rpcalc.o `test -f 'examples/rpcalc/rpcalc.c' || echo '$(srcdir)/'`examples/rpcalc/rpcalc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Tpo examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/rpcalc/rpcalc.c' object='examples/rpcalc/rpcalc-rpcalc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_rpcalc_rpcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o examples/rpcalc/rpcalc-rpcalc.o `test -f 'examples/rpcalc/rpcalc.c' || echo '$(srcdir)/'`examples/rpcalc/rpcalc.c + +examples/rpcalc/rpcalc-rpcalc.obj: examples/rpcalc/rpcalc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_rpcalc_rpcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT examples/rpcalc/rpcalc-rpcalc.obj -MD -MP -MF examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Tpo -c -o examples/rpcalc/rpcalc-rpcalc.obj `if test -f 'examples/rpcalc/rpcalc.c'; then $(CYGPATH_W) 'examples/rpcalc/rpcalc.c'; else $(CYGPATH_W) '$(srcdir)/examples/rpcalc/rpcalc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Tpo examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/rpcalc/rpcalc.c' object='examples/rpcalc/rpcalc-rpcalc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_rpcalc_rpcalc_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o examples/rpcalc/rpcalc-rpcalc.obj `if test -f 'examples/rpcalc/rpcalc.c'; then $(CYGPATH_W) 'examples/rpcalc/rpcalc.c'; else $(CYGPATH_W) '$(srcdir)/examples/rpcalc/rpcalc.c'; fi` + +src/bison-AnnotationList.o: src/AnnotationList.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-AnnotationList.o -MD -MP -MF src/$(DEPDIR)/bison-AnnotationList.Tpo -c -o src/bison-AnnotationList.o `test -f 'src/AnnotationList.c' || echo '$(srcdir)/'`src/AnnotationList.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-AnnotationList.Tpo src/$(DEPDIR)/bison-AnnotationList.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/AnnotationList.c' object='src/bison-AnnotationList.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-AnnotationList.o `test -f 'src/AnnotationList.c' || echo '$(srcdir)/'`src/AnnotationList.c + +src/bison-AnnotationList.obj: src/AnnotationList.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-AnnotationList.obj -MD -MP -MF src/$(DEPDIR)/bison-AnnotationList.Tpo -c -o src/bison-AnnotationList.obj `if test -f 'src/AnnotationList.c'; then $(CYGPATH_W) 'src/AnnotationList.c'; else $(CYGPATH_W) '$(srcdir)/src/AnnotationList.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-AnnotationList.Tpo src/$(DEPDIR)/bison-AnnotationList.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/AnnotationList.c' object='src/bison-AnnotationList.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-AnnotationList.obj `if test -f 'src/AnnotationList.c'; then $(CYGPATH_W) 'src/AnnotationList.c'; else $(CYGPATH_W) '$(srcdir)/src/AnnotationList.c'; fi` + +src/bison-InadequacyList.o: src/InadequacyList.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-InadequacyList.o -MD -MP -MF src/$(DEPDIR)/bison-InadequacyList.Tpo -c -o src/bison-InadequacyList.o `test -f 'src/InadequacyList.c' || echo '$(srcdir)/'`src/InadequacyList.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-InadequacyList.Tpo src/$(DEPDIR)/bison-InadequacyList.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/InadequacyList.c' object='src/bison-InadequacyList.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-InadequacyList.o `test -f 'src/InadequacyList.c' || echo '$(srcdir)/'`src/InadequacyList.c + +src/bison-InadequacyList.obj: src/InadequacyList.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-InadequacyList.obj -MD -MP -MF src/$(DEPDIR)/bison-InadequacyList.Tpo -c -o src/bison-InadequacyList.obj `if test -f 'src/InadequacyList.c'; then $(CYGPATH_W) 'src/InadequacyList.c'; else $(CYGPATH_W) '$(srcdir)/src/InadequacyList.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-InadequacyList.Tpo src/$(DEPDIR)/bison-InadequacyList.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/InadequacyList.c' object='src/bison-InadequacyList.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-InadequacyList.obj `if test -f 'src/InadequacyList.c'; then $(CYGPATH_W) 'src/InadequacyList.c'; else $(CYGPATH_W) '$(srcdir)/src/InadequacyList.c'; fi` + +src/bison-LR0.o: src/LR0.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-LR0.o -MD -MP -MF src/$(DEPDIR)/bison-LR0.Tpo -c -o src/bison-LR0.o `test -f 'src/LR0.c' || echo '$(srcdir)/'`src/LR0.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-LR0.Tpo src/$(DEPDIR)/bison-LR0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/LR0.c' object='src/bison-LR0.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-LR0.o `test -f 'src/LR0.c' || echo '$(srcdir)/'`src/LR0.c + +src/bison-LR0.obj: src/LR0.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-LR0.obj -MD -MP -MF src/$(DEPDIR)/bison-LR0.Tpo -c -o src/bison-LR0.obj `if test -f 'src/LR0.c'; then $(CYGPATH_W) 'src/LR0.c'; else $(CYGPATH_W) '$(srcdir)/src/LR0.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-LR0.Tpo src/$(DEPDIR)/bison-LR0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/LR0.c' object='src/bison-LR0.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-LR0.obj `if test -f 'src/LR0.c'; then $(CYGPATH_W) 'src/LR0.c'; else $(CYGPATH_W) '$(srcdir)/src/LR0.c'; fi` + +src/bison-Sbitset.o: src/Sbitset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-Sbitset.o -MD -MP -MF src/$(DEPDIR)/bison-Sbitset.Tpo -c -o src/bison-Sbitset.o `test -f 'src/Sbitset.c' || echo '$(srcdir)/'`src/Sbitset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-Sbitset.Tpo src/$(DEPDIR)/bison-Sbitset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/Sbitset.c' object='src/bison-Sbitset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-Sbitset.o `test -f 'src/Sbitset.c' || echo '$(srcdir)/'`src/Sbitset.c + +src/bison-Sbitset.obj: src/Sbitset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-Sbitset.obj -MD -MP -MF src/$(DEPDIR)/bison-Sbitset.Tpo -c -o src/bison-Sbitset.obj `if test -f 'src/Sbitset.c'; then $(CYGPATH_W) 'src/Sbitset.c'; else $(CYGPATH_W) '$(srcdir)/src/Sbitset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-Sbitset.Tpo src/$(DEPDIR)/bison-Sbitset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/Sbitset.c' object='src/bison-Sbitset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-Sbitset.obj `if test -f 'src/Sbitset.c'; then $(CYGPATH_W) 'src/Sbitset.c'; else $(CYGPATH_W) '$(srcdir)/src/Sbitset.c'; fi` + +src/bison-assoc.o: src/assoc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-assoc.o -MD -MP -MF src/$(DEPDIR)/bison-assoc.Tpo -c -o src/bison-assoc.o `test -f 'src/assoc.c' || echo '$(srcdir)/'`src/assoc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-assoc.Tpo src/$(DEPDIR)/bison-assoc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/assoc.c' object='src/bison-assoc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-assoc.o `test -f 'src/assoc.c' || echo '$(srcdir)/'`src/assoc.c + +src/bison-assoc.obj: src/assoc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-assoc.obj -MD -MP -MF src/$(DEPDIR)/bison-assoc.Tpo -c -o src/bison-assoc.obj `if test -f 'src/assoc.c'; then $(CYGPATH_W) 'src/assoc.c'; else $(CYGPATH_W) '$(srcdir)/src/assoc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-assoc.Tpo src/$(DEPDIR)/bison-assoc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/assoc.c' object='src/bison-assoc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-assoc.obj `if test -f 'src/assoc.c'; then $(CYGPATH_W) 'src/assoc.c'; else $(CYGPATH_W) '$(srcdir)/src/assoc.c'; fi` + +src/bison-closure.o: src/closure.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-closure.o -MD -MP -MF src/$(DEPDIR)/bison-closure.Tpo -c -o src/bison-closure.o `test -f 'src/closure.c' || echo '$(srcdir)/'`src/closure.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-closure.Tpo src/$(DEPDIR)/bison-closure.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/closure.c' object='src/bison-closure.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-closure.o `test -f 'src/closure.c' || echo '$(srcdir)/'`src/closure.c + +src/bison-closure.obj: src/closure.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-closure.obj -MD -MP -MF src/$(DEPDIR)/bison-closure.Tpo -c -o src/bison-closure.obj `if test -f 'src/closure.c'; then $(CYGPATH_W) 'src/closure.c'; else $(CYGPATH_W) '$(srcdir)/src/closure.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-closure.Tpo src/$(DEPDIR)/bison-closure.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/closure.c' object='src/bison-closure.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-closure.obj `if test -f 'src/closure.c'; then $(CYGPATH_W) 'src/closure.c'; else $(CYGPATH_W) '$(srcdir)/src/closure.c'; fi` + +src/bison-complain.o: src/complain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-complain.o -MD -MP -MF src/$(DEPDIR)/bison-complain.Tpo -c -o src/bison-complain.o `test -f 'src/complain.c' || echo '$(srcdir)/'`src/complain.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-complain.Tpo src/$(DEPDIR)/bison-complain.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/complain.c' object='src/bison-complain.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-complain.o `test -f 'src/complain.c' || echo '$(srcdir)/'`src/complain.c + +src/bison-complain.obj: src/complain.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-complain.obj -MD -MP -MF src/$(DEPDIR)/bison-complain.Tpo -c -o src/bison-complain.obj `if test -f 'src/complain.c'; then $(CYGPATH_W) 'src/complain.c'; else $(CYGPATH_W) '$(srcdir)/src/complain.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-complain.Tpo src/$(DEPDIR)/bison-complain.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/complain.c' object='src/bison-complain.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-complain.obj `if test -f 'src/complain.c'; then $(CYGPATH_W) 'src/complain.c'; else $(CYGPATH_W) '$(srcdir)/src/complain.c'; fi` + +src/bison-conflicts.o: src/conflicts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-conflicts.o -MD -MP -MF src/$(DEPDIR)/bison-conflicts.Tpo -c -o src/bison-conflicts.o `test -f 'src/conflicts.c' || echo '$(srcdir)/'`src/conflicts.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-conflicts.Tpo src/$(DEPDIR)/bison-conflicts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/conflicts.c' object='src/bison-conflicts.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-conflicts.o `test -f 'src/conflicts.c' || echo '$(srcdir)/'`src/conflicts.c + +src/bison-conflicts.obj: src/conflicts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-conflicts.obj -MD -MP -MF src/$(DEPDIR)/bison-conflicts.Tpo -c -o src/bison-conflicts.obj `if test -f 'src/conflicts.c'; then $(CYGPATH_W) 'src/conflicts.c'; else $(CYGPATH_W) '$(srcdir)/src/conflicts.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-conflicts.Tpo src/$(DEPDIR)/bison-conflicts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/conflicts.c' object='src/bison-conflicts.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-conflicts.obj `if test -f 'src/conflicts.c'; then $(CYGPATH_W) 'src/conflicts.c'; else $(CYGPATH_W) '$(srcdir)/src/conflicts.c'; fi` + +src/bison-derives.o: src/derives.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-derives.o -MD -MP -MF src/$(DEPDIR)/bison-derives.Tpo -c -o src/bison-derives.o `test -f 'src/derives.c' || echo '$(srcdir)/'`src/derives.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-derives.Tpo src/$(DEPDIR)/bison-derives.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/derives.c' object='src/bison-derives.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-derives.o `test -f 'src/derives.c' || echo '$(srcdir)/'`src/derives.c + +src/bison-derives.obj: src/derives.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-derives.obj -MD -MP -MF src/$(DEPDIR)/bison-derives.Tpo -c -o src/bison-derives.obj `if test -f 'src/derives.c'; then $(CYGPATH_W) 'src/derives.c'; else $(CYGPATH_W) '$(srcdir)/src/derives.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-derives.Tpo src/$(DEPDIR)/bison-derives.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/derives.c' object='src/bison-derives.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-derives.obj `if test -f 'src/derives.c'; then $(CYGPATH_W) 'src/derives.c'; else $(CYGPATH_W) '$(srcdir)/src/derives.c'; fi` + +src/bison-files.o: src/files.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-files.o -MD -MP -MF src/$(DEPDIR)/bison-files.Tpo -c -o src/bison-files.o `test -f 'src/files.c' || echo '$(srcdir)/'`src/files.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-files.Tpo src/$(DEPDIR)/bison-files.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/files.c' object='src/bison-files.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-files.o `test -f 'src/files.c' || echo '$(srcdir)/'`src/files.c + +src/bison-files.obj: src/files.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-files.obj -MD -MP -MF src/$(DEPDIR)/bison-files.Tpo -c -o src/bison-files.obj `if test -f 'src/files.c'; then $(CYGPATH_W) 'src/files.c'; else $(CYGPATH_W) '$(srcdir)/src/files.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-files.Tpo src/$(DEPDIR)/bison-files.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/files.c' object='src/bison-files.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-files.obj `if test -f 'src/files.c'; then $(CYGPATH_W) 'src/files.c'; else $(CYGPATH_W) '$(srcdir)/src/files.c'; fi` + +src/bison-getargs.o: src/getargs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-getargs.o -MD -MP -MF src/$(DEPDIR)/bison-getargs.Tpo -c -o src/bison-getargs.o `test -f 'src/getargs.c' || echo '$(srcdir)/'`src/getargs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-getargs.Tpo src/$(DEPDIR)/bison-getargs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/getargs.c' object='src/bison-getargs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-getargs.o `test -f 'src/getargs.c' || echo '$(srcdir)/'`src/getargs.c + +src/bison-getargs.obj: src/getargs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-getargs.obj -MD -MP -MF src/$(DEPDIR)/bison-getargs.Tpo -c -o src/bison-getargs.obj `if test -f 'src/getargs.c'; then $(CYGPATH_W) 'src/getargs.c'; else $(CYGPATH_W) '$(srcdir)/src/getargs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-getargs.Tpo src/$(DEPDIR)/bison-getargs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/getargs.c' object='src/bison-getargs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-getargs.obj `if test -f 'src/getargs.c'; then $(CYGPATH_W) 'src/getargs.c'; else $(CYGPATH_W) '$(srcdir)/src/getargs.c'; fi` + +src/bison-gram.o: src/gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-gram.o -MD -MP -MF src/$(DEPDIR)/bison-gram.Tpo -c -o src/bison-gram.o `test -f 'src/gram.c' || echo '$(srcdir)/'`src/gram.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-gram.Tpo src/$(DEPDIR)/bison-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gram.c' object='src/bison-gram.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-gram.o `test -f 'src/gram.c' || echo '$(srcdir)/'`src/gram.c + +src/bison-gram.obj: src/gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-gram.obj -MD -MP -MF src/$(DEPDIR)/bison-gram.Tpo -c -o src/bison-gram.obj `if test -f 'src/gram.c'; then $(CYGPATH_W) 'src/gram.c'; else $(CYGPATH_W) '$(srcdir)/src/gram.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-gram.Tpo src/$(DEPDIR)/bison-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gram.c' object='src/bison-gram.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-gram.obj `if test -f 'src/gram.c'; then $(CYGPATH_W) 'src/gram.c'; else $(CYGPATH_W) '$(srcdir)/src/gram.c'; fi` + +src/bison-graphviz.o: src/graphviz.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-graphviz.o -MD -MP -MF src/$(DEPDIR)/bison-graphviz.Tpo -c -o src/bison-graphviz.o `test -f 'src/graphviz.c' || echo '$(srcdir)/'`src/graphviz.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-graphviz.Tpo src/$(DEPDIR)/bison-graphviz.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/graphviz.c' object='src/bison-graphviz.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-graphviz.o `test -f 'src/graphviz.c' || echo '$(srcdir)/'`src/graphviz.c + +src/bison-graphviz.obj: src/graphviz.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-graphviz.obj -MD -MP -MF src/$(DEPDIR)/bison-graphviz.Tpo -c -o src/bison-graphviz.obj `if test -f 'src/graphviz.c'; then $(CYGPATH_W) 'src/graphviz.c'; else $(CYGPATH_W) '$(srcdir)/src/graphviz.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-graphviz.Tpo src/$(DEPDIR)/bison-graphviz.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/graphviz.c' object='src/bison-graphviz.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-graphviz.obj `if test -f 'src/graphviz.c'; then $(CYGPATH_W) 'src/graphviz.c'; else $(CYGPATH_W) '$(srcdir)/src/graphviz.c'; fi` + +src/bison-lalr.o: src/lalr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-lalr.o -MD -MP -MF src/$(DEPDIR)/bison-lalr.Tpo -c -o src/bison-lalr.o `test -f 'src/lalr.c' || echo '$(srcdir)/'`src/lalr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-lalr.Tpo src/$(DEPDIR)/bison-lalr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/lalr.c' object='src/bison-lalr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-lalr.o `test -f 'src/lalr.c' || echo '$(srcdir)/'`src/lalr.c + +src/bison-lalr.obj: src/lalr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-lalr.obj -MD -MP -MF src/$(DEPDIR)/bison-lalr.Tpo -c -o src/bison-lalr.obj `if test -f 'src/lalr.c'; then $(CYGPATH_W) 'src/lalr.c'; else $(CYGPATH_W) '$(srcdir)/src/lalr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-lalr.Tpo src/$(DEPDIR)/bison-lalr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/lalr.c' object='src/bison-lalr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-lalr.obj `if test -f 'src/lalr.c'; then $(CYGPATH_W) 'src/lalr.c'; else $(CYGPATH_W) '$(srcdir)/src/lalr.c'; fi` + +src/bison-ielr.o: src/ielr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-ielr.o -MD -MP -MF src/$(DEPDIR)/bison-ielr.Tpo -c -o src/bison-ielr.o `test -f 'src/ielr.c' || echo '$(srcdir)/'`src/ielr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-ielr.Tpo src/$(DEPDIR)/bison-ielr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ielr.c' object='src/bison-ielr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-ielr.o `test -f 'src/ielr.c' || echo '$(srcdir)/'`src/ielr.c + +src/bison-ielr.obj: src/ielr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-ielr.obj -MD -MP -MF src/$(DEPDIR)/bison-ielr.Tpo -c -o src/bison-ielr.obj `if test -f 'src/ielr.c'; then $(CYGPATH_W) 'src/ielr.c'; else $(CYGPATH_W) '$(srcdir)/src/ielr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-ielr.Tpo src/$(DEPDIR)/bison-ielr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ielr.c' object='src/bison-ielr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-ielr.obj `if test -f 'src/ielr.c'; then $(CYGPATH_W) 'src/ielr.c'; else $(CYGPATH_W) '$(srcdir)/src/ielr.c'; fi` + +src/bison-location.o: src/location.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-location.o -MD -MP -MF src/$(DEPDIR)/bison-location.Tpo -c -o src/bison-location.o `test -f 'src/location.c' || echo '$(srcdir)/'`src/location.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-location.Tpo src/$(DEPDIR)/bison-location.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/location.c' object='src/bison-location.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-location.o `test -f 'src/location.c' || echo '$(srcdir)/'`src/location.c + +src/bison-location.obj: src/location.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-location.obj -MD -MP -MF src/$(DEPDIR)/bison-location.Tpo -c -o src/bison-location.obj `if test -f 'src/location.c'; then $(CYGPATH_W) 'src/location.c'; else $(CYGPATH_W) '$(srcdir)/src/location.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-location.Tpo src/$(DEPDIR)/bison-location.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/location.c' object='src/bison-location.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-location.obj `if test -f 'src/location.c'; then $(CYGPATH_W) 'src/location.c'; else $(CYGPATH_W) '$(srcdir)/src/location.c'; fi` + +src/bison-main.o: src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-main.o -MD -MP -MF src/$(DEPDIR)/bison-main.Tpo -c -o src/bison-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-main.Tpo src/$(DEPDIR)/bison-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/bison-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c + +src/bison-main.obj: src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-main.obj -MD -MP -MF src/$(DEPDIR)/bison-main.Tpo -c -o src/bison-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-main.Tpo src/$(DEPDIR)/bison-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/bison-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` + +src/bison-muscle-tab.o: src/muscle-tab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-muscle-tab.o -MD -MP -MF src/$(DEPDIR)/bison-muscle-tab.Tpo -c -o src/bison-muscle-tab.o `test -f 'src/muscle-tab.c' || echo '$(srcdir)/'`src/muscle-tab.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-muscle-tab.Tpo src/$(DEPDIR)/bison-muscle-tab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/muscle-tab.c' object='src/bison-muscle-tab.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-muscle-tab.o `test -f 'src/muscle-tab.c' || echo '$(srcdir)/'`src/muscle-tab.c + +src/bison-muscle-tab.obj: src/muscle-tab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-muscle-tab.obj -MD -MP -MF src/$(DEPDIR)/bison-muscle-tab.Tpo -c -o src/bison-muscle-tab.obj `if test -f 'src/muscle-tab.c'; then $(CYGPATH_W) 'src/muscle-tab.c'; else $(CYGPATH_W) '$(srcdir)/src/muscle-tab.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-muscle-tab.Tpo src/$(DEPDIR)/bison-muscle-tab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/muscle-tab.c' object='src/bison-muscle-tab.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-muscle-tab.obj `if test -f 'src/muscle-tab.c'; then $(CYGPATH_W) 'src/muscle-tab.c'; else $(CYGPATH_W) '$(srcdir)/src/muscle-tab.c'; fi` + +src/bison-named-ref.o: src/named-ref.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-named-ref.o -MD -MP -MF src/$(DEPDIR)/bison-named-ref.Tpo -c -o src/bison-named-ref.o `test -f 'src/named-ref.c' || echo '$(srcdir)/'`src/named-ref.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-named-ref.Tpo src/$(DEPDIR)/bison-named-ref.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/named-ref.c' object='src/bison-named-ref.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-named-ref.o `test -f 'src/named-ref.c' || echo '$(srcdir)/'`src/named-ref.c + +src/bison-named-ref.obj: src/named-ref.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-named-ref.obj -MD -MP -MF src/$(DEPDIR)/bison-named-ref.Tpo -c -o src/bison-named-ref.obj `if test -f 'src/named-ref.c'; then $(CYGPATH_W) 'src/named-ref.c'; else $(CYGPATH_W) '$(srcdir)/src/named-ref.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-named-ref.Tpo src/$(DEPDIR)/bison-named-ref.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/named-ref.c' object='src/bison-named-ref.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-named-ref.obj `if test -f 'src/named-ref.c'; then $(CYGPATH_W) 'src/named-ref.c'; else $(CYGPATH_W) '$(srcdir)/src/named-ref.c'; fi` + +src/bison-nullable.o: src/nullable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-nullable.o -MD -MP -MF src/$(DEPDIR)/bison-nullable.Tpo -c -o src/bison-nullable.o `test -f 'src/nullable.c' || echo '$(srcdir)/'`src/nullable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-nullable.Tpo src/$(DEPDIR)/bison-nullable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/nullable.c' object='src/bison-nullable.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-nullable.o `test -f 'src/nullable.c' || echo '$(srcdir)/'`src/nullable.c + +src/bison-nullable.obj: src/nullable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-nullable.obj -MD -MP -MF src/$(DEPDIR)/bison-nullable.Tpo -c -o src/bison-nullable.obj `if test -f 'src/nullable.c'; then $(CYGPATH_W) 'src/nullable.c'; else $(CYGPATH_W) '$(srcdir)/src/nullable.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-nullable.Tpo src/$(DEPDIR)/bison-nullable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/nullable.c' object='src/bison-nullable.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-nullable.obj `if test -f 'src/nullable.c'; then $(CYGPATH_W) 'src/nullable.c'; else $(CYGPATH_W) '$(srcdir)/src/nullable.c'; fi` + +src/bison-output.o: src/output.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-output.o -MD -MP -MF src/$(DEPDIR)/bison-output.Tpo -c -o src/bison-output.o `test -f 'src/output.c' || echo '$(srcdir)/'`src/output.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-output.Tpo src/$(DEPDIR)/bison-output.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/output.c' object='src/bison-output.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-output.o `test -f 'src/output.c' || echo '$(srcdir)/'`src/output.c + +src/bison-output.obj: src/output.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-output.obj -MD -MP -MF src/$(DEPDIR)/bison-output.Tpo -c -o src/bison-output.obj `if test -f 'src/output.c'; then $(CYGPATH_W) 'src/output.c'; else $(CYGPATH_W) '$(srcdir)/src/output.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-output.Tpo src/$(DEPDIR)/bison-output.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/output.c' object='src/bison-output.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-output.obj `if test -f 'src/output.c'; then $(CYGPATH_W) 'src/output.c'; else $(CYGPATH_W) '$(srcdir)/src/output.c'; fi` + +src/bison-parse-gram.o: src/parse-gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-parse-gram.o -MD -MP -MF src/$(DEPDIR)/bison-parse-gram.Tpo -c -o src/bison-parse-gram.o `test -f 'src/parse-gram.c' || echo '$(srcdir)/'`src/parse-gram.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-parse-gram.Tpo src/$(DEPDIR)/bison-parse-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/parse-gram.c' object='src/bison-parse-gram.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-parse-gram.o `test -f 'src/parse-gram.c' || echo '$(srcdir)/'`src/parse-gram.c + +src/bison-parse-gram.obj: src/parse-gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-parse-gram.obj -MD -MP -MF src/$(DEPDIR)/bison-parse-gram.Tpo -c -o src/bison-parse-gram.obj `if test -f 'src/parse-gram.c'; then $(CYGPATH_W) 'src/parse-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/parse-gram.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-parse-gram.Tpo src/$(DEPDIR)/bison-parse-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/parse-gram.c' object='src/bison-parse-gram.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-parse-gram.obj `if test -f 'src/parse-gram.c'; then $(CYGPATH_W) 'src/parse-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/parse-gram.c'; fi` + +src/bison-print-xml.o: src/print-xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print-xml.o -MD -MP -MF src/$(DEPDIR)/bison-print-xml.Tpo -c -o src/bison-print-xml.o `test -f 'src/print-xml.c' || echo '$(srcdir)/'`src/print-xml.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print-xml.Tpo src/$(DEPDIR)/bison-print-xml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print-xml.c' object='src/bison-print-xml.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print-xml.o `test -f 'src/print-xml.c' || echo '$(srcdir)/'`src/print-xml.c + +src/bison-print-xml.obj: src/print-xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print-xml.obj -MD -MP -MF src/$(DEPDIR)/bison-print-xml.Tpo -c -o src/bison-print-xml.obj `if test -f 'src/print-xml.c'; then $(CYGPATH_W) 'src/print-xml.c'; else $(CYGPATH_W) '$(srcdir)/src/print-xml.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print-xml.Tpo src/$(DEPDIR)/bison-print-xml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print-xml.c' object='src/bison-print-xml.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print-xml.obj `if test -f 'src/print-xml.c'; then $(CYGPATH_W) 'src/print-xml.c'; else $(CYGPATH_W) '$(srcdir)/src/print-xml.c'; fi` + +src/bison-print.o: src/print.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print.o -MD -MP -MF src/$(DEPDIR)/bison-print.Tpo -c -o src/bison-print.o `test -f 'src/print.c' || echo '$(srcdir)/'`src/print.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print.Tpo src/$(DEPDIR)/bison-print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print.c' object='src/bison-print.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print.o `test -f 'src/print.c' || echo '$(srcdir)/'`src/print.c + +src/bison-print.obj: src/print.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print.obj -MD -MP -MF src/$(DEPDIR)/bison-print.Tpo -c -o src/bison-print.obj `if test -f 'src/print.c'; then $(CYGPATH_W) 'src/print.c'; else $(CYGPATH_W) '$(srcdir)/src/print.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print.Tpo src/$(DEPDIR)/bison-print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print.c' object='src/bison-print.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print.obj `if test -f 'src/print.c'; then $(CYGPATH_W) 'src/print.c'; else $(CYGPATH_W) '$(srcdir)/src/print.c'; fi` + +src/bison-print_graph.o: src/print_graph.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print_graph.o -MD -MP -MF src/$(DEPDIR)/bison-print_graph.Tpo -c -o src/bison-print_graph.o `test -f 'src/print_graph.c' || echo '$(srcdir)/'`src/print_graph.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print_graph.Tpo src/$(DEPDIR)/bison-print_graph.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print_graph.c' object='src/bison-print_graph.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print_graph.o `test -f 'src/print_graph.c' || echo '$(srcdir)/'`src/print_graph.c + +src/bison-print_graph.obj: src/print_graph.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print_graph.obj -MD -MP -MF src/$(DEPDIR)/bison-print_graph.Tpo -c -o src/bison-print_graph.obj `if test -f 'src/print_graph.c'; then $(CYGPATH_W) 'src/print_graph.c'; else $(CYGPATH_W) '$(srcdir)/src/print_graph.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print_graph.Tpo src/$(DEPDIR)/bison-print_graph.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/print_graph.c' object='src/bison-print_graph.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-print_graph.obj `if test -f 'src/print_graph.c'; then $(CYGPATH_W) 'src/print_graph.c'; else $(CYGPATH_W) '$(srcdir)/src/print_graph.c'; fi` + +src/bison-reader.o: src/reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-reader.o -MD -MP -MF src/$(DEPDIR)/bison-reader.Tpo -c -o src/bison-reader.o `test -f 'src/reader.c' || echo '$(srcdir)/'`src/reader.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-reader.Tpo src/$(DEPDIR)/bison-reader.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/reader.c' object='src/bison-reader.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-reader.o `test -f 'src/reader.c' || echo '$(srcdir)/'`src/reader.c + +src/bison-reader.obj: src/reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-reader.obj -MD -MP -MF src/$(DEPDIR)/bison-reader.Tpo -c -o src/bison-reader.obj `if test -f 'src/reader.c'; then $(CYGPATH_W) 'src/reader.c'; else $(CYGPATH_W) '$(srcdir)/src/reader.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-reader.Tpo src/$(DEPDIR)/bison-reader.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/reader.c' object='src/bison-reader.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-reader.obj `if test -f 'src/reader.c'; then $(CYGPATH_W) 'src/reader.c'; else $(CYGPATH_W) '$(srcdir)/src/reader.c'; fi` + +src/bison-reduce.o: src/reduce.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-reduce.o -MD -MP -MF src/$(DEPDIR)/bison-reduce.Tpo -c -o src/bison-reduce.o `test -f 'src/reduce.c' || echo '$(srcdir)/'`src/reduce.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-reduce.Tpo src/$(DEPDIR)/bison-reduce.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/reduce.c' object='src/bison-reduce.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-reduce.o `test -f 'src/reduce.c' || echo '$(srcdir)/'`src/reduce.c + +src/bison-reduce.obj: src/reduce.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-reduce.obj -MD -MP -MF src/$(DEPDIR)/bison-reduce.Tpo -c -o src/bison-reduce.obj `if test -f 'src/reduce.c'; then $(CYGPATH_W) 'src/reduce.c'; else $(CYGPATH_W) '$(srcdir)/src/reduce.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-reduce.Tpo src/$(DEPDIR)/bison-reduce.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/reduce.c' object='src/bison-reduce.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-reduce.obj `if test -f 'src/reduce.c'; then $(CYGPATH_W) 'src/reduce.c'; else $(CYGPATH_W) '$(srcdir)/src/reduce.c'; fi` + +src/bison-relation.o: src/relation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-relation.o -MD -MP -MF src/$(DEPDIR)/bison-relation.Tpo -c -o src/bison-relation.o `test -f 'src/relation.c' || echo '$(srcdir)/'`src/relation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-relation.Tpo src/$(DEPDIR)/bison-relation.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/relation.c' object='src/bison-relation.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-relation.o `test -f 'src/relation.c' || echo '$(srcdir)/'`src/relation.c + +src/bison-relation.obj: src/relation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-relation.obj -MD -MP -MF src/$(DEPDIR)/bison-relation.Tpo -c -o src/bison-relation.obj `if test -f 'src/relation.c'; then $(CYGPATH_W) 'src/relation.c'; else $(CYGPATH_W) '$(srcdir)/src/relation.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-relation.Tpo src/$(DEPDIR)/bison-relation.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/relation.c' object='src/bison-relation.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-relation.obj `if test -f 'src/relation.c'; then $(CYGPATH_W) 'src/relation.c'; else $(CYGPATH_W) '$(srcdir)/src/relation.c'; fi` + +src/bison-scan-code-c.o: src/scan-code-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-code-c.o -MD -MP -MF src/$(DEPDIR)/bison-scan-code-c.Tpo -c -o src/bison-scan-code-c.o `test -f 'src/scan-code-c.c' || echo '$(srcdir)/'`src/scan-code-c.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-code-c.Tpo src/$(DEPDIR)/bison-scan-code-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-code-c.c' object='src/bison-scan-code-c.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-code-c.o `test -f 'src/scan-code-c.c' || echo '$(srcdir)/'`src/scan-code-c.c + +src/bison-scan-code-c.obj: src/scan-code-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-code-c.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-code-c.Tpo -c -o src/bison-scan-code-c.obj `if test -f 'src/scan-code-c.c'; then $(CYGPATH_W) 'src/scan-code-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-code-c.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-code-c.Tpo src/$(DEPDIR)/bison-scan-code-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-code-c.c' object='src/bison-scan-code-c.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-code-c.obj `if test -f 'src/scan-code-c.c'; then $(CYGPATH_W) 'src/scan-code-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-code-c.c'; fi` + +src/bison-scan-gram-c.o: src/scan-gram-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-gram-c.o -MD -MP -MF src/$(DEPDIR)/bison-scan-gram-c.Tpo -c -o src/bison-scan-gram-c.o `test -f 'src/scan-gram-c.c' || echo '$(srcdir)/'`src/scan-gram-c.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-gram-c.Tpo src/$(DEPDIR)/bison-scan-gram-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-gram-c.c' object='src/bison-scan-gram-c.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-gram-c.o `test -f 'src/scan-gram-c.c' || echo '$(srcdir)/'`src/scan-gram-c.c + +src/bison-scan-gram-c.obj: src/scan-gram-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-gram-c.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-gram-c.Tpo -c -o src/bison-scan-gram-c.obj `if test -f 'src/scan-gram-c.c'; then $(CYGPATH_W) 'src/scan-gram-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-gram-c.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-gram-c.Tpo src/$(DEPDIR)/bison-scan-gram-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-gram-c.c' object='src/bison-scan-gram-c.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-gram-c.obj `if test -f 'src/scan-gram-c.c'; then $(CYGPATH_W) 'src/scan-gram-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-gram-c.c'; fi` + +src/bison-scan-skel-c.o: src/scan-skel-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-skel-c.o -MD -MP -MF src/$(DEPDIR)/bison-scan-skel-c.Tpo -c -o src/bison-scan-skel-c.o `test -f 'src/scan-skel-c.c' || echo '$(srcdir)/'`src/scan-skel-c.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-skel-c.Tpo src/$(DEPDIR)/bison-scan-skel-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-skel-c.c' object='src/bison-scan-skel-c.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-skel-c.o `test -f 'src/scan-skel-c.c' || echo '$(srcdir)/'`src/scan-skel-c.c + +src/bison-scan-skel-c.obj: src/scan-skel-c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-skel-c.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-skel-c.Tpo -c -o src/bison-scan-skel-c.obj `if test -f 'src/scan-skel-c.c'; then $(CYGPATH_W) 'src/scan-skel-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-skel-c.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-skel-c.Tpo src/$(DEPDIR)/bison-scan-skel-c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-skel-c.c' object='src/bison-scan-skel-c.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-skel-c.obj `if test -f 'src/scan-skel-c.c'; then $(CYGPATH_W) 'src/scan-skel-c.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-skel-c.c'; fi` + +src/bison-state.o: src/state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-state.o -MD -MP -MF src/$(DEPDIR)/bison-state.Tpo -c -o src/bison-state.o `test -f 'src/state.c' || echo '$(srcdir)/'`src/state.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-state.Tpo src/$(DEPDIR)/bison-state.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/state.c' object='src/bison-state.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-state.o `test -f 'src/state.c' || echo '$(srcdir)/'`src/state.c + +src/bison-state.obj: src/state.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-state.obj -MD -MP -MF src/$(DEPDIR)/bison-state.Tpo -c -o src/bison-state.obj `if test -f 'src/state.c'; then $(CYGPATH_W) 'src/state.c'; else $(CYGPATH_W) '$(srcdir)/src/state.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-state.Tpo src/$(DEPDIR)/bison-state.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/state.c' object='src/bison-state.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-state.obj `if test -f 'src/state.c'; then $(CYGPATH_W) 'src/state.c'; else $(CYGPATH_W) '$(srcdir)/src/state.c'; fi` + +src/bison-symlist.o: src/symlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-symlist.o -MD -MP -MF src/$(DEPDIR)/bison-symlist.Tpo -c -o src/bison-symlist.o `test -f 'src/symlist.c' || echo '$(srcdir)/'`src/symlist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-symlist.Tpo src/$(DEPDIR)/bison-symlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/symlist.c' object='src/bison-symlist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-symlist.o `test -f 'src/symlist.c' || echo '$(srcdir)/'`src/symlist.c + +src/bison-symlist.obj: src/symlist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-symlist.obj -MD -MP -MF src/$(DEPDIR)/bison-symlist.Tpo -c -o src/bison-symlist.obj `if test -f 'src/symlist.c'; then $(CYGPATH_W) 'src/symlist.c'; else $(CYGPATH_W) '$(srcdir)/src/symlist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-symlist.Tpo src/$(DEPDIR)/bison-symlist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/symlist.c' object='src/bison-symlist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-symlist.obj `if test -f 'src/symlist.c'; then $(CYGPATH_W) 'src/symlist.c'; else $(CYGPATH_W) '$(srcdir)/src/symlist.c'; fi` + +src/bison-symtab.o: src/symtab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-symtab.o -MD -MP -MF src/$(DEPDIR)/bison-symtab.Tpo -c -o src/bison-symtab.o `test -f 'src/symtab.c' || echo '$(srcdir)/'`src/symtab.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-symtab.Tpo src/$(DEPDIR)/bison-symtab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/symtab.c' object='src/bison-symtab.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-symtab.o `test -f 'src/symtab.c' || echo '$(srcdir)/'`src/symtab.c + +src/bison-symtab.obj: src/symtab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-symtab.obj -MD -MP -MF src/$(DEPDIR)/bison-symtab.Tpo -c -o src/bison-symtab.obj `if test -f 'src/symtab.c'; then $(CYGPATH_W) 'src/symtab.c'; else $(CYGPATH_W) '$(srcdir)/src/symtab.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-symtab.Tpo src/$(DEPDIR)/bison-symtab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/symtab.c' object='src/bison-symtab.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-symtab.obj `if test -f 'src/symtab.c'; then $(CYGPATH_W) 'src/symtab.c'; else $(CYGPATH_W) '$(srcdir)/src/symtab.c'; fi` + +src/bison-tables.o: src/tables.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-tables.o -MD -MP -MF src/$(DEPDIR)/bison-tables.Tpo -c -o src/bison-tables.o `test -f 'src/tables.c' || echo '$(srcdir)/'`src/tables.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-tables.Tpo src/$(DEPDIR)/bison-tables.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/tables.c' object='src/bison-tables.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-tables.o `test -f 'src/tables.c' || echo '$(srcdir)/'`src/tables.c + +src/bison-tables.obj: src/tables.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-tables.obj -MD -MP -MF src/$(DEPDIR)/bison-tables.Tpo -c -o src/bison-tables.obj `if test -f 'src/tables.c'; then $(CYGPATH_W) 'src/tables.c'; else $(CYGPATH_W) '$(srcdir)/src/tables.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-tables.Tpo src/$(DEPDIR)/bison-tables.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/tables.c' object='src/bison-tables.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-tables.obj `if test -f 'src/tables.c'; then $(CYGPATH_W) 'src/tables.c'; else $(CYGPATH_W) '$(srcdir)/src/tables.c'; fi` + +src/bison-uniqstr.o: src/uniqstr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-uniqstr.o -MD -MP -MF src/$(DEPDIR)/bison-uniqstr.Tpo -c -o src/bison-uniqstr.o `test -f 'src/uniqstr.c' || echo '$(srcdir)/'`src/uniqstr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-uniqstr.Tpo src/$(DEPDIR)/bison-uniqstr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/uniqstr.c' object='src/bison-uniqstr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-uniqstr.o `test -f 'src/uniqstr.c' || echo '$(srcdir)/'`src/uniqstr.c + +src/bison-uniqstr.obj: src/uniqstr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-uniqstr.obj -MD -MP -MF src/$(DEPDIR)/bison-uniqstr.Tpo -c -o src/bison-uniqstr.obj `if test -f 'src/uniqstr.c'; then $(CYGPATH_W) 'src/uniqstr.c'; else $(CYGPATH_W) '$(srcdir)/src/uniqstr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-uniqstr.Tpo src/$(DEPDIR)/bison-uniqstr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/uniqstr.c' object='src/bison-uniqstr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-uniqstr.obj `if test -f 'src/uniqstr.c'; then $(CYGPATH_W) 'src/uniqstr.c'; else $(CYGPATH_W) '$(srcdir)/src/uniqstr.c'; fi` + +src/bison-scan-code.o: src/scan-code.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-code.o -MD -MP -MF src/$(DEPDIR)/bison-scan-code.Tpo -c -o src/bison-scan-code.o `test -f 'src/scan-code.c' || echo '$(srcdir)/'`src/scan-code.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-code.Tpo src/$(DEPDIR)/bison-scan-code.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-code.c' object='src/bison-scan-code.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-code.o `test -f 'src/scan-code.c' || echo '$(srcdir)/'`src/scan-code.c + +src/bison-scan-code.obj: src/scan-code.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-code.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-code.Tpo -c -o src/bison-scan-code.obj `if test -f 'src/scan-code.c'; then $(CYGPATH_W) 'src/scan-code.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-code.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-code.Tpo src/$(DEPDIR)/bison-scan-code.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-code.c' object='src/bison-scan-code.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-code.obj `if test -f 'src/scan-code.c'; then $(CYGPATH_W) 'src/scan-code.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-code.c'; fi` + +src/bison-scan-gram.o: src/scan-gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-gram.o -MD -MP -MF src/$(DEPDIR)/bison-scan-gram.Tpo -c -o src/bison-scan-gram.o `test -f 'src/scan-gram.c' || echo '$(srcdir)/'`src/scan-gram.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-gram.Tpo src/$(DEPDIR)/bison-scan-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-gram.c' object='src/bison-scan-gram.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-gram.o `test -f 'src/scan-gram.c' || echo '$(srcdir)/'`src/scan-gram.c + +src/bison-scan-gram.obj: src/scan-gram.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-gram.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-gram.Tpo -c -o src/bison-scan-gram.obj `if test -f 'src/scan-gram.c'; then $(CYGPATH_W) 'src/scan-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-gram.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-gram.Tpo src/$(DEPDIR)/bison-scan-gram.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-gram.c' object='src/bison-scan-gram.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-gram.obj `if test -f 'src/scan-gram.c'; then $(CYGPATH_W) 'src/scan-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-gram.c'; fi` + +src/bison-scan-skel.o: src/scan-skel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-skel.o -MD -MP -MF src/$(DEPDIR)/bison-scan-skel.Tpo -c -o src/bison-scan-skel.o `test -f 'src/scan-skel.c' || echo '$(srcdir)/'`src/scan-skel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-skel.Tpo src/$(DEPDIR)/bison-scan-skel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-skel.c' object='src/bison-scan-skel.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-skel.o `test -f 'src/scan-skel.c' || echo '$(srcdir)/'`src/scan-skel.c + +src/bison-scan-skel.obj: src/scan-skel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-scan-skel.obj -MD -MP -MF src/$(DEPDIR)/bison-scan-skel.Tpo -c -o src/bison-scan-skel.obj `if test -f 'src/scan-skel.c'; then $(CYGPATH_W) 'src/scan-skel.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-skel.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-scan-skel.Tpo src/$(DEPDIR)/bison-scan-skel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/scan-skel.c' object='src/bison-scan-skel.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-scan-skel.obj `if test -f 'src/scan-skel.c'; then $(CYGPATH_W) 'src/scan-skel.c'; else $(CYGPATH_W) '$(srcdir)/src/scan-skel.c'; fi` + +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +examples/calc++/calc__-calc++-driver.o: examples/calc++/calc++-driver.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/calc__-calc++-driver.o -MD -MP -MF examples/calc++/$(DEPDIR)/calc__-calc++-driver.Tpo -c -o examples/calc++/calc__-calc++-driver.o `test -f 'examples/calc++/calc++-driver.cc' || echo '$(srcdir)/'`examples/calc++/calc++-driver.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/calc__-calc++-driver.Tpo examples/calc++/$(DEPDIR)/calc__-calc++-driver.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-driver.cc' object='examples/calc++/calc__-calc++-driver.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/calc__-calc++-driver.o `test -f 'examples/calc++/calc++-driver.cc' || echo '$(srcdir)/'`examples/calc++/calc++-driver.cc + +examples/calc++/calc__-calc++-driver.obj: examples/calc++/calc++-driver.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/calc__-calc++-driver.obj -MD -MP -MF examples/calc++/$(DEPDIR)/calc__-calc++-driver.Tpo -c -o examples/calc++/calc__-calc++-driver.obj `if test -f 'examples/calc++/calc++-driver.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-driver.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-driver.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/calc__-calc++-driver.Tpo examples/calc++/$(DEPDIR)/calc__-calc++-driver.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-driver.cc' object='examples/calc++/calc__-calc++-driver.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/calc__-calc++-driver.obj `if test -f 'examples/calc++/calc++-driver.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-driver.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-driver.cc'; fi` + +examples/calc++/calc__-calc++-scanner.o: examples/calc++/calc++-scanner.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/calc__-calc++-scanner.o -MD -MP -MF examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Tpo -c -o examples/calc++/calc__-calc++-scanner.o `test -f 'examples/calc++/calc++-scanner.cc' || echo '$(srcdir)/'`examples/calc++/calc++-scanner.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Tpo examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-scanner.cc' object='examples/calc++/calc__-calc++-scanner.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/calc__-calc++-scanner.o `test -f 'examples/calc++/calc++-scanner.cc' || echo '$(srcdir)/'`examples/calc++/calc++-scanner.cc + +examples/calc++/calc__-calc++-scanner.obj: examples/calc++/calc++-scanner.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/calc__-calc++-scanner.obj -MD -MP -MF examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Tpo -c -o examples/calc++/calc__-calc++-scanner.obj `if test -f 'examples/calc++/calc++-scanner.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-scanner.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-scanner.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Tpo examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-scanner.cc' object='examples/calc++/calc__-calc++-scanner.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/calc__-calc++-scanner.obj `if test -f 'examples/calc++/calc++-scanner.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-scanner.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-scanner.cc'; fi` + +examples/calc++/calc__-calc++.o: examples/calc++/calc++.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/calc__-calc++.o -MD -MP -MF examples/calc++/$(DEPDIR)/calc__-calc++.Tpo -c -o examples/calc++/calc__-calc++.o `test -f 'examples/calc++/calc++.cc' || echo '$(srcdir)/'`examples/calc++/calc++.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/calc__-calc++.Tpo examples/calc++/$(DEPDIR)/calc__-calc++.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++.cc' object='examples/calc++/calc__-calc++.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/calc__-calc++.o `test -f 'examples/calc++/calc++.cc' || echo '$(srcdir)/'`examples/calc++/calc++.cc + +examples/calc++/calc__-calc++.obj: examples/calc++/calc++.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/calc__-calc++.obj -MD -MP -MF examples/calc++/$(DEPDIR)/calc__-calc++.Tpo -c -o examples/calc++/calc__-calc++.obj `if test -f 'examples/calc++/calc++.cc'; then $(CYGPATH_W) 'examples/calc++/calc++.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/calc__-calc++.Tpo examples/calc++/$(DEPDIR)/calc__-calc++.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++.cc' object='examples/calc++/calc__-calc++.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/calc__-calc++.obj `if test -f 'examples/calc++/calc++.cc'; then $(CYGPATH_W) 'examples/calc++/calc++.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++.cc'; fi` + +examples/calc++/calc__-calc++-parser.o: examples/calc++/calc++-parser.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/calc__-calc++-parser.o -MD -MP -MF examples/calc++/$(DEPDIR)/calc__-calc++-parser.Tpo -c -o examples/calc++/calc__-calc++-parser.o `test -f 'examples/calc++/calc++-parser.cc' || echo '$(srcdir)/'`examples/calc++/calc++-parser.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/calc__-calc++-parser.Tpo examples/calc++/$(DEPDIR)/calc__-calc++-parser.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-parser.cc' object='examples/calc++/calc__-calc++-parser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/calc__-calc++-parser.o `test -f 'examples/calc++/calc++-parser.cc' || echo '$(srcdir)/'`examples/calc++/calc++-parser.cc + +examples/calc++/calc__-calc++-parser.obj: examples/calc++/calc++-parser.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -MT examples/calc++/calc__-calc++-parser.obj -MD -MP -MF examples/calc++/$(DEPDIR)/calc__-calc++-parser.Tpo -c -o examples/calc++/calc__-calc++-parser.obj `if test -f 'examples/calc++/calc++-parser.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-parser.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-parser.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) examples/calc++/$(DEPDIR)/calc__-calc++-parser.Tpo examples/calc++/$(DEPDIR)/calc__-calc++-parser.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='examples/calc++/calc++-parser.cc' object='examples/calc++/calc__-calc++-parser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(examples_calc___calc___CPPFLAGS) $(CPPFLAGS) $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) -c -o examples/calc++/calc__-calc++-parser.obj `if test -f 'examples/calc++/calc++-parser.cc'; then $(CYGPATH_W) 'examples/calc++/calc++-parser.cc'; else $(CYGPATH_W) '$(srcdir)/examples/calc++/calc++-parser.cc'; fi` + +.l.c: + $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) + +.ll.cc: + $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) + +examples/calc++/calc++-scanner.cc: examples/calc++/calc++-scanner.ll + $(AM_V_LEX) \ + $(SHELL) $(YLWRAP) `test -f 'examples/calc++/calc++-scanner.ll' || echo '$(srcdir)/'`examples/calc++/calc++-scanner.ll $(LEX_OUTPUT_ROOT).c examples/calc++/calc++-scanner.cc -- $(LEX) $(AM_LFLAGS) $(LFLAGS) + +.y.c: + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) + +examples/mfcalc/mfcalc.c: examples/mfcalc/mfcalc.y + $(AM_V_YACC) \ + $(SHELL) $(YLWRAP) `test -f 'examples/mfcalc/mfcalc.y' || echo '$(srcdir)/'`examples/mfcalc/mfcalc.y y.tab.c examples/mfcalc/mfcalc.c y.tab.h `echo examples/mfcalc/mfcalc.c | $(am__yacc_c2h)` y.output examples/mfcalc/mfcalc.output -- $(YACC) $(AM_YFLAGS) $(YFLAGS) + +examples/rpcalc/rpcalc.c: examples/rpcalc/rpcalc.y + $(AM_V_YACC) \ + $(SHELL) $(YLWRAP) `test -f 'examples/rpcalc/rpcalc.y' || echo '$(srcdir)/'`examples/rpcalc/rpcalc.y y.tab.c examples/rpcalc/rpcalc.c y.tab.h `echo examples/rpcalc/rpcalc.c | $(am__yacc_c2h)` y.output examples/rpcalc/rpcalc.output -- $(YACC) $(AM_YFLAGS) $(YFLAGS) +doc/$(am__dirstamp): + @$(MKDIR_P) doc + @: > doc/$(am__dirstamp) + +$(srcdir)/doc/bison.info: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \ + -o $@ $(srcdir)/doc/bison.texi; \ + then \ + rc=0; \ + $(am__cd) $(srcdir); \ + else \ + rc=$$?; \ + $(am__cd) $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +doc/bison.dvi: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp) + $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \ + $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ + `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi + +doc/bison.pdf: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp) + $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \ + $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ + `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi + +doc/bison.html: doc/bison.texi $(srcdir)/doc/version.texi $(doc_bison_TEXINFOS) doc/$(am__dirstamp) + $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) + $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \ + -o $(@:.html=.htp) `test -f 'doc/bison.texi' || echo '$(srcdir)/'`doc/bison.texi; \ + then \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ + else \ + rm -rf $(@:.html=.htp); exit 1; \ + fi +$(srcdir)/doc/version.texi: $(srcdir)/doc/stamp-vti +$(srcdir)/doc/stamp-vti: doc/bison.texi $(top_srcdir)/configure + @test -f doc/$(am__dirstamp) || $(MAKE) $(AM_MAKEFLAGS) doc/$(am__dirstamp) + @(dir=.; test -f ./doc/bison.texi || dir=$(srcdir); \ + set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/doc/bison.texi`; \ + echo "@set UPDATED $$1 $$2 $$3"; \ + echo "@set UPDATED-MONTH $$2 $$3"; \ + echo "@set EDITION $(VERSION)"; \ + echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \ + (cmp -s vti.tmp$$$$ $(srcdir)/doc/version.texi \ + || (echo "Updating $(srcdir)/doc/version.texi" && \ + cp vti.tmp$$$$ $(srcdir)/doc/version.texi.tmp$$$$ && \ + mv $(srcdir)/doc/version.texi.tmp$$$$ $(srcdir)/doc/version.texi)) && \ + rm -f vti.tmp$$$$ $(srcdir)/doc/version.texi.$$$$ + @cp $(srcdir)/doc/version.texi $@ + +mostlyclean-vti: + -rm -f vti.tmp* $(srcdir)/doc/version.texi.tmp* + +maintainer-clean-vti: + -rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi +.dvi.ps: + $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + $(DVIPS) $(AM_V_texinfo) -o $@ $< + +uninstall-dvi-am: + @$(NORMAL_UNINSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ + rm -f "$(DESTDIR)$(dvidir)/$$f"; \ + done + +uninstall-html-am: + @$(NORMAL_UNINSTALL) + @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ + rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ + done + +uninstall-info-am: + @$(PRE_UNINSTALL) + @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ + done + +uninstall-pdf-am: + @$(NORMAL_UNINSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ + done + +uninstall-ps-am: + @$(NORMAL_UNINSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ + rm -f "$(DESTDIR)$(psdir)/$$f"; \ + done + +dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ + for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ + if test -f $$file; then \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f "$(distdir)/$$relfile" || \ + cp -p $$file "$(distdir)/$$relfile"; \ + else :; fi; \ + done; \ + done + +mostlyclean-aminfo: + -rm -rf doc/bison.t2d doc/bison.t2p + +clean-aminfo: + -test -z "doc/bison.dvi doc/bison.pdf doc/bison.ps doc/bison.html" \ + || rm -rf doc/bison.dvi doc/bison.pdf doc/bison.ps doc/bison.html + +maintainer-clean-aminfo: + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ + done +install-man1: $(dist_man_MANS) $(nodist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS) $(nodist_man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS) $(nodist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-aclocalDATA: $(aclocal_DATA) + @$(NORMAL_INSTALL) + @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(aclocaldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(aclocaldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(aclocaldir)" || exit $$?; \ + done + +uninstall-aclocalDATA: @$(NORMAL_UNINSTALL) @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(aclocaldir)'; $(am__uninstall_files_from_dir) +install-calcxxDATA: $(calcxx_DATA) + @$(NORMAL_INSTALL) + @list='$(calcxx_DATA)'; test -n "$(calcxxdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(calcxxdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(calcxxdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(calcxxdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(calcxxdir)" || exit $$?; \ + done + +uninstall-calcxxDATA: + @$(NORMAL_UNINSTALL) + @list='$(calcxx_DATA)'; test -n "$(calcxxdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(calcxxdir)'; $(am__uninstall_files_from_dir) +install-dist_docDATA: $(dist_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + done + +uninstall-dist_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) +install-dist_m4sugarDATA: $(dist_m4sugar_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_m4sugar_DATA)'; test -n "$(m4sugardir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(m4sugardir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(m4sugardir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4sugardir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(m4sugardir)" || exit $$?; \ + done + +uninstall-dist_m4sugarDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_m4sugar_DATA)'; test -n "$(m4sugardir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(m4sugardir)'; $(am__uninstall_files_from_dir) +install-dist_pkgdataDATA: $(dist_pkgdata_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ + done + +uninstall-dist_pkgdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) +install-dist_xsltDATA: $(dist_xslt_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_xslt_DATA)'; test -n "$(xsltdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(xsltdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(xsltdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xsltdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(xsltdir)" || exit $$?; \ + done + +uninstall-dist_xsltDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_xslt_DATA)'; test -n "$(xsltdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(xsltdir)'; $(am__uninstall_files_from_dir) +install-mfcalcDATA: $(mfcalc_DATA) + @$(NORMAL_INSTALL) + @list='$(mfcalc_DATA)'; test -n "$(mfcalcdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(mfcalcdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(mfcalcdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(mfcalcdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(mfcalcdir)" || exit $$?; \ + done + +uninstall-mfcalcDATA: + @$(NORMAL_UNINSTALL) + @list='$(mfcalc_DATA)'; test -n "$(mfcalcdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(mfcalcdir)'; $(am__uninstall_files_from_dir) +install-rpcalcDATA: $(rpcalc_DATA) + @$(NORMAL_INSTALL) + @list='$(rpcalc_DATA)'; test -n "$(rpcalcdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(rpcalcdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(rpcalcdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rpcalcdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(rpcalcdir)" || exit $$?; \ + done + +uninstall-rpcalcDATA: + @$(NORMAL_UNINSTALL) + @list='$(rpcalc_DATA)'; test -n "$(rpcalcdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(rpcalcdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. @@ -1555,13 +4707,12 @@ uninstall-aclocalDATA: # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ @@ -1655,7 +4806,172 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(DISTFILES) +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: $(check_PROGRAMS) $(check_SCRIPTS) + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) $(check_SCRIPTS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @case `sed 15q $(srcdir)/NEWS` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "NEWS not updated; not releasing" 1>&2; \ + exit 1;; \ + esac $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -1714,7 +5030,7 @@ distdir: $(DISTFILES) done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook + dist-info dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ @@ -1723,7 +5039,7 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -1738,11 +5054,17 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -1760,7 +5082,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -1770,22 +5092,23 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -1839,12 +5162,15 @@ distcleancheck: distclean $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(DATA) +all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(LIBRARIES) $(SCRIPTS) \ + $(MANS) $(DATA) all-local installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(aclocaldir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(aclocaldir)" "$(DESTDIR)$(calcxxdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(xsltdir)" "$(DESTDIR)$(mfcalcdir)" "$(DESTDIR)$(rpcalcdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -1868,112 +5194,2273 @@ install-strip: "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: + -rm -f examples/calc++/calc++-scanner.cc + -rm -f examples/mfcalc/mfcalc.c + -rm -f examples/mfcalc/mfcalc.h + -rm -f examples/rpcalc/rpcalc.c + -rm -f examples/rpcalc/rpcalc.h + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f doc/$(am__dirstamp) + -rm -f examples/calc++/$(DEPDIR)/$(am__dirstamp) + -rm -f examples/calc++/$(am__dirstamp) + -rm -f examples/mfcalc/$(DEPDIR)/$(am__dirstamp) + -rm -f examples/mfcalc/$(am__dirstamp) + -rm -f examples/rpcalc/$(DEPDIR)/$(am__dirstamp) + -rm -f examples/rpcalc/$(am__dirstamp) + -rm -f lib/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/$(am__dirstamp) + -rm -f lib/glthread/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/glthread/$(am__dirstamp) + -rm -f lib/uniwidth/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/uniwidth/$(am__dirstamp) + -rm -f src/$(DEPDIR)/$(am__dirstamp) + -rm -f src/$(am__dirstamp) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -rm -f src/parse-gram.c + -rm -f src/parse-gram.h + -rm -f src/scan-code.c + -rm -f src/scan-gram.c + -rm -f src/scan-skel.c -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive -clean-am: clean-generic mostlyclean-am +clean-am: clean-aminfo clean-binPROGRAMS clean-checkPROGRAMS \ + clean-generic clean-libLIBRARIES clean-local \ + clean-noinstLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f examples/calc++/$(DEPDIR)/calc__-calc++-driver.Po + -rm -f examples/calc++/$(DEPDIR)/calc__-calc++-parser.Po + -rm -f examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Po + -rm -f examples/calc++/$(DEPDIR)/calc__-calc++.Po + -rm -f examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Po + -rm -f examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Po + -rm -f lib/$(DEPDIR)/abitset.Po + -rm -f lib/$(DEPDIR)/argmatch.Po + -rm -f lib/$(DEPDIR)/asnprintf.Po + -rm -f lib/$(DEPDIR)/basename-lgpl.Po + -rm -f lib/$(DEPDIR)/basename.Po + -rm -f lib/$(DEPDIR)/binary-io.Po + -rm -f lib/$(DEPDIR)/bitrotate.Po + -rm -f lib/$(DEPDIR)/bitset.Po + -rm -f lib/$(DEPDIR)/bitset_stats.Po + -rm -f lib/$(DEPDIR)/bitsetv-print.Po + -rm -f lib/$(DEPDIR)/bitsetv.Po + -rm -f lib/$(DEPDIR)/c-ctype.Po + -rm -f lib/$(DEPDIR)/c-strcasecmp.Po + -rm -f lib/$(DEPDIR)/c-strncasecmp.Po + -rm -f lib/$(DEPDIR)/calloc.Po + -rm -f lib/$(DEPDIR)/cloexec.Po + -rm -f lib/$(DEPDIR)/close-stream.Po + -rm -f lib/$(DEPDIR)/close.Po + -rm -f lib/$(DEPDIR)/closeout.Po + -rm -f lib/$(DEPDIR)/concat-filename.Po + -rm -f lib/$(DEPDIR)/dirname-lgpl.Po + -rm -f lib/$(DEPDIR)/dirname.Po + -rm -f lib/$(DEPDIR)/dup-safer-flag.Po + -rm -f lib/$(DEPDIR)/dup-safer.Po + -rm -f lib/$(DEPDIR)/dup2.Po + -rm -f lib/$(DEPDIR)/ebitset.Po + -rm -f lib/$(DEPDIR)/error.Po + -rm -f lib/$(DEPDIR)/exitfail.Po + -rm -f lib/$(DEPDIR)/fatal-signal.Po + -rm -f lib/$(DEPDIR)/fcntl.Po + -rm -f lib/$(DEPDIR)/fd-hook.Po + -rm -f lib/$(DEPDIR)/fd-safer-flag.Po + -rm -f lib/$(DEPDIR)/fd-safer.Po + -rm -f lib/$(DEPDIR)/float.Po + -rm -f lib/$(DEPDIR)/fopen-safer.Po + -rm -f lib/$(DEPDIR)/fopen.Po + -rm -f lib/$(DEPDIR)/fpending.Po + -rm -f lib/$(DEPDIR)/fprintf.Po + -rm -f lib/$(DEPDIR)/frexp.Po + -rm -f lib/$(DEPDIR)/frexpl.Po + -rm -f lib/$(DEPDIR)/fseterr.Po + -rm -f lib/$(DEPDIR)/fstat.Po + -rm -f lib/$(DEPDIR)/get-errno.Po + -rm -f lib/$(DEPDIR)/getdtablesize.Po + -rm -f lib/$(DEPDIR)/getopt.Po + -rm -f lib/$(DEPDIR)/getopt1.Po + -rm -f lib/$(DEPDIR)/getprogname.Po + -rm -f lib/$(DEPDIR)/hard-locale.Po + -rm -f lib/$(DEPDIR)/hash.Po + -rm -f lib/$(DEPDIR)/isnan.Po + -rm -f lib/$(DEPDIR)/isnand.Po + -rm -f lib/$(DEPDIR)/isnanf.Po + -rm -f lib/$(DEPDIR)/isnanl.Po + -rm -f lib/$(DEPDIR)/itold.Po + -rm -f lib/$(DEPDIR)/lbitset.Po + -rm -f lib/$(DEPDIR)/ldexpl.Po + -rm -f lib/$(DEPDIR)/localcharset.Po + -rm -f lib/$(DEPDIR)/lstat.Po + -rm -f lib/$(DEPDIR)/main.Po + -rm -f lib/$(DEPDIR)/malloc.Po + -rm -f lib/$(DEPDIR)/malloca.Po + -rm -f lib/$(DEPDIR)/math.Po + -rm -f lib/$(DEPDIR)/mbrtowc.Po + -rm -f lib/$(DEPDIR)/mbsinit.Po + -rm -f lib/$(DEPDIR)/mbswidth.Po + -rm -f lib/$(DEPDIR)/memchr.Po + -rm -f lib/$(DEPDIR)/msvc-inval.Po + -rm -f lib/$(DEPDIR)/msvc-nothrow.Po + -rm -f lib/$(DEPDIR)/obstack.Po + -rm -f lib/$(DEPDIR)/obstack_printf.Po + -rm -f lib/$(DEPDIR)/open.Po + -rm -f lib/$(DEPDIR)/perror.Po + -rm -f lib/$(DEPDIR)/pipe-safer.Po + -rm -f lib/$(DEPDIR)/pipe2-safer.Po + -rm -f lib/$(DEPDIR)/pipe2.Po + -rm -f lib/$(DEPDIR)/printf-args.Po + -rm -f lib/$(DEPDIR)/printf-frexp.Po + -rm -f lib/$(DEPDIR)/printf-frexpl.Po + -rm -f lib/$(DEPDIR)/printf-parse.Po + -rm -f lib/$(DEPDIR)/printf.Po + -rm -f lib/$(DEPDIR)/progname.Po + -rm -f lib/$(DEPDIR)/quotearg.Po + -rm -f lib/$(DEPDIR)/raise.Po + -rm -f lib/$(DEPDIR)/rawmemchr.Po + -rm -f lib/$(DEPDIR)/realloc.Po + -rm -f lib/$(DEPDIR)/sig-handler.Po + -rm -f lib/$(DEPDIR)/sigaction.Po + -rm -f lib/$(DEPDIR)/signbitd.Po + -rm -f lib/$(DEPDIR)/signbitf.Po + -rm -f lib/$(DEPDIR)/signbitl.Po + -rm -f lib/$(DEPDIR)/sigprocmask.Po + -rm -f lib/$(DEPDIR)/snprintf.Po + -rm -f lib/$(DEPDIR)/spawn-pipe.Po + -rm -f lib/$(DEPDIR)/spawn_faction_addclose.Po + -rm -f lib/$(DEPDIR)/spawn_faction_adddup2.Po + -rm -f lib/$(DEPDIR)/spawn_faction_addopen.Po + -rm -f lib/$(DEPDIR)/spawn_faction_destroy.Po + -rm -f lib/$(DEPDIR)/spawn_faction_init.Po + -rm -f lib/$(DEPDIR)/spawnattr_destroy.Po + -rm -f lib/$(DEPDIR)/spawnattr_init.Po + -rm -f lib/$(DEPDIR)/spawnattr_setflags.Po + -rm -f lib/$(DEPDIR)/spawnattr_setsigmask.Po + -rm -f lib/$(DEPDIR)/spawni.Po + -rm -f lib/$(DEPDIR)/spawnp.Po + -rm -f lib/$(DEPDIR)/sprintf.Po + -rm -f lib/$(DEPDIR)/stat-time.Po + -rm -f lib/$(DEPDIR)/stat-w32.Po + -rm -f lib/$(DEPDIR)/stat.Po + -rm -f lib/$(DEPDIR)/stpcpy.Po + -rm -f lib/$(DEPDIR)/strchrnul.Po + -rm -f lib/$(DEPDIR)/strdup.Po + -rm -f lib/$(DEPDIR)/strerror-override.Po + -rm -f lib/$(DEPDIR)/strerror.Po + -rm -f lib/$(DEPDIR)/strerror_r.Po + -rm -f lib/$(DEPDIR)/stripslash.Po + -rm -f lib/$(DEPDIR)/strndup.Po + -rm -f lib/$(DEPDIR)/strnlen.Po + -rm -f lib/$(DEPDIR)/strverscmp.Po + -rm -f lib/$(DEPDIR)/timevar.Po + -rm -f lib/$(DEPDIR)/unistd.Po + -rm -f lib/$(DEPDIR)/unlink.Po + -rm -f lib/$(DEPDIR)/unsetenv.Po + -rm -f lib/$(DEPDIR)/vasnprintf.Po + -rm -f lib/$(DEPDIR)/vbitset.Po + -rm -f lib/$(DEPDIR)/vfprintf.Po + -rm -f lib/$(DEPDIR)/vsnprintf.Po + -rm -f lib/$(DEPDIR)/vsprintf.Po + -rm -f lib/$(DEPDIR)/wait-process.Po + -rm -f lib/$(DEPDIR)/waitpid.Po + -rm -f lib/$(DEPDIR)/wctype-h.Po + -rm -f lib/$(DEPDIR)/wcwidth.Po + -rm -f lib/$(DEPDIR)/xalloc-die.Po + -rm -f lib/$(DEPDIR)/xconcat-filename.Po + -rm -f lib/$(DEPDIR)/xmalloc.Po + -rm -f lib/$(DEPDIR)/xmemdup0.Po + -rm -f lib/$(DEPDIR)/xsize.Po + -rm -f lib/$(DEPDIR)/xstrndup.Po + -rm -f lib/$(DEPDIR)/yyerror.Po + -rm -f lib/glthread/$(DEPDIR)/lock.Po + -rm -f lib/glthread/$(DEPDIR)/threadlib.Po + -rm -f lib/uniwidth/$(DEPDIR)/width.Po + -rm -f src/$(DEPDIR)/bison-AnnotationList.Po + -rm -f src/$(DEPDIR)/bison-InadequacyList.Po + -rm -f src/$(DEPDIR)/bison-LR0.Po + -rm -f src/$(DEPDIR)/bison-Sbitset.Po + -rm -f src/$(DEPDIR)/bison-assoc.Po + -rm -f src/$(DEPDIR)/bison-closure.Po + -rm -f src/$(DEPDIR)/bison-complain.Po + -rm -f src/$(DEPDIR)/bison-conflicts.Po + -rm -f src/$(DEPDIR)/bison-derives.Po + -rm -f src/$(DEPDIR)/bison-files.Po + -rm -f src/$(DEPDIR)/bison-getargs.Po + -rm -f src/$(DEPDIR)/bison-gram.Po + -rm -f src/$(DEPDIR)/bison-graphviz.Po + -rm -f src/$(DEPDIR)/bison-ielr.Po + -rm -f src/$(DEPDIR)/bison-lalr.Po + -rm -f src/$(DEPDIR)/bison-location.Po + -rm -f src/$(DEPDIR)/bison-main.Po + -rm -f src/$(DEPDIR)/bison-muscle-tab.Po + -rm -f src/$(DEPDIR)/bison-named-ref.Po + -rm -f src/$(DEPDIR)/bison-nullable.Po + -rm -f src/$(DEPDIR)/bison-output.Po + -rm -f src/$(DEPDIR)/bison-parse-gram.Po + -rm -f src/$(DEPDIR)/bison-print-xml.Po + -rm -f src/$(DEPDIR)/bison-print.Po + -rm -f src/$(DEPDIR)/bison-print_graph.Po + -rm -f src/$(DEPDIR)/bison-reader.Po + -rm -f src/$(DEPDIR)/bison-reduce.Po + -rm -f src/$(DEPDIR)/bison-relation.Po + -rm -f src/$(DEPDIR)/bison-scan-code-c.Po + -rm -f src/$(DEPDIR)/bison-scan-code.Po + -rm -f src/$(DEPDIR)/bison-scan-gram-c.Po + -rm -f src/$(DEPDIR)/bison-scan-gram.Po + -rm -f src/$(DEPDIR)/bison-scan-skel-c.Po + -rm -f src/$(DEPDIR)/bison-scan-skel.Po + -rm -f src/$(DEPDIR)/bison-state.Po + -rm -f src/$(DEPDIR)/bison-symlist.Po + -rm -f src/$(DEPDIR)/bison-symtab.Po + -rm -f src/$(DEPDIR)/bison-tables.Po + -rm -f src/$(DEPDIR)/bison-uniqstr.Po -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-local distclean-tags dvi: dvi-recursive -dvi-am: +dvi-am: $(DVIS) html: html-recursive -html-am: +html-am: $(HTMLS) html-local info: info-recursive -info-am: +info-am: $(INFO_DEPS) -install-data-am: install-aclocalDATA +install-data-am: install-aclocalDATA install-calcxxDATA \ + install-dist_docDATA install-dist_m4sugarDATA \ + install-dist_pkgdataDATA install-dist_xsltDATA install-info-am \ + install-man install-mfcalcDATA install-rpcalcDATA install-dvi: install-dvi-recursive -install-dvi-am: - -install-exec-am: +install-dvi-am: $(DVIS) + @$(NORMAL_INSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ + done +install-exec-am: install-binPROGRAMS install-binSCRIPTS \ + install-exec-local install-libLIBRARIES install-html: install-html-recursive -install-html-am: - +install-html-am: $(HTMLS) + @$(NORMAL_INSTALL) + @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ + $(am__strip_dir) \ + d2=$$d$$p; \ + if test -d "$$d2"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ + echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ + else \ + list2="$$list2 $$d2"; \ + fi; \ + done; \ + test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done; } install-info: install-info-recursive -install-info-am: - -install-man: +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ + fi; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + echo "$$ifile"; \ + else : ; fi; \ + done; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done + @$(POST_INSTALL) + @if $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: install-man1 install-pdf: install-pdf-recursive -install-pdf-am: - +install-pdf-am: $(PDFS) + @$(NORMAL_INSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-recursive -install-ps-am: - -installcheck-am: +install-ps-am: $(PSS) + @$(NORMAL_INSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done +installcheck-am: installcheck-binPROGRAMS installcheck-binSCRIPTS \ + installcheck-local maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache + -rm -f examples/calc++/$(DEPDIR)/calc__-calc++-driver.Po + -rm -f examples/calc++/$(DEPDIR)/calc__-calc++-parser.Po + -rm -f examples/calc++/$(DEPDIR)/calc__-calc++-scanner.Po + -rm -f examples/calc++/$(DEPDIR)/calc__-calc++.Po + -rm -f examples/mfcalc/$(DEPDIR)/mfcalc-mfcalc.Po + -rm -f examples/rpcalc/$(DEPDIR)/rpcalc-rpcalc.Po + -rm -f lib/$(DEPDIR)/abitset.Po + -rm -f lib/$(DEPDIR)/argmatch.Po + -rm -f lib/$(DEPDIR)/asnprintf.Po + -rm -f lib/$(DEPDIR)/basename-lgpl.Po + -rm -f lib/$(DEPDIR)/basename.Po + -rm -f lib/$(DEPDIR)/binary-io.Po + -rm -f lib/$(DEPDIR)/bitrotate.Po + -rm -f lib/$(DEPDIR)/bitset.Po + -rm -f lib/$(DEPDIR)/bitset_stats.Po + -rm -f lib/$(DEPDIR)/bitsetv-print.Po + -rm -f lib/$(DEPDIR)/bitsetv.Po + -rm -f lib/$(DEPDIR)/c-ctype.Po + -rm -f lib/$(DEPDIR)/c-strcasecmp.Po + -rm -f lib/$(DEPDIR)/c-strncasecmp.Po + -rm -f lib/$(DEPDIR)/calloc.Po + -rm -f lib/$(DEPDIR)/cloexec.Po + -rm -f lib/$(DEPDIR)/close-stream.Po + -rm -f lib/$(DEPDIR)/close.Po + -rm -f lib/$(DEPDIR)/closeout.Po + -rm -f lib/$(DEPDIR)/concat-filename.Po + -rm -f lib/$(DEPDIR)/dirname-lgpl.Po + -rm -f lib/$(DEPDIR)/dirname.Po + -rm -f lib/$(DEPDIR)/dup-safer-flag.Po + -rm -f lib/$(DEPDIR)/dup-safer.Po + -rm -f lib/$(DEPDIR)/dup2.Po + -rm -f lib/$(DEPDIR)/ebitset.Po + -rm -f lib/$(DEPDIR)/error.Po + -rm -f lib/$(DEPDIR)/exitfail.Po + -rm -f lib/$(DEPDIR)/fatal-signal.Po + -rm -f lib/$(DEPDIR)/fcntl.Po + -rm -f lib/$(DEPDIR)/fd-hook.Po + -rm -f lib/$(DEPDIR)/fd-safer-flag.Po + -rm -f lib/$(DEPDIR)/fd-safer.Po + -rm -f lib/$(DEPDIR)/float.Po + -rm -f lib/$(DEPDIR)/fopen-safer.Po + -rm -f lib/$(DEPDIR)/fopen.Po + -rm -f lib/$(DEPDIR)/fpending.Po + -rm -f lib/$(DEPDIR)/fprintf.Po + -rm -f lib/$(DEPDIR)/frexp.Po + -rm -f lib/$(DEPDIR)/frexpl.Po + -rm -f lib/$(DEPDIR)/fseterr.Po + -rm -f lib/$(DEPDIR)/fstat.Po + -rm -f lib/$(DEPDIR)/get-errno.Po + -rm -f lib/$(DEPDIR)/getdtablesize.Po + -rm -f lib/$(DEPDIR)/getopt.Po + -rm -f lib/$(DEPDIR)/getopt1.Po + -rm -f lib/$(DEPDIR)/getprogname.Po + -rm -f lib/$(DEPDIR)/hard-locale.Po + -rm -f lib/$(DEPDIR)/hash.Po + -rm -f lib/$(DEPDIR)/isnan.Po + -rm -f lib/$(DEPDIR)/isnand.Po + -rm -f lib/$(DEPDIR)/isnanf.Po + -rm -f lib/$(DEPDIR)/isnanl.Po + -rm -f lib/$(DEPDIR)/itold.Po + -rm -f lib/$(DEPDIR)/lbitset.Po + -rm -f lib/$(DEPDIR)/ldexpl.Po + -rm -f lib/$(DEPDIR)/localcharset.Po + -rm -f lib/$(DEPDIR)/lstat.Po + -rm -f lib/$(DEPDIR)/main.Po + -rm -f lib/$(DEPDIR)/malloc.Po + -rm -f lib/$(DEPDIR)/malloca.Po + -rm -f lib/$(DEPDIR)/math.Po + -rm -f lib/$(DEPDIR)/mbrtowc.Po + -rm -f lib/$(DEPDIR)/mbsinit.Po + -rm -f lib/$(DEPDIR)/mbswidth.Po + -rm -f lib/$(DEPDIR)/memchr.Po + -rm -f lib/$(DEPDIR)/msvc-inval.Po + -rm -f lib/$(DEPDIR)/msvc-nothrow.Po + -rm -f lib/$(DEPDIR)/obstack.Po + -rm -f lib/$(DEPDIR)/obstack_printf.Po + -rm -f lib/$(DEPDIR)/open.Po + -rm -f lib/$(DEPDIR)/perror.Po + -rm -f lib/$(DEPDIR)/pipe-safer.Po + -rm -f lib/$(DEPDIR)/pipe2-safer.Po + -rm -f lib/$(DEPDIR)/pipe2.Po + -rm -f lib/$(DEPDIR)/printf-args.Po + -rm -f lib/$(DEPDIR)/printf-frexp.Po + -rm -f lib/$(DEPDIR)/printf-frexpl.Po + -rm -f lib/$(DEPDIR)/printf-parse.Po + -rm -f lib/$(DEPDIR)/printf.Po + -rm -f lib/$(DEPDIR)/progname.Po + -rm -f lib/$(DEPDIR)/quotearg.Po + -rm -f lib/$(DEPDIR)/raise.Po + -rm -f lib/$(DEPDIR)/rawmemchr.Po + -rm -f lib/$(DEPDIR)/realloc.Po + -rm -f lib/$(DEPDIR)/sig-handler.Po + -rm -f lib/$(DEPDIR)/sigaction.Po + -rm -f lib/$(DEPDIR)/signbitd.Po + -rm -f lib/$(DEPDIR)/signbitf.Po + -rm -f lib/$(DEPDIR)/signbitl.Po + -rm -f lib/$(DEPDIR)/sigprocmask.Po + -rm -f lib/$(DEPDIR)/snprintf.Po + -rm -f lib/$(DEPDIR)/spawn-pipe.Po + -rm -f lib/$(DEPDIR)/spawn_faction_addclose.Po + -rm -f lib/$(DEPDIR)/spawn_faction_adddup2.Po + -rm -f lib/$(DEPDIR)/spawn_faction_addopen.Po + -rm -f lib/$(DEPDIR)/spawn_faction_destroy.Po + -rm -f lib/$(DEPDIR)/spawn_faction_init.Po + -rm -f lib/$(DEPDIR)/spawnattr_destroy.Po + -rm -f lib/$(DEPDIR)/spawnattr_init.Po + -rm -f lib/$(DEPDIR)/spawnattr_setflags.Po + -rm -f lib/$(DEPDIR)/spawnattr_setsigmask.Po + -rm -f lib/$(DEPDIR)/spawni.Po + -rm -f lib/$(DEPDIR)/spawnp.Po + -rm -f lib/$(DEPDIR)/sprintf.Po + -rm -f lib/$(DEPDIR)/stat-time.Po + -rm -f lib/$(DEPDIR)/stat-w32.Po + -rm -f lib/$(DEPDIR)/stat.Po + -rm -f lib/$(DEPDIR)/stpcpy.Po + -rm -f lib/$(DEPDIR)/strchrnul.Po + -rm -f lib/$(DEPDIR)/strdup.Po + -rm -f lib/$(DEPDIR)/strerror-override.Po + -rm -f lib/$(DEPDIR)/strerror.Po + -rm -f lib/$(DEPDIR)/strerror_r.Po + -rm -f lib/$(DEPDIR)/stripslash.Po + -rm -f lib/$(DEPDIR)/strndup.Po + -rm -f lib/$(DEPDIR)/strnlen.Po + -rm -f lib/$(DEPDIR)/strverscmp.Po + -rm -f lib/$(DEPDIR)/timevar.Po + -rm -f lib/$(DEPDIR)/unistd.Po + -rm -f lib/$(DEPDIR)/unlink.Po + -rm -f lib/$(DEPDIR)/unsetenv.Po + -rm -f lib/$(DEPDIR)/vasnprintf.Po + -rm -f lib/$(DEPDIR)/vbitset.Po + -rm -f lib/$(DEPDIR)/vfprintf.Po + -rm -f lib/$(DEPDIR)/vsnprintf.Po + -rm -f lib/$(DEPDIR)/vsprintf.Po + -rm -f lib/$(DEPDIR)/wait-process.Po + -rm -f lib/$(DEPDIR)/waitpid.Po + -rm -f lib/$(DEPDIR)/wctype-h.Po + -rm -f lib/$(DEPDIR)/wcwidth.Po + -rm -f lib/$(DEPDIR)/xalloc-die.Po + -rm -f lib/$(DEPDIR)/xconcat-filename.Po + -rm -f lib/$(DEPDIR)/xmalloc.Po + -rm -f lib/$(DEPDIR)/xmemdup0.Po + -rm -f lib/$(DEPDIR)/xsize.Po + -rm -f lib/$(DEPDIR)/xstrndup.Po + -rm -f lib/$(DEPDIR)/yyerror.Po + -rm -f lib/glthread/$(DEPDIR)/lock.Po + -rm -f lib/glthread/$(DEPDIR)/threadlib.Po + -rm -f lib/uniwidth/$(DEPDIR)/width.Po + -rm -f src/$(DEPDIR)/bison-AnnotationList.Po + -rm -f src/$(DEPDIR)/bison-InadequacyList.Po + -rm -f src/$(DEPDIR)/bison-LR0.Po + -rm -f src/$(DEPDIR)/bison-Sbitset.Po + -rm -f src/$(DEPDIR)/bison-assoc.Po + -rm -f src/$(DEPDIR)/bison-closure.Po + -rm -f src/$(DEPDIR)/bison-complain.Po + -rm -f src/$(DEPDIR)/bison-conflicts.Po + -rm -f src/$(DEPDIR)/bison-derives.Po + -rm -f src/$(DEPDIR)/bison-files.Po + -rm -f src/$(DEPDIR)/bison-getargs.Po + -rm -f src/$(DEPDIR)/bison-gram.Po + -rm -f src/$(DEPDIR)/bison-graphviz.Po + -rm -f src/$(DEPDIR)/bison-ielr.Po + -rm -f src/$(DEPDIR)/bison-lalr.Po + -rm -f src/$(DEPDIR)/bison-location.Po + -rm -f src/$(DEPDIR)/bison-main.Po + -rm -f src/$(DEPDIR)/bison-muscle-tab.Po + -rm -f src/$(DEPDIR)/bison-named-ref.Po + -rm -f src/$(DEPDIR)/bison-nullable.Po + -rm -f src/$(DEPDIR)/bison-output.Po + -rm -f src/$(DEPDIR)/bison-parse-gram.Po + -rm -f src/$(DEPDIR)/bison-print-xml.Po + -rm -f src/$(DEPDIR)/bison-print.Po + -rm -f src/$(DEPDIR)/bison-print_graph.Po + -rm -f src/$(DEPDIR)/bison-reader.Po + -rm -f src/$(DEPDIR)/bison-reduce.Po + -rm -f src/$(DEPDIR)/bison-relation.Po + -rm -f src/$(DEPDIR)/bison-scan-code-c.Po + -rm -f src/$(DEPDIR)/bison-scan-code.Po + -rm -f src/$(DEPDIR)/bison-scan-gram-c.Po + -rm -f src/$(DEPDIR)/bison-scan-gram.Po + -rm -f src/$(DEPDIR)/bison-scan-skel-c.Po + -rm -f src/$(DEPDIR)/bison-scan-skel.Po + -rm -f src/$(DEPDIR)/bison-state.Po + -rm -f src/$(DEPDIR)/bison-symlist.Po + -rm -f src/$(DEPDIR)/bison-symtab.Po + -rm -f src/$(DEPDIR)/bison-tables.Po + -rm -f src/$(DEPDIR)/bison-uniqstr.Po -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-generic +mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \ + mostlyclean-generic mostlyclean-local mostlyclean-vti pdf: pdf-recursive -pdf-am: +pdf-am: $(PDFS) ps: ps-recursive -ps-am: +ps-am: $(PSS) -uninstall-am: uninstall-aclocalDATA +uninstall-am: uninstall-aclocalDATA uninstall-binPROGRAMS \ + uninstall-binSCRIPTS uninstall-calcxxDATA \ + uninstall-dist_docDATA uninstall-dist_m4sugarDATA \ + uninstall-dist_pkgdataDATA uninstall-dist_xsltDATA \ + uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-libLIBRARIES uninstall-local uninstall-man \ + uninstall-mfcalcDATA uninstall-pdf-am uninstall-ps-am \ + uninstall-rpcalcDATA -.MAKE: $(am__recursive_targets) all check install install-am \ +uninstall-man: uninstall-man1 + +.MAKE: $(am__recursive_targets) all check check-am install install-am \ install-strip -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-cscope clean-generic \ - cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-generic distclean-tags \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ + am--depfiles am--refresh check check-TESTS check-am \ + check-local clean clean-aminfo clean-binPROGRAMS \ + clean-checkPROGRAMS clean-cscope clean-generic \ + clean-libLIBRARIES clean-local clean-noinstLIBRARIES cscope \ + cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-info dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-local distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-aclocalDATA install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-aclocalDATA uninstall-am - -.PHONY: $(MAINTAINER_CHECKS) -$(MAINTAINER_CHECKS): - $(AM_V_GEN)cd tests && $(MAKE) $(AM_MAKEFLAGS) $@ + html-am html-local info info-am install install-aclocalDATA \ + install-am install-binPROGRAMS install-binSCRIPTS \ + install-calcxxDATA install-data install-data-am \ + install-dist_docDATA install-dist_m4sugarDATA \ + install-dist_pkgdataDATA install-dist_xsltDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-local \ + install-html install-html-am install-info install-info-am \ + install-libLIBRARIES install-man install-man1 \ + install-mfcalcDATA install-pdf install-pdf-am install-ps \ + install-ps-am install-rpcalcDATA install-strip installcheck \ + installcheck-am installcheck-binPROGRAMS \ + installcheck-binSCRIPTS installcheck-local installdirs \ + installdirs-am maintainer-clean maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti mostlyclean \ + mostlyclean-aminfo mostlyclean-compile mostlyclean-generic \ + mostlyclean-local mostlyclean-vti pdf pdf-am ps ps-am recheck \ + tags tags-am uninstall uninstall-aclocalDATA uninstall-am \ + uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-calcxxDATA uninstall-dist_docDATA \ + uninstall-dist_m4sugarDATA uninstall-dist_pkgdataDATA \ + uninstall-dist_xsltDATA uninstall-dvi-am uninstall-html-am \ + uninstall-info-am uninstall-libLIBRARIES uninstall-local \ + uninstall-man uninstall-man1 uninstall-mfcalcDATA \ + uninstall-pdf-am uninstall-ps-am uninstall-rpcalcDATA + +.PRECIOUS: Makefile + +$(doc_bison).dvi: $(FIGS_GV:.gv=.eps) +$(doc_bison).info: $(FIGS_GV:.gv=.txt) +$(doc_bison).pdf: $(FIGS_GV:.gv=.pdf) +$(doc_bison).html: $(FIGS_GV:.gv=.png) +clean-local: + rm -rf $(CLEANDIRS) +$(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL) +# Create $@~ which is the previous contents. Don't use 'mv' here so +# that even if we are interrupted, the file is still available for +# diff in the next run. Note that $@ might not exist yet. + $(AM_V_GEN){ test ! -f $@ || cat $@; } >$@~ + $(AM_V_at)test ! -f $@.tmp || rm -f $@.tmp + $(AM_V_at)src/bison$(EXEEXT) --help | \ + $(PERL) $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp + $(AM_V_at)diff -u $@~ $@.tmp || true + $(AM_V_at)mv $@.tmp $@ + +doc/refcard.pdf: doc/refcard.tex + $(AM_V_GEN) cd doc && pdftex $(abs_top_srcdir)/doc/refcard.tex +@CROSS_COMPILING_FALSE@$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT) +@CROSS_COMPILING_FALSE@ $(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp +@CROSS_COMPILING_FALSE@ $(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp +@CROSS_COMPILING_FALSE@ $(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@ + +$(top_srcdir)/doc/bison.1: $(MAN_DEPS) + $(AM_V_GEN)$(HELP2MAN) \ + --include=$(top_srcdir)/doc/bison.x \ + --output=$@.t src/bison$(EXEEXT) + $(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \ + $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \ + touch $@; \ + else \ + mv $@.t $@; \ + fi + $(AM_V_at)rm -f $@*.t + +.gv.eps: + $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` + $(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp + $(AM_V_at) mv $@.tmp $@ + +.gv.pdf: + $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` + $(AM_V_at) $(DOT) -Gmargin=0 -Tpdf $< >$@.tmp + $(AM_V_at) mv $@.tmp $@ + +.gv.png: + $(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'` + $(AM_V_at) $(DOT) -Gmargin=0 -Tpng $< >$@.tmp + $(AM_V_at) mv $@.tmp $@ + +.PHONY: doc html + +doc: html + +html-local: doc/Doxyfile + $(AM_V_GEN) $(DOXYGEN) doc/Doxyfile +# Sed is used to generate Doxyfile from Doxyfile.in instead of +# configure, because the former is way faster than the latter. +doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in + $(AM_V_GEN) $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile +examples/extracted.stamp: $(doc) $(extexi) + $(AM_V_GEN)rm -f $@ $@.tmp + $(AM_V_at)touch $@.tmp + $(AM_V_at)$(extract) $(extracted) + $(AM_V_at)mv $@.tmp $@ + +$(extracted): examples/extracted.stamp + @test -f $@ || rm -f examples/extracted.stamp + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp + +# Don't depend on $(BISON) otherwise we would rebuild these files +# in srcdir, including during distcheck, which is forbidden. +examples/calc++/calc++-parser.stamp: $(BISON_IN) +.yy.stamp: + $(AM_V_YACC)rm -f $@ + $(AM_V_at)touch $@.tmp + $(AM_V_at)$(YACCCOMPILE) -o $*.cc $< + $(AM_V_at)mv -f $@.tmp $@ + +$(calcxx_sources_generated): examples/calc++/calc++-parser.stamp + @test -f $@ || rm -f examples/calc++/calc++-parser.stamp + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp + +# Avoid using BUILT_SOURCES which is too global. +$(examples_calc___calc___OBJECTS): $(calcxx_sources_generated) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_ALLOCA_H_TRUE@lib/alloca.h: lib/alloca.in.h $(top_builddir)/config.status +@GL_GENERATE_ALLOCA_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_ALLOCA_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_ALLOCA_H_TRUE@ cat $(top_srcdir)/lib/alloca.in.h; \ +@GL_GENERATE_ALLOCA_H_TRUE@ } > $@-t && \ +@GL_GENERATE_ALLOCA_H_TRUE@ mv -f $@-t $@ +@GL_GENERATE_ALLOCA_H_FALSE@lib/alloca.h: $(top_builddir)/config.status +@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@ + +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+ or 2.70. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +lib/configmake.h: Makefile + $(AM_V_GEN)rm -f $@-t && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define RUNSTATEDIR "$(runstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t && \ + mv -f $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that is POSIX compliant. +@GL_GENERATE_ERRNO_H_TRUE@lib/errno.h: lib/errno.in.h $(top_builddir)/config.status +@GL_GENERATE_ERRNO_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_ERRNO_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_ERRNO_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ +@GL_GENERATE_ERRNO_H_TRUE@ < $(top_srcdir)/lib/errno.in.h; \ +@GL_GENERATE_ERRNO_H_TRUE@ } > $@-t && \ +@GL_GENERATE_ERRNO_H_TRUE@ mv $@-t $@ +@GL_GENERATE_ERRNO_H_FALSE@lib/errno.h: $(top_builddir)/config.status +@GL_GENERATE_ERRNO_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/fcntl.h: lib/fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_FLOAT_H_TRUE@lib/float.h: lib/float.in.h $(top_builddir)/config.status +@GL_GENERATE_FLOAT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_FLOAT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_FLOAT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \ +@GL_GENERATE_FLOAT_H_TRUE@ < $(top_srcdir)/lib/float.in.h; \ +@GL_GENERATE_FLOAT_H_TRUE@ } > $@-t && \ +@GL_GENERATE_FLOAT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_FLOAT_H_FALSE@lib/float.h: $(top_builddir)/config.status +@GL_GENERATE_FLOAT_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/getopt.h: lib/getopt.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + < $(top_srcdir)/lib/getopt.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +lib/getopt-cdefs.h: lib/getopt-cdefs.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ + < $(top_srcdir)/lib/getopt-cdefs.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +distclean-local: clean-GNUmakefile +clean-GNUmakefile: + test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/inttypes.h: lib/inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ + -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ + -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ + -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ + -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \ + -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \ + -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \ + -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ + -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ + -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ + -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ + -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ + -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ + -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ + -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/inttypes.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that is compatible with GNU. +@GL_GENERATE_LIMITS_H_TRUE@lib/limits.h: lib/limits.in.h $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_LIMITS_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_LIMITS_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ < $(top_srcdir)/lib/limits.in.h; \ +@GL_GENERATE_LIMITS_H_TRUE@ } > $@-t && \ +@GL_GENERATE_LIMITS_H_TRUE@ mv $@-t $@ +@GL_GENERATE_LIMITS_H_FALSE@lib/limits.h: $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_FALSE@ rm -f $@ + +# We need the following in order to install a simple file in $(libdir) +# which is shared with other installed packages. We use a list of referencing +# packages so that "make uninstall" will remove the file if and only if it +# is not used by another installed package. +# On systems with glibc-2.1 or newer, the file is redundant, therefore we +# avoid installing it. + +all-local: lib/charset.alias lib/ref-add.sed lib/ref-del.sed +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ + if test -f $(charset_alias); then \ + sed -f lib/ref-add.sed $(charset_alias) > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + else \ + if $$need_charset_alias; then \ + sed -f lib/ref-add.sed lib/charset.alias > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + fi ; \ + fi + +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local + if test -f $(charset_alias); then \ + sed -f lib/ref-del.sed $(charset_alias) > $(charset_tmp); \ + if grep '^# Packages using this file: $$' $(charset_tmp) \ + > /dev/null; then \ + rm -f $(charset_alias); \ + else \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ + fi; \ + rm -f $(charset_tmp); \ + fi + +lib/charset.alias: lib/config.charset + $(AM_V_GEN)rm -f $@-t $@ && \ + $(SHELL) $(top_srcdir)/lib/config.charset '$(host)' > $@-t && \ + mv $@-t $@ + +# SUFFIXES += .sed .sin +.sin.sed: + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/math.h: lib/math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \ + -e 's/@''GNULIB_ACOSF''@/$(GNULIB_ACOSF)/g' \ + -e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \ + -e 's/@''GNULIB_ASINF''@/$(GNULIB_ASINF)/g' \ + -e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \ + -e 's/@''GNULIB_ATANF''@/$(GNULIB_ATANF)/g' \ + -e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \ + -e 's/@''GNULIB_ATAN2F''@/$(GNULIB_ATAN2F)/g' \ + -e 's/@''GNULIB_CBRT''@/$(GNULIB_CBRT)/g' \ + -e 's/@''GNULIB_CBRTF''@/$(GNULIB_CBRTF)/g' \ + -e 's/@''GNULIB_CBRTL''@/$(GNULIB_CBRTL)/g' \ + -e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \ + -e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \ + -e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \ + -e 's/@''GNULIB_COPYSIGN''@/$(GNULIB_COPYSIGN)/g' \ + -e 's/@''GNULIB_COPYSIGNF''@/$(GNULIB_COPYSIGNF)/g' \ + -e 's/@''GNULIB_COPYSIGNL''@/$(GNULIB_COPYSIGNL)/g' \ + -e 's/@''GNULIB_COSF''@/$(GNULIB_COSF)/g' \ + -e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \ + -e 's/@''GNULIB_COSHF''@/$(GNULIB_COSHF)/g' \ + -e 's/@''GNULIB_EXPF''@/$(GNULIB_EXPF)/g' \ + -e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \ + -e 's/@''GNULIB_EXP2''@/$(GNULIB_EXP2)/g' \ + -e 's/@''GNULIB_EXP2F''@/$(GNULIB_EXP2F)/g' \ + -e 's/@''GNULIB_EXP2L''@/$(GNULIB_EXP2L)/g' \ + -e 's/@''GNULIB_EXPM1''@/$(GNULIB_EXPM1)/g' \ + -e 's/@''GNULIB_EXPM1F''@/$(GNULIB_EXPM1F)/g' \ + -e 's/@''GNULIB_EXPM1L''@/$(GNULIB_EXPM1L)/g' \ + -e 's/@''GNULIB_FABSF''@/$(GNULIB_FABSF)/g' \ + -e 's/@''GNULIB_FABSL''@/$(GNULIB_FABSL)/g' \ + -e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \ + -e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \ + -e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \ + -e 's/@''GNULIB_FMA''@/$(GNULIB_FMA)/g' \ + -e 's/@''GNULIB_FMAF''@/$(GNULIB_FMAF)/g' \ + -e 's/@''GNULIB_FMAL''@/$(GNULIB_FMAL)/g' \ + -e 's/@''GNULIB_FMOD''@/$(GNULIB_FMOD)/g' \ + -e 's/@''GNULIB_FMODF''@/$(GNULIB_FMODF)/g' \ + -e 's/@''GNULIB_FMODL''@/$(GNULIB_FMODL)/g' \ + -e 's/@''GNULIB_FREXPF''@/$(GNULIB_FREXPF)/g' \ + -e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \ + -e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \ + -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \ + -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \ + -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \ + < $(top_srcdir)/lib/math.in.h | \ + sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \ + -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \ + -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \ + -e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \ + -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \ + -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \ + -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \ + -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \ + -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \ + -e 's/@''GNULIB_LDEXPF''@/$(GNULIB_LDEXPF)/g' \ + -e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \ + -e 's/@''GNULIB_LOG''@/$(GNULIB_LOG)/g' \ + -e 's/@''GNULIB_LOGF''@/$(GNULIB_LOGF)/g' \ + -e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \ + -e 's/@''GNULIB_LOG10''@/$(GNULIB_LOG10)/g' \ + -e 's/@''GNULIB_LOG10F''@/$(GNULIB_LOG10F)/g' \ + -e 's/@''GNULIB_LOG10L''@/$(GNULIB_LOG10L)/g' \ + -e 's/@''GNULIB_LOG1P''@/$(GNULIB_LOG1P)/g' \ + -e 's/@''GNULIB_LOG1PF''@/$(GNULIB_LOG1PF)/g' \ + -e 's/@''GNULIB_LOG1PL''@/$(GNULIB_LOG1PL)/g' \ + -e 's/@''GNULIB_LOG2''@/$(GNULIB_LOG2)/g' \ + -e 's/@''GNULIB_LOG2F''@/$(GNULIB_LOG2F)/g' \ + -e 's/@''GNULIB_LOG2L''@/$(GNULIB_LOG2L)/g' \ + -e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \ + -e 's/@''GNULIB_LOGBF''@/$(GNULIB_LOGBF)/g' \ + -e 's/@''GNULIB_LOGBL''@/$(GNULIB_LOGBL)/g' \ + -e 's/@''GNULIB_MODF''@/$(GNULIB_MODF)/g' \ + -e 's/@''GNULIB_MODFF''@/$(GNULIB_MODFF)/g' \ + -e 's/@''GNULIB_MODFL''@/$(GNULIB_MODFL)/g' \ + -e 's/@''GNULIB_POWF''@/$(GNULIB_POWF)/g' \ + -e 's/@''GNULIB_REMAINDER''@/$(GNULIB_REMAINDER)/g' \ + -e 's/@''GNULIB_REMAINDERF''@/$(GNULIB_REMAINDERF)/g' \ + -e 's/@''GNULIB_REMAINDERL''@/$(GNULIB_REMAINDERL)/g' \ + -e 's/@''GNULIB_RINT''@/$(GNULIB_RINT)/g' \ + -e 's/@''GNULIB_RINTF''@/$(GNULIB_RINTF)/g' \ + -e 's/@''GNULIB_RINTL''@/$(GNULIB_RINTL)/g' \ + -e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \ + -e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \ + -e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \ + -e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \ + -e 's/@''GNULIB_SINF''@/$(GNULIB_SINF)/g' \ + -e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \ + -e 's/@''GNULIB_SINHF''@/$(GNULIB_SINHF)/g' \ + -e 's/@''GNULIB_SQRTF''@/$(GNULIB_SQRTF)/g' \ + -e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \ + -e 's/@''GNULIB_TANF''@/$(GNULIB_TANF)/g' \ + -e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \ + -e 's/@''GNULIB_TANHF''@/$(GNULIB_TANHF)/g' \ + -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \ + -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \ + -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \ + | \ + sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \ + -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \ + -e 's|@''HAVE_ASINF''@|$(HAVE_ASINF)|g' \ + -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \ + -e 's|@''HAVE_ATANF''@|$(HAVE_ATANF)|g' \ + -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \ + -e 's|@''HAVE_ATAN2F''@|$(HAVE_ATAN2F)|g' \ + -e 's|@''HAVE_CBRT''@|$(HAVE_CBRT)|g' \ + -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \ + -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \ + -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \ + -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \ + -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \ + -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \ + -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \ + -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \ + -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \ + -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \ + -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \ + -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \ + -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \ + -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \ + -e 's|@''HAVE_FMAF''@|$(HAVE_FMAF)|g' \ + -e 's|@''HAVE_FMAL''@|$(HAVE_FMAL)|g' \ + -e 's|@''HAVE_FMODF''@|$(HAVE_FMODF)|g' \ + -e 's|@''HAVE_FMODL''@|$(HAVE_FMODL)|g' \ + -e 's|@''HAVE_FREXPF''@|$(HAVE_FREXPF)|g' \ + -e 's|@''HAVE_HYPOTF''@|$(HAVE_HYPOTF)|g' \ + -e 's|@''HAVE_HYPOTL''@|$(HAVE_HYPOTL)|g' \ + -e 's|@''HAVE_ILOGB''@|$(HAVE_ILOGB)|g' \ + -e 's|@''HAVE_ILOGBF''@|$(HAVE_ILOGBF)|g' \ + -e 's|@''HAVE_ILOGBL''@|$(HAVE_ILOGBL)|g' \ + -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \ + -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \ + -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \ + -e 's|@''HAVE_LDEXPF''@|$(HAVE_LDEXPF)|g' \ + -e 's|@''HAVE_LOGF''@|$(HAVE_LOGF)|g' \ + -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \ + -e 's|@''HAVE_LOG10F''@|$(HAVE_LOG10F)|g' \ + -e 's|@''HAVE_LOG10L''@|$(HAVE_LOG10L)|g' \ + -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \ + -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \ + -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \ + -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \ + -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \ + -e 's|@''HAVE_MODFF''@|$(HAVE_MODFF)|g' \ + -e 's|@''HAVE_MODFL''@|$(HAVE_MODFL)|g' \ + -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \ + -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \ + -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \ + -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \ + -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \ + -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \ + -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \ + -e 's|@''HAVE_SINHF''@|$(HAVE_SINHF)|g' \ + -e 's|@''HAVE_SQRTF''@|$(HAVE_SQRTF)|g' \ + -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \ + -e 's|@''HAVE_TANF''@|$(HAVE_TANF)|g' \ + -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \ + -e 's|@''HAVE_TANHF''@|$(HAVE_TANHF)|g' \ + -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ + -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ + -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ + -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \ + -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \ + -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \ + -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \ + -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \ + -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \ + -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \ + -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \ + -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \ + -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \ + -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \ + -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \ + -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \ + -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \ + -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \ + -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \ + -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \ + -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \ + -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \ + -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \ + -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \ + -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \ + -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \ + -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \ + -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \ + -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \ + -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \ + -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \ + -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \ + -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \ + -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \ + -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \ + -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \ + | \ + sed -e 's|@''REPLACE_ACOSF''@|$(REPLACE_ACOSF)|g' \ + -e 's|@''REPLACE_ASINF''@|$(REPLACE_ASINF)|g' \ + -e 's|@''REPLACE_ATANF''@|$(REPLACE_ATANF)|g' \ + -e 's|@''REPLACE_ATAN2F''@|$(REPLACE_ATAN2F)|g' \ + -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \ + -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \ + -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \ + -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ + -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ + -e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \ + -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \ + -e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \ + -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \ + -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \ + -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \ + -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \ + -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \ + -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \ + -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \ + -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \ + -e 's|@''REPLACE_FMA''@|$(REPLACE_FMA)|g' \ + -e 's|@''REPLACE_FMAF''@|$(REPLACE_FMAF)|g' \ + -e 's|@''REPLACE_FMAL''@|$(REPLACE_FMAL)|g' \ + -e 's|@''REPLACE_FMOD''@|$(REPLACE_FMOD)|g' \ + -e 's|@''REPLACE_FMODF''@|$(REPLACE_FMODF)|g' \ + -e 's|@''REPLACE_FMODL''@|$(REPLACE_FMODL)|g' \ + -e 's|@''REPLACE_FREXPF''@|$(REPLACE_FREXPF)|g' \ + -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \ + -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \ + -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \ + -e 's|@''REPLACE_HYPOT''@|$(REPLACE_HYPOT)|g' \ + -e 's|@''REPLACE_HYPOTF''@|$(REPLACE_HYPOTF)|g' \ + -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \ + -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \ + -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \ + -e 's|@''REPLACE_ILOGBL''@|$(REPLACE_ILOGBL)|g' \ + -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \ + -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \ + -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \ + -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \ + -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \ + -e 's|@''REPLACE_LOG''@|$(REPLACE_LOG)|g' \ + -e 's|@''REPLACE_LOGF''@|$(REPLACE_LOGF)|g' \ + -e 's|@''REPLACE_LOGL''@|$(REPLACE_LOGL)|g' \ + -e 's|@''REPLACE_LOG10''@|$(REPLACE_LOG10)|g' \ + -e 's|@''REPLACE_LOG10F''@|$(REPLACE_LOG10F)|g' \ + -e 's|@''REPLACE_LOG10L''@|$(REPLACE_LOG10L)|g' \ + -e 's|@''REPLACE_LOG1P''@|$(REPLACE_LOG1P)|g' \ + -e 's|@''REPLACE_LOG1PF''@|$(REPLACE_LOG1PF)|g' \ + -e 's|@''REPLACE_LOG1PL''@|$(REPLACE_LOG1PL)|g' \ + -e 's|@''REPLACE_LOG2''@|$(REPLACE_LOG2)|g' \ + -e 's|@''REPLACE_LOG2F''@|$(REPLACE_LOG2F)|g' \ + -e 's|@''REPLACE_LOG2L''@|$(REPLACE_LOG2L)|g' \ + -e 's|@''REPLACE_LOGB''@|$(REPLACE_LOGB)|g' \ + -e 's|@''REPLACE_LOGBF''@|$(REPLACE_LOGBF)|g' \ + -e 's|@''REPLACE_LOGBL''@|$(REPLACE_LOGBL)|g' \ + -e 's|@''REPLACE_MODF''@|$(REPLACE_MODF)|g' \ + -e 's|@''REPLACE_MODFF''@|$(REPLACE_MODFF)|g' \ + -e 's|@''REPLACE_MODFL''@|$(REPLACE_MODFL)|g' \ + -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \ + -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \ + -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \ + -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \ + -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \ + -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ + -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ + -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ + -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \ + -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \ + -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \ + -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \ + -e 's|@''REPLACE_TANF''@|$(REPLACE_TANF)|g' \ + -e 's|@''REPLACE_TANHF''@|$(REPLACE_TANHF)|g' \ + -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \ + -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \ + -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create a replacement for when +# the system doesn't have one. +@GL_GENERATE_SCHED_H_TRUE@lib/sched.h: lib/sched.in.h $(top_builddir)/config.status +@GL_GENERATE_SCHED_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_SCHED_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_SCHED_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \ +@GL_GENERATE_SCHED_H_TRUE@ < $(top_srcdir)/lib/sched.in.h; \ +@GL_GENERATE_SCHED_H_TRUE@ } > $@-t && \ +@GL_GENERATE_SCHED_H_TRUE@ mv $@-t $@ +@GL_GENERATE_SCHED_H_FALSE@lib/sched.h: $(top_builddir)/config.status +@GL_GENERATE_SCHED_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have a complete one. +lib/signal.h: lib/signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ + -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \ + -e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \ + -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \ + -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \ + -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \ + -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \ + -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \ + -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ + -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ + -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ + -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ + -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \ + -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \ + -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/signal.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create a replacement for when +# the system doesn't have one. +lib/spawn.h: lib/spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_SPAWN_H''@|$(HAVE_SPAWN_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SPAWN_H''@|$(NEXT_SPAWN_H)|g' \ + -e 's/@''GNULIB_POSIX_SPAWN''@/$(GNULIB_POSIX_SPAWN)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNP''@/$(GNULIB_POSIX_SPAWNP)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)/g' \ + -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_INIT''@/$(GNULIB_POSIX_SPAWNATTR_INIT)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_GETFLAGS)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_SETFLAGS)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_GETPGROUP)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_SETPGROUP)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGMASK)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGMASK)/g' \ + -e 's/@''GNULIB_POSIX_SPAWNATTR_DESTROY''@/$(GNULIB_POSIX_SPAWNATTR_DESTROY)/g' \ + -e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \ + -e 's|@''HAVE_POSIX_SPAWNATTR_T''@|$(HAVE_POSIX_SPAWNATTR_T)|g' \ + -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_T''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_T)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)|g' \ + -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/spawn.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works. +@GL_GENERATE_STDBOOL_H_TRUE@lib/stdbool.h: lib/stdbool.in.h $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDBOOL_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDBOOL_H_TRUE@ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(top_srcdir)/lib/stdbool.in.h; \ +@GL_GENERATE_STDBOOL_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDBOOL_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDBOOL_H_FALSE@lib/stdbool.h: $(top_builddir)/config.status +@GL_GENERATE_STDBOOL_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDDEF_H_TRUE@lib/stddef.h: lib/stddef.in.h $(top_builddir)/config.status +@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDDEF_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_STDDEF_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ +@GL_GENERATE_STDDEF_H_TRUE@ < $(top_srcdir)/lib/stddef.in.h; \ +@GL_GENERATE_STDDEF_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDDEF_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDDEF_H_FALSE@lib/stddef.h: $(top_builddir)/config.status +@GL_GENERATE_STDDEF_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +@GL_GENERATE_STDINT_H_TRUE@lib/stdint.h: lib/stdint.in.h $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_STDINT_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ +@GL_GENERATE_STDINT_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ < $(top_srcdir)/lib/stdint.in.h; \ +@GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ +@GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ +@GL_GENERATE_STDINT_H_FALSE@lib/stdint.h: $(top_builddir)/config.status +@GL_GENERATE_STDINT_H_FALSE@ rm -f $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/stdio.h: lib/stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \ + -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \ + -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \ + -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \ + -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \ + -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \ + -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \ + -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \ + -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \ + -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \ + -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \ + -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \ + -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \ + -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \ + -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \ + -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \ + -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \ + -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \ + -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \ + -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \ + -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ + -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ + -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ + -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \ + -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \ + -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \ + -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \ + -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \ + -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \ + -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \ + -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \ + -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \ + -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \ + -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \ + -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \ + -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \ + -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \ + -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \ + -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \ + -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ + -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + < $(top_srcdir)/lib/stdio.in.h | \ + sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ + -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \ + -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \ + -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \ + -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \ + -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \ + -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \ + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ + -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \ + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ + -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ + -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \ + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ + -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \ + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ + -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \ + -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \ + -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \ + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ + -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ + -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ + -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ + -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/stdlib.h: lib/stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALLOCARRAY''@/$(GNULIB_REALLOCARRAY)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + < $(top_srcdir)/lib/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ + -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ + -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ + -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \ + -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \ + -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ + -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ + -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ + -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ + -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ + -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/string.h: lib/string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ + -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GNULIB_EXPLICIT_BZERO)/g' \ + -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ + -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ + -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ + -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ + -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ + -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ + -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ + -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ + -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ + -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ + -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ + -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ + -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ + -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ + -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ + -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ + -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ + -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ + -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ + -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ + -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ + -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ + -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ + -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ + -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ + -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ + -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ + -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ + -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ + -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ + -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ + -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ + -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ + -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ + -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ + -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + < $(top_srcdir)/lib/string.in.h | \ + sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \ + -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ + -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ + -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ + -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ + -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ + -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ + -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ + -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ + -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ + -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ + -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ + -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ + -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ + -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ + -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ + -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ + -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ + -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ + -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ + -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \ + -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \ + -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ + -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + < $(top_srcdir)/lib/string.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# has one that is incomplete. +lib/sys/stat.h: lib/sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) lib/sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ + -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \ + -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ + -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ + -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ + -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ + -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ + -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ + -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ + -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ + -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ + -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ + -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ + -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \ + -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ + -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ + -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ + -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ + -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ + -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ + -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ + -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ + -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ + -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ + -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ + -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ + -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/sys_stat.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/sys/types.h: lib/sys_types.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) lib/sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \ + < $(top_srcdir)/lib/sys_types.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# has one that is incomplete. +lib/sys/wait.h: lib/sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) lib/sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ + -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/sys_wait.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/time.h: lib/time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's/@''GNULIB_CTIME''@/$(GNULIB_CTIME)/g' \ + -e 's/@''GNULIB_LOCALTIME''@/$(GNULIB_LOCALTIME)/g' \ + -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ + -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ + -e 's/@''GNULIB_STRFTIME''@/$(GNULIB_STRFTIME)/g' \ + -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ + -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ + -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ + -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \ + -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ + -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ + -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ + -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ + -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \ + -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ + -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ + -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \ + -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \ + -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/time.in.h; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create an empty placeholder for +# when the system doesn't have one. +lib/unistd.h: lib/unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TRUNCATE''@/$(GNULIB_TRUNCATE)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + < $(top_srcdir)/lib/unistd.in.h | \ + sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ + -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ + -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ + -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ + -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ + -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \ + -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ + -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \ + -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ + -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ + -e 's|@''HAVE_TRUNCATE''@|$(HAVE_TRUNCATE)|g' \ + -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ + -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ + -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ + -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ + | \ + sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ + -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ + -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \ + -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ + -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \ + -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ + -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ + -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ + -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ + -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ + -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ + -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ + -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \ + -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ + -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ + -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ + -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +lib/unitypes.h: lib/unitypes.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(top_srcdir)/lib/unitypes.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +lib/uniwidth.h: lib/uniwidth.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(top_srcdir)/lib/uniwidth.in.h; \ + } > $@-t && \ + mv -f $@-t $@ + +# We need the following in order to create when the system +# version does not work standalone. +lib/wchar.h: lib/wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ + -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ + -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ + -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \ + -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \ + -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \ + -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \ + -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \ + -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \ + -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \ + -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \ + -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \ + -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ + -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ + -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ + -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ + -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ + -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \ + -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \ + -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \ + -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \ + -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \ + -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \ + -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \ + -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \ + -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \ + -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \ + -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \ + -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \ + -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \ + -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \ + -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \ + -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \ + -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \ + -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \ + -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \ + -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ + -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ + -e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \ + < $(top_srcdir)/lib/wchar.in.h | \ + sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \ + -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ + -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ + -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ + -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ + -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ + -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \ + -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \ + -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \ + -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \ + -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \ + -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \ + -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \ + -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \ + -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \ + -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \ + -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \ + -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \ + -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \ + -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \ + -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \ + -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \ + -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \ + -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \ + -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \ + -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \ + -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ + -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + | \ + sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ + -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ + -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/wctype.h: lib/wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ + -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ + -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ + -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \ + -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \ + -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \ + -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/wctype.in.h; \ + } > $@-t && \ + mv $@-t $@ + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done; \ + : + +src/yacc: + $(AM_V_GEN)rm -f $@ $@.tmp + $(AM_V_at)echo '#! /bin/sh' >$@.tmp + $(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@.tmp + $(AM_V_at)chmod a+x $@.tmp + $(AM_V_at)mv $@.tmp $@ + +$(top_srcdir)/tests/package.m4: $(top_srcdir)/configure + $(AM_V_GEN)rm -f $@ $@.tmp + $(AM_V_at){ \ + echo '# Signature of the current package.'; \ + echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \ + echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \ + echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \ + echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \ + echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \ + } >$@.tmp + $(AM_V_at)mv $@.tmp $@ +$(TESTSUITE): $(TESTSUITE_AT) + $(AM_V_GEN) \ + $(AUTOTEST) $(AUTOTESTFLAGS) $(srcdir)/tests/testsuite.at -o $@.tmp + $(AM_V_at)$(PERL) -pi -e 's/\@tb\@/\t/g' $@.tmp + $(AM_V_at)mv $@.tmp $@ + +clean-local: clean-local-tests +clean-local-tests: + test ! -f $(TESTSUITE) || $(TESTSUITE) -C tests --clean + +check-local: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) + +# Run the test suite on the *installed* tree. +installcheck-local: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) AUTOTEST_PATH='$(bindir)' + +# Be real mean with it. +.PHONY: maintainer-check-g++ +maintainer-check-g++: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) --compile-c-with-cxx + +.PHONY: maintainer-check-posix +maintainer-check-posix: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) POSIXLY_CORRECT=1 _POSIX2_VERSION=200112 + +.PHONY: maintainer-check-valgrind +maintainer-check-valgrind: $(RUN_TESTSUITE_deps) + test 'x$(VALGRIND)' != x || \ + $(RUN_TESTSUITE) \ + PREBISON='$(VALGRIND) -q' PREPARSER='$(VALGRIND) -q' \ + VALGRIND_OPTS="$(VALGRIND_OPTS)" + +.PHONY: maintainer-check +maintainer-check: maintainer-check-posix maintainer-check-valgrind maintainer-check-g++ + +.PHONY: maintainer-push-check +maintainer-push-check: + $(MAKE) $(AM_MAKEFLAGS) maintainer-check \ + TESTSUITEFLAGS='BISON_USE_PUSH_FOR_PULL=1 $(TESTSUITEFLAGS)' + +.PHONY: maintainer-xml-check +maintainer-xml-check: + $(MAKE) $(AM_MAKEFLAGS) maintainer-check \ + TESTSUITEFLAGS='BISON_TEST_XML=1 $(TESTSUITEFLAGS)' + +.PHONY: maintainer-release-check +maintainer-release-check: maintainer-check maintainer-push-check maintainer-xml-check $(top_srcdir)/.version: configure - $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@ + echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: gen-ChangeLog - $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version + echo $(VERSION) > $(distdir)/.tarball-version .PHONY: update-b4-copyright update-package-copyright-year update-b4-copyright: diff --git a/NEWS b/NEWS index d445ce7..8cd711e 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,754 @@ GNU Bison NEWS +* Noteworthy changes in release 3.0.5 (2018-05-27) [stable] + +** Bug fixes + +*** C++: Fix support of 'syntax_error' + + One incorrect 'inline' resulted in linking errors about the constructor of + the syntax_error exception. + +*** C++: Fix warnings + + GCC 7.3 (with -O1 or -O2 but not -O0 or -O3) issued null-dereference + warnings about yyformat being possibly null. It also warned about the + deprecated implicit definition of copy constructors when there's a + user-defined (copy) assignment operator. + +*** Location of errors + + In C++ parsers, out-of-bounds errors can happen when a rule with an empty + ride-hand side raises a syntax error. The behavior of the default parser + (yacc.c) in such a condition was undefined. + + Now all the parsers match the behavior of glr.c: @$ is used as the + location of the error. This handles gracefully rules with and without + rhs. + +*** Portability fixes in the test suite + + On some platforms, some Java and/or C++ tests were failing. + +* Noteworthy changes in release 3.0.4 (2015-01-23) [stable] + +** Bug fixes + +*** C++ with Variants (lalr1.cc) + + Fix a compiler warning when no %destructor use $$. + +*** Test suites + + Several portability issues in tests were fixed. + +* Noteworthy changes in release 3.0.3 (2015-01-15) [stable] + +** Bug fixes + +*** C++ with Variants (lalr1.cc) + + Problems with %destructor and '%define parse.assert' have been fixed. + +*** Named %union support (yacc.c, glr.c) + + Bison 3.0 introduced a regression on named %union such as + + %union foo { int ival; }; + + The possibility to use a name was introduced "for Yacc compatibility". + It is however not required by POSIX Yacc, and its usefulness is not clear. + +*** %define api.value.type union with %defines (yacc.c, glr.c) + + The C parsers were broken when %defines was used together with "%define + api.value.type union". + +*** Redeclarations are reported in proper order + + On + + %token FOO "foo" + %printer {} "foo" + %printer {} FOO + + bison used to report: + + /tmp/foo.yy:2.10-11: error: %printer redeclaration for FOO + %printer {} "foo" + ^^ + /tmp/foo.yy:3.10-11: previous declaration + %printer {} FOO + ^^ + + Now, the "previous" declaration is always the first one. + + +** Documentation + + Bison now installs various files in its docdir (which defaults to + '/usr/local/share/doc/bison'), including the three fully blown examples + extracted from the documentation: + + - rpcalc + Reverse Polish Calculator, a simple introductory example. + - mfcalc + Multi-function Calc, a calculator with memory and functions and located + error messages. + - calc++ + a calculator in C++ using variant support and token constructors. + +* Noteworthy changes in release 3.0.2 (2013-12-05) [stable] + +** Bug fixes + +*** Generated source files when errors are reported + + When warnings are issued and -Werror is set, bison would still generate + the source files (*.c, *.h...). As a consequence, some runs of "make" + could fail the first time, but not the second (as the files were generated + anyway). + + This is fixed: bison no longer generates this source files, but, of + course, still produces the various reports (*.output, *.xml, etc.). + +*** %empty is used in reports + + Empty right-hand sides are denoted by '%empty' in all the reports (text, + dot, XML and formats derived from it). + +*** YYERROR and variants + + When C++ variant support is enabled, an error triggered via YYERROR, but + not caught via error recovery, resulted in a double deletion. + +* Noteworthy changes in release 3.0.1 (2013-11-12) [stable] + +** Bug fixes + +*** Errors in caret diagnostics + + On some platforms, some errors could result in endless diagnostics. + +*** Fixes of the -Werror option + + Options such as "-Werror -Wno-error=foo" were still turning "foo" + diagnostics into errors instead of warnings. This is fixed. + + Actually, for consistency with GCC, "-Wno-error=foo -Werror" now also + leaves "foo" diagnostics as warnings. Similarly, with "-Werror=foo + -Wno-error", "foo" diagnostics are now errors. + +*** GLR Predicates + + As demonstrated in the documentation, one can now leave spaces between + "%?" and its "{". + +*** Installation + + The yacc.1 man page is no longer installed if --disable-yacc was + specified. + +*** Fixes in the test suite + + Bugs and portability issues. + +* Noteworthy changes in release 3.0 (2013-07-25) [stable] + +** WARNING: Future backward-incompatibilities! + + Like other GNU packages, Bison will start using some of the C99 features + for its own code, especially the definition of variables after statements. + The generated C parsers still aim at C90. + +** Backward incompatible changes + +*** Obsolete features + + Support for YYFAIL is removed (deprecated in Bison 2.4.2): use YYERROR. + + Support for yystype and yyltype is removed (deprecated in Bison 1.875): + use YYSTYPE and YYLTYPE. + + Support for YYLEX_PARAM and YYPARSE_PARAM is removed (deprecated in Bison + 1.875): use %lex-param, %parse-param, or %param. + + Missing semicolons at the end of actions are no longer added (as announced + in the release 2.5). + +*** Use of YACC='bison -y' + + TL;DR: With Autoconf <= 2.69, pass -Wno-yacc to (AM_)YFLAGS if you use + Bison extensions. + + Traditional Yacc generates 'y.tab.c' whatever the name of the input file. + Therefore Makefiles written for Yacc expect 'y.tab.c' (and possibly + 'y.tab.h' and 'y.outout') to be generated from 'foo.y'. + + To this end, for ages, AC_PROG_YACC, Autoconf's macro to look for an + implementation of Yacc, was using Bison as 'bison -y'. While it does + ensure compatible output file names, it also enables warnings for + incompatibilities with POSIX Yacc. In other words, 'bison -y' triggers + warnings for Bison extensions. + + Autoconf 2.70+ fixes this incompatibility by using YACC='bison -o y.tab.c' + (which also generates 'y.tab.h' and 'y.output' when needed). + Alternatively, disable Yacc warnings by passing '-Wno-yacc' to your Yacc + flags (YFLAGS, or AM_YFLAGS with Automake). + +** Bug fixes + +*** The epilogue is no longer affected by internal #defines (glr.c) + + The glr.c skeleton uses defines such as #define yylval (yystackp->yyval) in + generated code. These weren't properly undefined before the inclusion of + the user epilogue, so functions such as the following were butchered by the + preprocessor expansion: + + int yylex (YYSTYPE *yylval); + + This is fixed: yylval, yynerrs, yychar, and yylloc are now valid + identifiers for user-provided variables. + +*** stdio.h is no longer needed when locations are enabled (yacc.c) + + Changes in Bison 2.7 introduced a dependency on FILE and fprintf when + locations are enabled. This is fixed. + +*** Warnings about useless %pure-parser/%define api.pure are restored + +** Diagnostics reported by Bison + + Most of these features were contributed by Théophile Ranquet and Victor + Santet. + +*** Carets + + Version 2.7 introduced caret errors, for a prettier output. These are now + activated by default. The old format can still be used by invoking Bison + with -fno-caret (or -fnone). + + Some error messages that reproduced excerpts of the grammar are now using + the caret information only. For instance on: + + %% + exp: 'a' | 'a'; + + Bison 2.7 reports: + + in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] + in.y:2.12-14: warning: rule useless in parser due to conflicts: exp: 'a' [-Wother] + + Now bison reports: + + in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] + in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother] + exp: 'a' | 'a'; + ^^^ + + and "bison -fno-caret" reports: + + in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] + in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother] + +*** Enhancements of the -Werror option + + The -Werror=CATEGORY option is now recognized, and will treat specified + warnings as errors. The warnings need not have been explicitly activated + using the -W option, this is similar to what GCC 4.7 does. + + For example, given the following command line, Bison will treat both + warnings related to POSIX Yacc incompatibilities and S/R conflicts as + errors (and only those): + + $ bison -Werror=yacc,error=conflicts-sr input.y + + If no categories are specified, -Werror will make all active warnings into + errors. For example, the following line does the same the previous example: + + $ bison -Werror -Wnone -Wyacc -Wconflicts-sr input.y + + (By default -Wconflicts-sr,conflicts-rr,deprecated,other is enabled.) + + Note that the categories in this -Werror option may not be prefixed with + "no-". However, -Wno-error[=CATEGORY] is valid. + + Note that -y enables -Werror=yacc. Therefore it is now possible to require + Yacc-like behavior (e.g., always generate y.tab.c), but to report + incompatibilities as warnings: "-y -Wno-error=yacc". + +*** The display of warnings is now richer + + The option that controls a given warning is now displayed: + + foo.y:4.6: warning: type clash on default action: != [-Wother] + + In the case of warnings treated as errors, the prefix is changed from + "warning: " to "error: ", and the suffix is displayed, in a manner similar + to GCC, as [-Werror=CATEGORY]. + + For instance, where the previous version of Bison would report (and exit + with failure): + + bison: warnings being treated as errors + input.y:1.1: warning: stray ',' treated as white space + + it now reports: + + input.y:1.1: error: stray ',' treated as white space [-Werror=other] + +*** Deprecated constructs + + The new 'deprecated' warning category flags obsolete constructs whose + support will be discontinued. It is enabled by default. These warnings + used to be reported as 'other' warnings. + +*** Useless semantic types + + Bison now warns about useless (uninhabited) semantic types. Since + semantic types are not declared to Bison (they are defined in the opaque + %union structure), it is %printer/%destructor directives about useless + types that trigger the warning: + + %token term + %type nterm + %printer {} + %destructor {} + %% + nterm: term { $$ = $1; }; + + 3.28-34: warning: type is used, but is not associated to any symbol + 4.28-34: warning: type is used, but is not associated to any symbol + +*** Undefined but unused symbols + + Bison used to raise an error for undefined symbols that are not used in + the grammar. This is now only a warning. + + %printer {} symbol1 + %destructor {} symbol2 + %type symbol3 + %% + exp: "a"; + +*** Useless destructors or printers + + Bison now warns about useless destructors or printers. In the following + example, the printer for , and the destructor for are + useless: all symbols of (token1) already have a printer, and all + symbols of type (token2) already have a destructor. + + %token token1 + token2 + token3 + token4 + %printer {} token1 + %destructor {} token2 + +*** Conflicts + + The warnings and error messages about shift/reduce and reduce/reduce + conflicts have been normalized. For instance on the following foo.y file: + + %glr-parser + %% + exp: exp '+' exp | '0' | '0'; + + compare the previous version of bison: + + $ bison foo.y + foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce + $ bison -Werror foo.y + bison: warnings being treated as errors + foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce + + with the new behavior: + + $ bison foo.y + foo.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] + foo.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] + $ bison -Werror foo.y + foo.y: error: 1 shift/reduce conflict [-Werror=conflicts-sr] + foo.y: error: 2 reduce/reduce conflicts [-Werror=conflicts-rr] + + When %expect or %expect-rr is used, such as with bar.y: + + %expect 0 + %glr-parser + %% + exp: exp '+' exp | '0' | '0'; + + Former behavior: + + $ bison bar.y + bar.y: conflicts: 1 shift/reduce, 2 reduce/reduce + bar.y: expected 0 shift/reduce conflicts + bar.y: expected 0 reduce/reduce conflicts + + New one: + + $ bison bar.y + bar.y: error: shift/reduce conflicts: 1 found, 0 expected + bar.y: error: reduce/reduce conflicts: 2 found, 0 expected + +** Incompatibilities with POSIX Yacc + + The 'yacc' category is no longer part of '-Wall', enable it explicitly + with '-Wyacc'. + +** Additional yylex/yyparse arguments + + The new directive %param declares additional arguments to both yylex and + yyparse. The %lex-param, %parse-param, and %param directives support one + or more arguments. Instead of + + %lex-param {arg1_type *arg1} + %lex-param {arg2_type *arg2} + %parse-param {arg1_type *arg1} + %parse-param {arg2_type *arg2} + + one may now declare + + %param {arg1_type *arg1} {arg2_type *arg2} + +** Types of values for %define variables + + Bison used to make no difference between '%define foo bar' and '%define + foo "bar"'. The former is now called a 'keyword value', and the latter a + 'string value'. A third kind was added: 'code values', such as '%define + foo {bar}'. + + Keyword variables are used for fixed value sets, e.g., + + %define lr.type lalr + + Code variables are used for value in the target language, e.g., + + %define api.value.type {struct semantic_type} + + String variables are used remaining cases, e.g. file names. + +** Variable api.token.prefix + + The variable api.token.prefix changes the way tokens are identified in + the generated files. This is especially useful to avoid collisions + with identifiers in the target language. For instance + + %token FILE for ERROR + %define api.token.prefix {TOK_} + %% + start: FILE for ERROR; + + will generate the definition of the symbols TOK_FILE, TOK_for, and + TOK_ERROR in the generated sources. In particular, the scanner must + use these prefixed token names, although the grammar itself still + uses the short names (as in the sample rule given above). + +** Variable api.value.type + + This new %define variable supersedes the #define macro YYSTYPE. The use + of YYSTYPE is discouraged. In particular, #defining YYSTYPE *and* either + using %union or %defining api.value.type results in undefined behavior. + + Either define api.value.type, or use "%union": + + %union + { + int ival; + char *sval; + } + %token INT "integer" + %token STRING "string" + %printer { fprintf (yyo, "%d", $$); } + %destructor { free ($$); } + + /* In yylex(). */ + yylval.ival = 42; return INT; + yylval.sval = "42"; return STRING; + + The %define variable api.value.type supports both keyword and code values. + + The keyword value 'union' means that the user provides genuine types, not + union member names such as "ival" and "sval" above (WARNING: will fail if + -y/--yacc/%yacc is enabled). + + %define api.value.type union + %token INT "integer" + %token STRING "string" + %printer { fprintf (yyo, "%d", $$); } + %destructor { free ($$); } + + /* In yylex(). */ + yylval.INT = 42; return INT; + yylval.STRING = "42"; return STRING; + + The keyword value variant is somewhat equivalent, but for C++ special + provision is made to allow classes to be used (more about this below). + + %define api.value.type variant + %token INT "integer" + %token STRING "string" + + Code values (in braces) denote user defined types. This is where YYSTYPE + used to be used. + + %code requires + { + struct my_value + { + enum + { + is_int, is_string + } kind; + union + { + int ival; + char *sval; + } u; + }; + } + %define api.value.type {struct my_value} + %token INT "integer" + %token STRING "string" + %printer { fprintf (yyo, "%d", $$); } + %destructor { free ($$); } + + /* In yylex(). */ + yylval.u.ival = 42; return INT; + yylval.u.sval = "42"; return STRING; + +** Variable parse.error + + This variable controls the verbosity of error messages. The use of the + %error-verbose directive is deprecated in favor of "%define parse.error + verbose". + +** Renamed %define variables + + The following variables have been renamed for consistency. Backward + compatibility is ensured, but upgrading is recommended. + + lr.default-reductions -> lr.default-reduction + lr.keep-unreachable-states -> lr.keep-unreachable-state + namespace -> api.namespace + stype -> api.value.type + +** Semantic predicates + + Contributed by Paul Hilfinger. + + The new, experimental, semantic-predicate feature allows actions of the + form "%?{ BOOLEAN-EXPRESSION }", which cause syntax errors (as for + YYERROR) if the expression evaluates to 0, and are evaluated immediately + in GLR parsers, rather than being deferred. The result is that they allow + the programmer to prune possible parses based on the values of run-time + expressions. + +** The directive %expect-rr is now an error in non GLR mode + + It used to be an error only if used in non GLR mode, _and_ if there are + reduce/reduce conflicts. + +** Tokens are numbered in their order of appearance + + Contributed by Valentin Tolmer. + + With '%token A B', A had a number less than the one of B. However, + precedence declarations used to generate a reversed order. This is now + fixed, and introducing tokens with any of %token, %left, %right, + %precedence, or %nonassoc yields the same result. + + When mixing declarations of tokens with a litteral character (e.g., 'a') + or with an identifier (e.g., B) in a precedence declaration, Bison + numbered the litteral characters first. For example + + %right A B 'c' 'd' + + would lead to the tokens declared in this order: 'c' 'd' A B. Again, the + input order is now preserved. + + These changes were made so that one can remove useless precedence and + associativity declarations (i.e., map %nonassoc, %left or %right to + %precedence, or to %token) and get exactly the same output. + +** Useless precedence and associativity + + Contributed by Valentin Tolmer. + + When developing and maintaining a grammar, useless associativity and + precedence directives are common. They can be a nuisance: new ambiguities + arising are sometimes masked because their conflicts are resolved due to + the extra precedence or associativity information. Furthermore, it can + hinder the comprehension of a new grammar: one will wonder about the role + of a precedence, where in fact it is useless. The following changes aim + at detecting and reporting these extra directives. + +*** Precedence warning category + + A new category of warning, -Wprecedence, was introduced. It flags the + useless precedence and associativity directives. + +*** Useless associativity + + Bison now warns about symbols with a declared associativity that is never + used to resolve conflicts. In that case, using %precedence is sufficient; + the parsing tables will remain unchanged. Solving these warnings may raise + useless precedence warnings, as the symbols no longer have associativity. + For example: + + %left '+' + %left '*' + %% + exp: + "number" + | exp '+' "number" + | exp '*' exp + ; + + will produce a + + warning: useless associativity for '+', use %precedence [-Wprecedence] + %left '+' + ^^^ + +*** Useless precedence + + Bison now warns about symbols with a declared precedence and no declared + associativity (i.e., declared with %precedence), and whose precedence is + never used. In that case, the symbol can be safely declared with %token + instead, without modifying the parsing tables. For example: + + %precedence '=' + %% + exp: "var" '=' "number"; + + will produce a + + warning: useless precedence for '=' [-Wprecedence] + %precedence '=' + ^^^ + +*** Useless precedence and associativity + + In case of both useless precedence and associativity, the issue is flagged + as follows: + + %nonassoc '=' + %% + exp: "var" '=' "number"; + + The warning is: + + warning: useless precedence and associativity for '=' [-Wprecedence] + %nonassoc '=' + ^^^ + +** Empty rules + + With help from Joel E. Denny and Gabriel Rassoul. + + Empty rules (i.e., with an empty right-hand side) can now be explicitly + marked by the new %empty directive. Using %empty on a non-empty rule is + an error. The new -Wempty-rule warning reports empty rules without + %empty. On the following grammar: + + %% + s: a b c; + a: ; + b: %empty; + c: 'a' %empty; + + bison reports: + + 3.4-5: warning: empty rule without %empty [-Wempty-rule] + a: {} + ^^ + 5.8-13: error: %empty on non-empty rule + c: 'a' %empty {}; + ^^^^^^ + +** Java skeleton improvements + + The constants for token names were moved to the Lexer interface. Also, it + is possible to add code to the parser's constructors using "%code init" + and "%define init_throws". + Contributed by Paolo Bonzini. + + The Java skeleton now supports push parsing. + Contributed by Dennis Heimbigner. + +** C++ skeletons improvements + +*** The parser header is no longer mandatory (lalr1.cc, glr.cc) + + Using %defines is now optional. Without it, the needed support classes + are defined in the generated parser, instead of additional files (such as + location.hh, position.hh and stack.hh). + +*** Locations are no longer mandatory (lalr1.cc, glr.cc) + + Both lalr1.cc and glr.cc no longer require %location. + +*** syntax_error exception (lalr1.cc) + + The C++ parser features a syntax_error exception, which can be + thrown from the scanner or from user rules to raise syntax errors. + This facilitates reporting errors caught in sub-functions (e.g., + rejecting too large integral literals from a conversion function + used by the scanner, or rejecting invalid combinations from a + factory invoked by the user actions). + +*** %define api.value.type variant + + This is based on a submission from Michiel De Wilde. With help + from Théophile Ranquet. + + In this mode, complex C++ objects can be used as semantic values. For + instance: + + %token <::std::string> TEXT; + %token NUMBER; + %token SEMICOLON ";" + %type <::std::string> item; + %type <::std::list> list; + %% + result: + list { std::cout << $1 << std::endl; } + ; + + list: + %empty { /* Generates an empty string list. */ } + | list item ";" { std::swap ($$, $1); $$.push_back ($2); } + ; + + item: + TEXT { std::swap ($$, $1); } + | NUMBER { $$ = string_cast ($1); } + ; + +*** %define api.token.constructor + + When variants are enabled, Bison can generate functions to build the + tokens. This guarantees that the token type (e.g., NUMBER) is consistent + with the semantic value (e.g., int): + + parser::symbol_type yylex () + { + parser::location_type loc = ...; + ... + return parser::make_TEXT ("Hello, world!", loc); + ... + return parser::make_NUMBER (42, loc); + ... + return parser::make_SEMICOLON (loc); + ... + } + +*** C++ locations + + There are operator- and operator-= for 'location'. Negative line/column + increments can no longer underflow the resulting value. + * Noteworthy changes in release 2.7.1 (2013-04-15) [stable] ** Bug fixes @@ -20,6 +769,8 @@ GNU Bison NEWS ** Diagnostics are improved + Contributed by Théophile Ranquet. + *** Changes in the format of error messages This used to be the format of many error reports: @@ -58,8 +809,8 @@ GNU Bison NEWS exp: exp '+' exp { $exp = $1 + $3; }; ^^^ - The default behaviour for now is still not to display these unless - explictly asked with -fcaret (or -fall). However, in a later release, it + The default behavior for now is still not to display these unless + explicitly asked with -fcaret (or -fall). However, in a later release, it will be made the default behavior (but may still be deactivated with -fno-caret). @@ -105,6 +856,8 @@ GNU Bison NEWS ** Graph improvements in DOT and XSLT + Contributed by Théophile Ranquet. + The graphical presentation of the states is more readable: their shape is now rectangular, the state number is clearly displayed, and the items are numbered and left-justified. @@ -144,7 +897,7 @@ GNU Bison NEWS Other issues in the test suite have been addressed. - Nul characters are correctly displayed in error messages. + Null characters are correctly displayed in error messages. When possible, yylloc is correctly initialized before calling yylex. It is no longer necessary to initialize it in the %initial-action. @@ -215,7 +968,7 @@ GNU Bison NEWS * Noteworthy changes in release 2.6.1 (2012-07-30) [stable] - Bison no longer executes user-specified M4 code when processing a grammar. + Bison no longer executes user-specified M4 code when processing a grammar. ** Future Changes @@ -253,7 +1006,7 @@ GNU Bison NEWS * Noteworthy changes in release 2.6 (2012-07-19) [stable] -** Future Changes +** Future changes The next major release of Bison will drop support for the following deprecated features. Please report disagreements to bug-bison@gnu.org. @@ -546,7 +1299,9 @@ GNU Bison NEWS These features are experimental. More user feedback will help to stabilize them. -** LAC (Lookahead Correction) for syntax error handling: +** LAC (Lookahead Correction) for syntax error handling + + Contributed by Joel E. Denny. Canonical LR, IELR, and LALR can suffer from a couple of problems upon encountering a syntax error. First, the parser might perform @@ -2023,7 +2778,7 @@ Output file does not redefine const for C++. ----- -Copyright (C) 1995-2013 Free Software Foundation, Inc. +Copyright (C) 1995-2015, 2018 Free Software Foundation, Inc. This file is part of Bison, the GNU Parser Generator. @@ -2057,8 +2812,13 @@ along with this program. If not, see . LocalWords: namespaces strerror const autoconfiguration Dconst Autoconf's FDL LocalWords: Automake TMPDIR LESSEQ ylwrap endif yydebug YYTOKEN YYLSP ival hh LocalWords: extern YYTOKENTYPE TOKENTYPE yytokentype tokentype STYPE lval pdf - LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp calc yyo fval Wmaybe - LocalWords: yyvsp pragmas noreturn java's + LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp Wother nterm arg init + LocalWords: TOK calc yyo fval Wconflicts parsers yystackp yyval yynerrs + LocalWords: Théophile Ranquet Santet fno fnone stype associativity Tolmer + LocalWords: Wprecedence Rassoul Wempty Paolo Bonzini parser's Michiel loc + LocalWords: redeclaration sval fcaret reentrant XSLT xsl Wmaybe yyvsp Tedi + LocalWords: pragmas noreturn untyped Rozenman unexpanded Wojciech Polak + LocalWords: Alexandre MERCHANTABILITY yytype Local Variables: mode: outline diff --git a/PACKAGING b/PACKAGING index c8bbbf6..2abda4f 100644 --- a/PACKAGING +++ b/PACKAGING @@ -36,7 +36,7 @@ to the bison package. ----- -Copyright (C) 2002, 2005, 2009-2013 Free Software Foundation, Inc. +Copyright (C) 2002, 2005, 2009-2015, 2018 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. diff --git a/README b/README index ad667a2..1ae4b98 100644 --- a/README +++ b/README @@ -30,7 +30,7 @@ not answer them, please send mail to . * Bug reports Please send bug reports to . Please include the -version number from `bison --version', and a complete, self-contained +version number from 'bison --version', and a complete, self-contained test case in each bug report. * Copyright statements @@ -44,7 +44,7 @@ End: ----- -Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2013 Free Software +Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. diff --git a/README-alpha b/README-alpha new file mode 100644 index 0000000..8c1742c --- /dev/null +++ b/README-alpha @@ -0,0 +1,30 @@ +-*- text -*- + +This is a test release of this package. Using it more or less +implicitly signs you up to help us find whatever problems you report. + +The documentation still needs more work. Suggestions welcome. +Patches even more welcome. + +Please send comments and problem reports about this test release to +. This program will get better only if you report +the problems you encounter. + +----- + +Copyright (C) 2002, 2004, 2009-2015, 2018 Free Software Foundation, Inc. + +This file is part of GNU Bison. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/README-release b/README-release deleted file mode 100644 index 4d9423a..0000000 --- a/README-release +++ /dev/null @@ -1,100 +0,0 @@ -Here are most of the steps we (maintainers) follow when making a release. - -* Start from a clean, up-to-date git directory on "master": - - make -k maintainer-clean || { ./configure && make maintainer-clean; } - git checkout master - git pull origin master - -* Ensure that the latest stable versions of autoconf, automake, etc. - are in your PATH. See the buildreq list in bootstrap.conf for - the complete list of tools. - -* Ensure that you have no uncommitted diffs. This should produce no - output: - - git diff - -* Ensure that you've pushed all changes that belong in the release: - - git push origin master - -* Check that the NixOS/Hydra autobuilder is reporting all is well: - - http://hydra.nixos.org/jobset/gnu/bison-master - -* Run the following command to download any new translations: - - ./bootstrap && ./configure - -* Pre-release testing: ensure that the following command succeeds: - - make check syntax-check distcheck - -* To (i) set the date, version number, and release TYPE on line 3 of - NEWS, (ii) commit that, and (iii) tag the release, run - - # "TYPE" must be stable, beta or alpha - make release-commit RELEASE='X.Y TYPE' - -* Run the following to create release tarballs. Your choice selects the - corresponding upload-to destination in the emitted gnupload command. - The different destinations are specified in cfg.mk. See the definitions - of gnu_ftp_host-{alpha,beta,stable}. - - make release RELEASE='X.Y TYPE' - -* Test the tarball. Copy it to a few odd-ball systems and ensure that - it builds and passes all tests. - -* While that's happening, write the release announcement that you will - soon post. Start with the template, $HOME/announce-bison-X.Y - that was just created by that "make" command. - -Once all the builds and tests have passed, - -* Run the gnupload command that was suggested by your "make release" - run above, or run - - make upload RELEASE='X.Y TYPE' - -* Wait a few minutes (maybe up to 30?) and then use the release URLs to - download all tarball/signature pairs and use gpg --verify to ensure - that they're all valid. - -* Push the NEWS-updating changes and the new tag: - - v=$(cat .prev-version) - git push origin master tag v$v - -* Announce it on Savannah first, so you can include the savannah.org - announcement link in the email message. - - Go to the news-submission form: - - https://savannah.gnu.org/news/submit.php?group=bison - - If it does not work, then enable "News" for the project via this link: - - https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=bison - - Write something like the following: - - Subject: bison-X.Y released [stable] - +verbatim+ - ...paste the announcement here... - -verbatim- - - Then go here to approve it: - - https://savannah.gnu.org/news/approve.php?group=bison - -* Send the announcement email message. - -* After each non-alpha release, run - - make web-manual-update - - to update the on-line manual accessible at - - http://www.gnu.org/software/bison/manual/ diff --git a/THANKS b/THANKS index a2d3ea2..d964c10 100644 --- a/THANKS +++ b/THANKS @@ -1,7 +1,8 @@ Bison was originally written by Robert Corbett. It would not be what it is today without the invaluable help of these people: -Аскар Сафин safinaskar@mail.ru +Aaro Koskinen aaro.koskinen@iki.fi +Аскар Сафин safinaskar@mail.ru Airy Andre Airy.Andre@edf.fr Akim Demaille akim@lrde.epita.fr Albert Chin-A-Young china@thewrittenword.com @@ -11,11 +12,14 @@ Andreas Schwab schwab@suse.de Andrew Suffield asuffield@users.sourceforge.net Angelo Borsotti angelo.borsotti@gmail.com Anthony Heading ajrh@ajrh.net +Antonio Silva Correia amsilvacorreia@hotmail.com Arnold Robbins arnold@skeeve.com Art Haas ahaas@neosoft.com +Askar Safin safinaskar@mail.ru Baron Schwartz baron@sequent.org Ben Pfaff blp@cs.stanford.edu Benoit Perrot benoit.perrot@epita.fr +Bernd Edlinger bernd.edlinger@hotmail.de Bernd Kiefer kiefer@dfki.de Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be Bill Allombert Bill.Allombert@math.u-bordeaux1.fr @@ -25,25 +29,32 @@ Bruce Lilly blilly@erols.com Bruno Haible bruno@clisp.org Charles-Henri de Boysson de-boy_c@epita.fr Christian Burger cburger@sunysb.edu +Colin Daley colin.daley@outlook.com Cris Bailiff c.bailiff+bison@awayweb.com Cris van Pelt cris@amf03054.office.wxs.nl Csaba Raduly csaba_22@yahoo.co.uk Dagobert Michelsen dam@baltic-online.de +Daniel Frużyński daniel@poradnik-webmastera.com +Daniel Galloway dg1751@att.com Daniel Hagerty hag@gnu.org David J. MacKenzie djm@gnu.org David Kastrup dak@gnu.org Dennis Clarke dclarke@blastwave.org +Derek Clegg derek@me.com Derek M. Jones derek@knosof.co.uk Di-an Jan dianj@freeshell.org Dick Streefland dick.streefland@altium.nl Didier Godefroy dg@ulysium.net +Efi Fogel efifogel@gmail.com Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de Eric Blake ebb9@byu.net Evgeny Stambulchik fnevgeny@plasma-gate.weizmann.ac.il Fabrice Bauzac noon@cote-dazur.com +Ferdinand Thiessen ferdinand@fthiessen.de Florian Krohm florian@edamail.fishkill.ibm.com Frank Heckenbach frank@g-n-u.de Frans Englich frans.englich@telia.com +Gabriel Rassoul gabriel.rassoul@epita.fr Georg Sauthoff gsauthof@TechFak.Uni-Bielefeld.DE George Neuner gneuner2@comcast.net Gilles Espinasse g.esp@free.fr @@ -58,11 +69,13 @@ Jim Kent jkent@arch.sel.sony.com Jim Meyering jim@meyering.net Joel E. Denny joeldenny@joeldenny.org Johan van Selst johans@stack.nl +John Horigan john@glyphic.com Jonathan Fabrizio jonathan.fabrizio@lrde.epita.fr Jonathan Nieder jrnieder@gmail.com Juan Manuel Guerrero juan.guerrero@gmx.de Kees Zeelenberg kzlg@users.sourceforge.net Keith Browne kbrowne@legato.com +Ken Moffat zarniwhoop@ntlworld.com Laurent Mascherpa laurent.mascherpa@epita.fr Lie Yan lie.yan@kaust.edu.sa Magnus Fromreide magfr@lysator.liu.se @@ -74,12 +87,20 @@ Martin Mokrejs mmokrejs@natur.cuni.cz Martin Nylin martin.nylin@linuxmail.org Matt Kraai kraai@alumni.cmu.edu Matt Rosing rosing@peakfive.com +Michael Catanzaro mcatanzaro@gnome.org +Michael Felt mamfelt@gmail.com Michael Hayes m.hayes@elec.canterbury.ac.nz Michael Raskin 7c6f434c@mail.ru +Michel d'Hooge michel.dhooge@gmail.com +Michiel De Wilde mdewilde.agilent@gmail.com Mickael Labau labau_m@epita.fr Mike Castle dalgoda@ix.netcom.com +Mike Sullivan Mike.sullivan@Oracle.COM +Nate Guerin nathan.guerin@riseup.net Neil Booth NeilB@earthling.net Nelson H. F. Beebe beebe@math.utah.edu +Nick Bowler nbowler@elliptictech.com +Nicolas Bedon nicolas.bedon@univ-rouen.fr Nicolas Burrus nicolas.burrus@epita.fr Nicolas Tisserand nicolas.tisserand@epita.fr Noah Friedman friedman@gnu.org @@ -87,6 +108,7 @@ Odd Arild Olsen oao@fibula.no Oleg Smolsky oleg.smolsky@pacific-simulators.co.nz Oleksii Taran oleksii.taran@gmail.com Paolo Bonzini bonzini@gnu.org +Paolo Simone Gasparello djgaspa@gmail.com Pascal Bart pascal.bart@epita.fr Paul Eggert eggert@cs.ucla.edu Paul Hilfinger Hilfinger@CS.Berkeley.EDU @@ -95,33 +117,43 @@ Peter Eisentraut peter_e@gmx.net Peter Fales psfales@lucent.com Peter Hamorsky hamo@upjs.sk Peter Simons simons@cryp.to +Petr Machata pmachata@redhat.com +Pho pho@cielonegro.org Piotr Gackiewicz gacek@intertel.com.pl +Quentin Hocquet hocquet@gostai.com Quoc Peyrot chojin@lrde.epita.fr R Blake blakers@mac.com Raja R Harinath harinath@cs.umn.edu Ralf Wildenhues Ralf.Wildenhues@gmx.de +Rich Wilson richaw@gmail.com Richard Stallman rms@gnu.org +Rici Lake ricilake@gmail.com +Rob Conde rob.conde@ai-solutions.com Rob Vermaas rob.vermaas@gmail.com Robert Anisko anisko_r@epita.fr -Rob Conde rob.conde@ai-solutions.com +Roland Levillain roland@lrde.epita.fr Satya Kiran Popuri satyakiran@gmail.com Sebastian Setzer sebastian.setzer.ext@siemens.com Sebastien Fricker sebastien.fricker@gmail.com Sergei Steshenko sergstesh@yahoo.com Shura debil_urod@ngs.ru Stefano Lattarini stefano.lattarini@gmail.com +Stephen Cameron stephenmcameron@gmail.com Steve Murphy murf@parsetree.com Sum Wu sum@geekhouse.org Théophile Ranquet theophile.ranquet@gmail.com Thiru Ramakrishnan thiru.ramakrishnan@gmail.com +Thomas Jahns jahns@dkrz.de Tim Josling tej@melbpc.org.au Tim Landscheidt tim@tim-landscheidt.de Tim Van Holder tim.van.holder@pandora.be +Tobias Frost tobi@debian.org Tom Lane tgl@sss.pgh.pa.us Tom Tromey tromey@cygnus.com Tommy Nordgren tommy.nordgren@chello.se Troy A. Johnson troyj@ecn.purdue.edu Tys Lefering gccbison@gmail.com +Valentin Tolmer nitnelave1@gmail.com Victor Khomenko victor.khomenko@newcastle.ac.uk Vin Shelton acs@alumni.princeton.edu W.C.A. Wijngaards wouter@NLnetLabs.nl @@ -131,6 +163,7 @@ Wojciech Polak polak@gnu.org Wolfgang S. Kechel wolfgang.kechel@prs.de Wolfram Wagner ww@mpi-sb.mpg.de Wwp subscript@free.fr +xolodho xolodho@gmail.com Zack Weinberg zack@codesourcery.com Many people are not named here because we lost track of them. We @@ -143,7 +176,7 @@ End: ----- -Copyright (C) 2000-2013 Free Software Foundation, Inc. +Copyright (C) 2000-2015, 2018 Free Software Foundation, Inc. This file is part of Bison, the GNU Parser Generator. diff --git a/TODO b/TODO index 45307ce..c25df08 100644 --- a/TODO +++ b/TODO @@ -1,26 +1,63 @@ * Short term ** Graphviz display code thoughts The code for the --graph option is over two files: print_graph, and -graphviz. I believe this is because Bison used to also produce VCG graphs, -but since this is no longer true, maybe we could consider these files for -fusion. - -Little effort factoring seems to have been given to factoring in these files, -and their print-xml and print counterpart. We would very much like to re-use -the pretty format of states from .output in the .dot - -Also, the underscore in print_graph.[ch] isn't very fitting considering -the dashes in the other filenames. - -** Variable names. -What should we name `variant' and `lex_symbol'? - -** Use b4_symbol in all the skeleton -Move its definition in the more standard places and deploy it in other -skeletons. Then remove the older system, including the tables -generated by output.c - -** Update the documentation on gnu.org +graphviz. This is because Bison used to also produce VCG graphs, but since +this is no longer true, maybe we could consider these files for fusion. + +An other consideration worth noting is that print_graph.c (correct me if I +am wrong) should contain generic functions, whereas graphviz.c and other +potential files should contain just the specific code for that output +format. It will probably prove difficult to tell if the implementation is +actually generic whilst only having support for a single format, but it +would be nice to keep stuff a bit tidier: right now, the construction of the +bitset used to show reductions is in the graphviz-specific code, and on the +opposite side we have some use of \l, which is graphviz-specific, in what +should be generic code. + +Little effort seems to have been given to factoring these files and their +rint{,-xml} counterpart. We would very much like to re-use the pretty format +of states from .output for the graphs, etc. + +Also, the underscore in print_graph.[ch] isn't very fitting considering the +dashes in the other filenames. + +Since graphviz dies on medium-to-big grammars, maybe consider an other tool? + +** push-parser +Check it too when checking the different kinds of parsers. And be +sure to check that the initial-action is performed once per parsing. + +** m4 names +b4_shared_declarations is no longer what it is. Make it +b4_parser_declaration for instance. + +** yychar in lalr1.cc +There is a large difference bw maint and master on the handling of +yychar (which was removed in lalr1.cc). See what needs to be +back-ported. + + + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action + invokes YYABORT, YYACCEPT, or YYERROR immediately after altering + yychar. In the case of YYABORT or YYACCEPT, an incorrect + destructor might then be invoked immediately. In the case of + YYERROR, subsequent parser actions might lead to an incorrect + destructor call or verbose syntax error message before the + lookahead is translated. */ + + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yytranslate_ (yychar); + + +** stack.hh +Get rid of it. The original idea is nice, but actually it makes +the code harder to follow, and uselessly different from the other +skeletons. ** Get rid of fake #lines [Bison: ...] Possibly as simple as checking whether the column number is nonnegative. @@ -48,14 +85,7 @@ since it is no longer bound to a particular parser, it's just a ** Rename LR0.cc as lr0.cc, why upper case? -** bench several bisons. -Enhance bench.pl with %b to run different bisons. - * Various -** Warnings -Warnings about type tags that are used in printer and dtors, but not -for symbols? - ** YYERRCODE Defined to 256, but not used, not documented. Probably the token number for the error token, which POSIX wants to be 256, but which @@ -101,9 +131,6 @@ so both 256 and 257 are "mysterious". "\"end of command\"", "error", "$undefined", "\"=\"", "\"break\"", -** YYFAIL -It is seems to be *really* obsolete now, shall we remove it? - ** yychar == yyempty_ The code in yyerrlab reads: @@ -121,12 +148,6 @@ really possible? The test suite does not exercise this case. This shows that it would be interesting to manage to install skeleton coverage analysis to the test suite. -** Table definitions -It should be very easy to factor the definition of the various tables, -including the separation bw declaration and definition. See for -instance b4_table_define in lalr1.cc. This way, we could even factor -C vs. C++ definitions. - * From lalr1.cc to yacc.c ** Single stack Merging the three stacks in lalr1.cc simplified the code, prompted for @@ -155,13 +176,13 @@ part of $default. Should we make the two reductions explicit, or just keep $default? See the following point. ** Disabled Reductions -See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide +See 'tests/conflicts.at (Defaulted Conflicted Reduction)', and decide what we want to do. ** Documentation Extend with error productions. The hard part will probably be finding the right rule so that a single state does not exhibit too many yet -undocumented ``features''. Maybe an empty action ought to be +undocumented ''features''. Maybe an empty action ought to be presented too. Shall we try to make a single grammar with all these features, or should we have several very small grammars? @@ -222,9 +243,9 @@ into exp: exp '+' exp | exp '&' exp; when there are no actions. This can significantly speed up some -grammars. I can't find the papers. In particular the book `LR +grammars. I can't find the papers. In particular the book 'LR parsing: Theory and Practice' is impossible to find, but according to -`Parsing Techniques: a Practical Guide', it includes information about +'Parsing Techniques: a Practical Guide', it includes information about this issue. Does anybody have it? @@ -252,9 +273,6 @@ Paul notes: tokens, either via escapes (e.g., "x\0y") or via a NUL byte in the source code. This should get fixed. -* --graph -Show reductions. - * Broken options ? ** %token-table ** Skeleton strategy @@ -351,7 +369,8 @@ End: ----- -Copyright (C) 2001-2004, 2006, 2008-2013 Free Software Foundation, Inc. +Copyright (C) 2001-2004, 2006, 2008-2015, 2018 Free Software Foundation, +Inc. This file is part of Bison, the GNU Compiler Compiler. diff --git a/aclocal.m4 b/aclocal.m4 index 1566b0b..5549b02 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.1], [], +m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.1])dnl +[AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -103,15 +103,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -142,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -347,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -398,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -418,6 +407,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -490,11 +485,11 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -526,6 +521,51 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -534,7 +574,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -556,7 +595,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -567,7 +606,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -577,7 +616,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -598,7 +637,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -606,81 +645,42 @@ AC_SUBST([am__leading_dot])]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -719,7 +719,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -748,9 +748,73 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -831,7 +895,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -891,7 +955,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -919,7 +983,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -938,7 +1002,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -957,81 +1021,120 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of '-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/00gnulib.m4]) +m4_include([m4/absolute-header.m4]) m4_include([m4/alloca.m4]) m4_include([m4/asm-underscore.m4]) m4_include([m4/assert.m4]) @@ -1049,6 +1152,7 @@ m4_include([m4/dirname.m4]) m4_include([m4/dmalloc.m4]) m4_include([m4/double-slash-root.m4]) m4_include([m4/dup2.m4]) +m4_include([m4/eealloc.m4]) m4_include([m4/environ.m4]) m4_include([m4/errno_h.m4]) m4_include([m4/error.m4]) @@ -1071,14 +1175,15 @@ m4_include([m4/frexp.m4]) m4_include([m4/frexpl.m4]) m4_include([m4/fseterr.m4]) m4_include([m4/fstat.m4]) -m4_include([m4/getdelim.m4]) m4_include([m4/getdtablesize.m4]) -m4_include([m4/getline.m4]) m4_include([m4/getopt.m4]) +m4_include([m4/getprogname.m4]) m4_include([m4/gettext.m4]) m4_include([m4/glibc21.m4]) m4_include([m4/gnulib-common.m4]) m4_include([m4/gnulib-comp.m4]) +m4_include([m4/hard-locale.m4]) +m4_include([m4/host-cpu-c-abi.m4]) m4_include([m4/iconv.m4]) m4_include([m4/include_next.m4]) m4_include([m4/intlmacosx.m4]) @@ -1090,7 +1195,6 @@ m4_include([m4/isnan.m4]) m4_include([m4/isnand.m4]) m4_include([m4/isnanf.m4]) m4_include([m4/isnanl.m4]) -m4_include([m4/iswblank.m4]) m4_include([m4/javacomp.m4]) m4_include([m4/javaexec.m4]) m4_include([m4/largefile.m4]) @@ -1100,22 +1204,24 @@ m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/libunistring-base.m4]) +m4_include([m4/limits-h.m4]) m4_include([m4/localcharset.m4]) m4_include([m4/locale-fr.m4]) m4_include([m4/locale-ja.m4]) m4_include([m4/locale-zh.m4]) m4_include([m4/lock.m4]) m4_include([m4/longlong.m4]) +m4_include([m4/lstat.m4]) m4_include([m4/m4.m4]) m4_include([m4/malloc.m4]) +m4_include([m4/malloca.m4]) m4_include([m4/math_h.m4]) -m4_include([m4/mbchar.m4]) -m4_include([m4/mbiter.m4]) m4_include([m4/mbrtowc.m4]) m4_include([m4/mbsinit.m4]) m4_include([m4/mbstate_t.m4]) m4_include([m4/mbswidth.m4]) m4_include([m4/memchr.m4]) +m4_include([m4/minmax.m4]) m4_include([m4/mmap-anon.m4]) m4_include([m4/mode_t.m4]) m4_include([m4/msvc-inval.m4]) @@ -1123,8 +1229,11 @@ m4_include([m4/msvc-nothrow.m4]) m4_include([m4/multiarch.m4]) m4_include([m4/nls.m4]) m4_include([m4/nocrash.m4]) +m4_include([m4/non-recursive-gnulib-prefix-hack.m4]) m4_include([m4/obstack-printf.m4]) +m4_include([m4/obstack.m4]) m4_include([m4/off_t.m4]) +m4_include([m4/open-cloexec.m4]) m4_include([m4/open.m4]) m4_include([m4/pathmax.m4]) m4_include([m4/perror.m4]) @@ -1136,6 +1245,7 @@ m4_include([m4/printf-frexpl.m4]) m4_include([m4/printf-posix-rpl.m4]) m4_include([m4/printf.m4]) m4_include([m4/progtest.m4]) +m4_include([m4/pthread_rwlock_rdlock.m4]) m4_include([m4/quote.m4]) m4_include([m4/quotearg.m4]) m4_include([m4/raise.m4]) @@ -1155,6 +1265,7 @@ m4_include([m4/spawn-pipe.m4]) m4_include([m4/spawn_h.m4]) m4_include([m4/sprintf-posix.m4]) m4_include([m4/ssize_t.m4]) +m4_include([m4/stat-time.m4]) m4_include([m4/stat.m4]) m4_include([m4/stdbool.m4]) m4_include([m4/stddef_h.m4]) @@ -1170,7 +1281,6 @@ m4_include([m4/strerror_r.m4]) m4_include([m4/string_h.m4]) m4_include([m4/strndup.m4]) m4_include([m4/strnlen.m4]) -m4_include([m4/strtoul.m4]) m4_include([m4/strverscmp.m4]) m4_include([m4/sys_socket_h.m4]) m4_include([m4/sys_stat_h.m4]) @@ -1181,6 +1291,7 @@ m4_include([m4/time_h.m4]) m4_include([m4/timevar.m4]) m4_include([m4/unistd-safer.m4]) m4_include([m4/unistd_h.m4]) +m4_include([m4/unlink.m4]) m4_include([m4/unlocked-io.m4]) m4_include([m4/vasnprintf.m4]) m4_include([m4/vfprintf-posix.m4]) diff --git a/build-aux/darwin11.4.0.valgrind b/build-aux/Darwin.valgrind similarity index 95% rename from build-aux/darwin11.4.0.valgrind rename to build-aux/Darwin.valgrind index c5c3bd9..ba9b949 100644 --- a/build-aux/darwin11.4.0.valgrind +++ b/build-aux/Darwin.valgrind @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Free Software Foundation, Inc. +# Copyright (C) 2012-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/build-aux/Linux.valgrind b/build-aux/Linux.valgrind new file mode 100644 index 0000000..a40719f --- /dev/null +++ b/build-aux/Linux.valgrind @@ -0,0 +1,48 @@ +# Copyright (C) 2012-2015, 2018 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Valgrind suppression file for Bison. + +# Linux prague 4.1.2-2-ARCH #1 SMP PREEMPT Wed Jul 15 08:30:32 UTC 2015 +# x86_64 GNU/Linux +{ + Probably exception handling from G++ 5.1. + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + fun:pool + fun:__static_initialization_and_destruction_0 + fun:_GLOBAL__sub_I_eh_alloc.cc + fun:call_init.part.0 + fun:_dl_init + obj:/usr/lib/ld-2.21.so +} + +# Linux seattle 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012 +# x86_64 GNU/Linux +{ + index + Memcheck:Cond + fun:index + fun:expand_dynamic_string_token + fun:_dl_map_object + fun:map_doit + fun:_dl_catch_error + fun:do_preload + fun:dl_main + fun:_dl_sysdep_start + fun:_dl_start + obj:/lib/ld-2.11.3.so +} diff --git a/build-aux/Makefile.in b/build-aux/Makefile.in deleted file mode 100644 index 9c5fe94..0000000 --- a/build-aux/Makefile.in +++ /dev/null @@ -1,1532 +0,0 @@ -# Makefile.in generated by automake 1.13.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = build-aux -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am compile \ - config.guess config.rpath config.sub depcomp install-sh \ - mdate-sh missing texinfo.tex ylwrap -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ - $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/bison-i18n.m4 \ - $(top_srcdir)/m4/c-working.m4 $(top_srcdir)/m4/calloc.m4 \ - $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \ - $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ - $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \ - $(top_srcdir)/m4/cxx.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dmalloc.m4 \ - $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ - $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \ - $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ - $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/extern-inline.m4 \ - $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl-o.m4 \ - $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ - $(top_srcdir)/m4/flex.m4 $(top_srcdir)/m4/float_h.m4 \ - $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \ - $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \ - $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ - $(top_srcdir)/m4/fseterr.m4 $(top_srcdir)/m4/fstat.m4 \ - $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getdtablesize.m4 \ - $(top_srcdir)/m4/getline.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ - $(top_srcdir)/m4/gnulib-common.m4 \ - $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/include_next.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ - $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnan.m4 \ - $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \ - $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/iswblank.m4 \ - $(top_srcdir)/m4/javacomp.m4 $(top_srcdir)/m4/javaexec.m4 \ - $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/ldexp.m4 \ - $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libunistring-base.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ - $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ - $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/malloc.m4 \ - $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ - $(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \ - $(top_srcdir)/m4/msvc-inval.m4 \ - $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ - $(top_srcdir)/m4/obstack-printf.m4 $(top_srcdir)/m4/off_t.m4 \ - $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe2.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \ - $(top_srcdir)/m4/printf-frexp.m4 \ - $(top_srcdir)/m4/printf-frexpl.m4 \ - $(top_srcdir)/m4/printf-posix-rpl.m4 \ - $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ - $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ - $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/sched_h.m4 \ - $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ - $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ - $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ - $(top_srcdir)/m4/size_max.m4 \ - $(top_srcdir)/m4/snprintf-posix.m4 \ - $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/spawn-pipe.m4 \ - $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/sprintf-posix.m4 \ - $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \ - $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ - $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \ - $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \ - $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ - $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strverscmp.m4 \ - $(top_srcdir)/m4/sys_socket_h.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_types_h.m4 \ - $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/threadlib.m4 \ - $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/timevar.m4 \ - $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ - $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ - $(top_srcdir)/m4/vfprintf-posix.m4 \ - $(top_srcdir)/m4/vsnprintf-posix.m4 \ - $(top_srcdir)/m4/vsnprintf.m4 \ - $(top_srcdir)/m4/vsprintf-posix.m4 \ - $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \ - $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ - $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/lib/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -pkglibexecdir = @pkglibexecdir@ -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -ALLOCA_H = @ALLOCA_H@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ -AR = @AR@ -ARFLAGS = @ARFLAGS@ -ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOM4TE = @AUTOM4TE@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BISON_CXX_WORKS = @BISON_CXX_WORKS@ -BISON_C_WORKS = @BISON_C_WORKS@ -BISON_LOCALEDIR = @BISON_LOCALEDIR@ -BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ -BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ -BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ -BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ -BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CLASSPATH = @CLASSPATH@ -CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@ -CONFIG_INCLUDE = @CONFIG_INCLUDE@ -CONF_JAVA = @CONF_JAVA@ -CONF_JAVAC = @CONF_JAVAC@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CXX_COMPILER_POSIXLY_CORRECT = @CXX_COMPILER_POSIXLY_CORRECT@ -CYGPATH_W = @CYGPATH_W@ -C_COMPILER_POSIXLY_CORRECT = @C_COMPILER_POSIXLY_CORRECT@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOT = @DOT@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ -EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ -ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ -ENOLINK_VALUE = @ENOLINK_VALUE@ -EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ -EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ -ERRNO_H = @ERRNO_H@ -EXEEXT = @EXEEXT@ -FLOAT_H = @FLOAT_H@ -GCC = @GCC@ -GETOPT_H = @GETOPT_H@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GNULIB_ACOSF = @GNULIB_ACOSF@ -GNULIB_ACOSL = @GNULIB_ACOSL@ -GNULIB_ASINF = @GNULIB_ASINF@ -GNULIB_ASINL = @GNULIB_ASINL@ -GNULIB_ATAN2F = @GNULIB_ATAN2F@ -GNULIB_ATANF = @GNULIB_ATANF@ -GNULIB_ATANL = @GNULIB_ATANL@ -GNULIB_ATOLL = @GNULIB_ATOLL@ -GNULIB_BTOWC = @GNULIB_BTOWC@ -GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ -GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ -GNULIB_CBRT = @GNULIB_CBRT@ -GNULIB_CBRTF = @GNULIB_CBRTF@ -GNULIB_CBRTL = @GNULIB_CBRTL@ -GNULIB_CEIL = @GNULIB_CEIL@ -GNULIB_CEILF = @GNULIB_CEILF@ -GNULIB_CEILL = @GNULIB_CEILL@ -GNULIB_CHDIR = @GNULIB_CHDIR@ -GNULIB_CHOWN = @GNULIB_CHOWN@ -GNULIB_CLOSE = @GNULIB_CLOSE@ -GNULIB_COPYSIGN = @GNULIB_COPYSIGN@ -GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@ -GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@ -GNULIB_COSF = @GNULIB_COSF@ -GNULIB_COSHF = @GNULIB_COSHF@ -GNULIB_COSL = @GNULIB_COSL@ -GNULIB_DPRINTF = @GNULIB_DPRINTF@ -GNULIB_DUP = @GNULIB_DUP@ -GNULIB_DUP2 = @GNULIB_DUP2@ -GNULIB_DUP3 = @GNULIB_DUP3@ -GNULIB_ENVIRON = @GNULIB_ENVIRON@ -GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ -GNULIB_EXP2 = @GNULIB_EXP2@ -GNULIB_EXP2F = @GNULIB_EXP2F@ -GNULIB_EXP2L = @GNULIB_EXP2L@ -GNULIB_EXPF = @GNULIB_EXPF@ -GNULIB_EXPL = @GNULIB_EXPL@ -GNULIB_EXPM1 = @GNULIB_EXPM1@ -GNULIB_EXPM1F = @GNULIB_EXPM1F@ -GNULIB_EXPM1L = @GNULIB_EXPM1L@ -GNULIB_FABSF = @GNULIB_FABSF@ -GNULIB_FABSL = @GNULIB_FABSL@ -GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ -GNULIB_FCHDIR = @GNULIB_FCHDIR@ -GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ -GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ -GNULIB_FCLOSE = @GNULIB_FCLOSE@ -GNULIB_FCNTL = @GNULIB_FCNTL@ -GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ -GNULIB_FDOPEN = @GNULIB_FDOPEN@ -GNULIB_FFLUSH = @GNULIB_FFLUSH@ -GNULIB_FFSL = @GNULIB_FFSL@ -GNULIB_FFSLL = @GNULIB_FFSLL@ -GNULIB_FGETC = @GNULIB_FGETC@ -GNULIB_FGETS = @GNULIB_FGETS@ -GNULIB_FLOOR = @GNULIB_FLOOR@ -GNULIB_FLOORF = @GNULIB_FLOORF@ -GNULIB_FLOORL = @GNULIB_FLOORL@ -GNULIB_FMA = @GNULIB_FMA@ -GNULIB_FMAF = @GNULIB_FMAF@ -GNULIB_FMAL = @GNULIB_FMAL@ -GNULIB_FMOD = @GNULIB_FMOD@ -GNULIB_FMODF = @GNULIB_FMODF@ -GNULIB_FMODL = @GNULIB_FMODL@ -GNULIB_FOPEN = @GNULIB_FOPEN@ -GNULIB_FPRINTF = @GNULIB_FPRINTF@ -GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ -GNULIB_FPURGE = @GNULIB_FPURGE@ -GNULIB_FPUTC = @GNULIB_FPUTC@ -GNULIB_FPUTS = @GNULIB_FPUTS@ -GNULIB_FREAD = @GNULIB_FREAD@ -GNULIB_FREOPEN = @GNULIB_FREOPEN@ -GNULIB_FREXP = @GNULIB_FREXP@ -GNULIB_FREXPF = @GNULIB_FREXPF@ -GNULIB_FREXPL = @GNULIB_FREXPL@ -GNULIB_FSCANF = @GNULIB_FSCANF@ -GNULIB_FSEEK = @GNULIB_FSEEK@ -GNULIB_FSEEKO = @GNULIB_FSEEKO@ -GNULIB_FSTAT = @GNULIB_FSTAT@ -GNULIB_FSTATAT = @GNULIB_FSTATAT@ -GNULIB_FSYNC = @GNULIB_FSYNC@ -GNULIB_FTELL = @GNULIB_FTELL@ -GNULIB_FTELLO = @GNULIB_FTELLO@ -GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ -GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ -GNULIB_FWRITE = @GNULIB_FWRITE@ -GNULIB_GETC = @GNULIB_GETC@ -GNULIB_GETCHAR = @GNULIB_GETCHAR@ -GNULIB_GETCWD = @GNULIB_GETCWD@ -GNULIB_GETDELIM = @GNULIB_GETDELIM@ -GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ -GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ -GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ -GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ -GNULIB_GETLINE = @GNULIB_GETLINE@ -GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ -GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ -GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ -GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ -GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ -GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ -GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ -GNULIB_GRANTPT = @GNULIB_GRANTPT@ -GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ -GNULIB_HYPOT = @GNULIB_HYPOT@ -GNULIB_HYPOTF = @GNULIB_HYPOTF@ -GNULIB_HYPOTL = @GNULIB_HYPOTL@ -GNULIB_ILOGB = @GNULIB_ILOGB@ -GNULIB_ILOGBF = @GNULIB_ILOGBF@ -GNULIB_ILOGBL = @GNULIB_ILOGBL@ -GNULIB_IMAXABS = @GNULIB_IMAXABS@ -GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ -GNULIB_ISATTY = @GNULIB_ISATTY@ -GNULIB_ISFINITE = @GNULIB_ISFINITE@ -GNULIB_ISINF = @GNULIB_ISINF@ -GNULIB_ISNAN = @GNULIB_ISNAN@ -GNULIB_ISNAND = @GNULIB_ISNAND@ -GNULIB_ISNANF = @GNULIB_ISNANF@ -GNULIB_ISNANL = @GNULIB_ISNANL@ -GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ -GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ -GNULIB_LCHMOD = @GNULIB_LCHMOD@ -GNULIB_LCHOWN = @GNULIB_LCHOWN@ -GNULIB_LDEXPF = @GNULIB_LDEXPF@ -GNULIB_LDEXPL = @GNULIB_LDEXPL@ -GNULIB_LINK = @GNULIB_LINK@ -GNULIB_LINKAT = @GNULIB_LINKAT@ -GNULIB_LOG = @GNULIB_LOG@ -GNULIB_LOG10 = @GNULIB_LOG10@ -GNULIB_LOG10F = @GNULIB_LOG10F@ -GNULIB_LOG10L = @GNULIB_LOG10L@ -GNULIB_LOG1P = @GNULIB_LOG1P@ -GNULIB_LOG1PF = @GNULIB_LOG1PF@ -GNULIB_LOG1PL = @GNULIB_LOG1PL@ -GNULIB_LOG2 = @GNULIB_LOG2@ -GNULIB_LOG2F = @GNULIB_LOG2F@ -GNULIB_LOG2L = @GNULIB_LOG2L@ -GNULIB_LOGB = @GNULIB_LOGB@ -GNULIB_LOGBF = @GNULIB_LOGBF@ -GNULIB_LOGBL = @GNULIB_LOGBL@ -GNULIB_LOGF = @GNULIB_LOGF@ -GNULIB_LOGL = @GNULIB_LOGL@ -GNULIB_LSEEK = @GNULIB_LSEEK@ -GNULIB_LSTAT = @GNULIB_LSTAT@ -GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ -GNULIB_MBRLEN = @GNULIB_MBRLEN@ -GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ -GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ -GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ -GNULIB_MBSCHR = @GNULIB_MBSCHR@ -GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ -GNULIB_MBSINIT = @GNULIB_MBSINIT@ -GNULIB_MBSLEN = @GNULIB_MBSLEN@ -GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ -GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ -GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ -GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ -GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ -GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ -GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ -GNULIB_MBSSEP = @GNULIB_MBSSEP@ -GNULIB_MBSSPN = @GNULIB_MBSSPN@ -GNULIB_MBSSTR = @GNULIB_MBSSTR@ -GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ -GNULIB_MBTOWC = @GNULIB_MBTOWC@ -GNULIB_MEMCHR = @GNULIB_MEMCHR@ -GNULIB_MEMMEM = @GNULIB_MEMMEM@ -GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ -GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ -GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ -GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ -GNULIB_MKFIFO = @GNULIB_MKFIFO@ -GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ -GNULIB_MKNOD = @GNULIB_MKNOD@ -GNULIB_MKNODAT = @GNULIB_MKNODAT@ -GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ -GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ -GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ -GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ -GNULIB_MKTIME = @GNULIB_MKTIME@ -GNULIB_MODF = @GNULIB_MODF@ -GNULIB_MODFF = @GNULIB_MODFF@ -GNULIB_MODFL = @GNULIB_MODFL@ -GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ -GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ -GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ -GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ -GNULIB_OPEN = @GNULIB_OPEN@ -GNULIB_OPENAT = @GNULIB_OPENAT@ -GNULIB_PCLOSE = @GNULIB_PCLOSE@ -GNULIB_PERROR = @GNULIB_PERROR@ -GNULIB_PIPE = @GNULIB_PIPE@ -GNULIB_PIPE2 = @GNULIB_PIPE2@ -GNULIB_POPEN = @GNULIB_POPEN@ -GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ -GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ -GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ -GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ -GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ -GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ -GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ -GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ -GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ -GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ -GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ -GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ -GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ -GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ -GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ -GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ -GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ -GNULIB_POWF = @GNULIB_POWF@ -GNULIB_PREAD = @GNULIB_PREAD@ -GNULIB_PRINTF = @GNULIB_PRINTF@ -GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ -GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ -GNULIB_PTSNAME = @GNULIB_PTSNAME@ -GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ -GNULIB_PUTC = @GNULIB_PUTC@ -GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ -GNULIB_PUTENV = @GNULIB_PUTENV@ -GNULIB_PUTS = @GNULIB_PUTS@ -GNULIB_PWRITE = @GNULIB_PWRITE@ -GNULIB_RAISE = @GNULIB_RAISE@ -GNULIB_RANDOM = @GNULIB_RANDOM@ -GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ -GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ -GNULIB_READ = @GNULIB_READ@ -GNULIB_READLINK = @GNULIB_READLINK@ -GNULIB_READLINKAT = @GNULIB_READLINKAT@ -GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ -GNULIB_REALPATH = @GNULIB_REALPATH@ -GNULIB_REMAINDER = @GNULIB_REMAINDER@ -GNULIB_REMAINDERF = @GNULIB_REMAINDERF@ -GNULIB_REMAINDERL = @GNULIB_REMAINDERL@ -GNULIB_REMOVE = @GNULIB_REMOVE@ -GNULIB_RENAME = @GNULIB_RENAME@ -GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ -GNULIB_RINT = @GNULIB_RINT@ -GNULIB_RINTF = @GNULIB_RINTF@ -GNULIB_RINTL = @GNULIB_RINTL@ -GNULIB_RMDIR = @GNULIB_RMDIR@ -GNULIB_ROUND = @GNULIB_ROUND@ -GNULIB_ROUNDF = @GNULIB_ROUNDF@ -GNULIB_ROUNDL = @GNULIB_ROUNDL@ -GNULIB_RPMATCH = @GNULIB_RPMATCH@ -GNULIB_SCANF = @GNULIB_SCANF@ -GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ -GNULIB_SETENV = @GNULIB_SETENV@ -GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ -GNULIB_SIGACTION = @GNULIB_SIGACTION@ -GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ -GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ -GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ -GNULIB_SINF = @GNULIB_SINF@ -GNULIB_SINHF = @GNULIB_SINHF@ -GNULIB_SINL = @GNULIB_SINL@ -GNULIB_SLEEP = @GNULIB_SLEEP@ -GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ -GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ -GNULIB_SQRTF = @GNULIB_SQRTF@ -GNULIB_SQRTL = @GNULIB_SQRTL@ -GNULIB_STAT = @GNULIB_STAT@ -GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ -GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ -GNULIB_STPCPY = @GNULIB_STPCPY@ -GNULIB_STPNCPY = @GNULIB_STPNCPY@ -GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ -GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ -GNULIB_STRDUP = @GNULIB_STRDUP@ -GNULIB_STRERROR = @GNULIB_STRERROR@ -GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ -GNULIB_STRNCAT = @GNULIB_STRNCAT@ -GNULIB_STRNDUP = @GNULIB_STRNDUP@ -GNULIB_STRNLEN = @GNULIB_STRNLEN@ -GNULIB_STRPBRK = @GNULIB_STRPBRK@ -GNULIB_STRPTIME = @GNULIB_STRPTIME@ -GNULIB_STRSEP = @GNULIB_STRSEP@ -GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ -GNULIB_STRSTR = @GNULIB_STRSTR@ -GNULIB_STRTOD = @GNULIB_STRTOD@ -GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ -GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ -GNULIB_STRTOLL = @GNULIB_STRTOLL@ -GNULIB_STRTOULL = @GNULIB_STRTOULL@ -GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ -GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ -GNULIB_SYMLINK = @GNULIB_SYMLINK@ -GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ -GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ -GNULIB_TANF = @GNULIB_TANF@ -GNULIB_TANHF = @GNULIB_TANHF@ -GNULIB_TANL = @GNULIB_TANL@ -GNULIB_TIMEGM = @GNULIB_TIMEGM@ -GNULIB_TIME_R = @GNULIB_TIME_R@ -GNULIB_TMPFILE = @GNULIB_TMPFILE@ -GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ -GNULIB_TRUNC = @GNULIB_TRUNC@ -GNULIB_TRUNCF = @GNULIB_TRUNCF@ -GNULIB_TRUNCL = @GNULIB_TRUNCL@ -GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ -GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ -GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ -GNULIB_UNLINK = @GNULIB_UNLINK@ -GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ -GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ -GNULIB_UNSETENV = @GNULIB_UNSETENV@ -GNULIB_USLEEP = @GNULIB_USLEEP@ -GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ -GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ -GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ -GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ -GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ -GNULIB_VFSCANF = @GNULIB_VFSCANF@ -GNULIB_VPRINTF = @GNULIB_VPRINTF@ -GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ -GNULIB_VSCANF = @GNULIB_VSCANF@ -GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ -GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNULIB_WAITPID = @GNULIB_WAITPID@ -GNULIB_WCPCPY = @GNULIB_WCPCPY@ -GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ -GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ -GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ -GNULIB_WCSCAT = @GNULIB_WCSCAT@ -GNULIB_WCSCHR = @GNULIB_WCSCHR@ -GNULIB_WCSCMP = @GNULIB_WCSCMP@ -GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ -GNULIB_WCSCPY = @GNULIB_WCSCPY@ -GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ -GNULIB_WCSDUP = @GNULIB_WCSDUP@ -GNULIB_WCSLEN = @GNULIB_WCSLEN@ -GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ -GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ -GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ -GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ -GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ -GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ -GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ -GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ -GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ -GNULIB_WCSSPN = @GNULIB_WCSSPN@ -GNULIB_WCSSTR = @GNULIB_WCSSTR@ -GNULIB_WCSTOK = @GNULIB_WCSTOK@ -GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ -GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ -GNULIB_WCTOB = @GNULIB_WCTOB@ -GNULIB_WCTOMB = @GNULIB_WCTOMB@ -GNULIB_WCTRANS = @GNULIB_WCTRANS@ -GNULIB_WCTYPE = @GNULIB_WCTYPE@ -GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ -GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ -GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ -GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ -GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ -GNULIB_WMEMSET = @GNULIB_WMEMSET@ -GNULIB_WRITE = @GNULIB_WRITE@ -GNULIB__EXIT = @GNULIB__EXIT@ -GREP = @GREP@ -HAVE_ACOSF = @HAVE_ACOSF@ -HAVE_ACOSL = @HAVE_ACOSL@ -HAVE_ASINF = @HAVE_ASINF@ -HAVE_ASINL = @HAVE_ASINL@ -HAVE_ATAN2F = @HAVE_ATAN2F@ -HAVE_ATANF = @HAVE_ATANF@ -HAVE_ATANL = @HAVE_ATANL@ -HAVE_ATOLL = @HAVE_ATOLL@ -HAVE_BTOWC = @HAVE_BTOWC@ -HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ -HAVE_CBRT = @HAVE_CBRT@ -HAVE_CBRTF = @HAVE_CBRTF@ -HAVE_CBRTL = @HAVE_CBRTL@ -HAVE_CHOWN = @HAVE_CHOWN@ -HAVE_COPYSIGN = @HAVE_COPYSIGN@ -HAVE_COPYSIGNL = @HAVE_COPYSIGNL@ -HAVE_COSF = @HAVE_COSF@ -HAVE_COSHF = @HAVE_COSHF@ -HAVE_COSL = @HAVE_COSL@ -HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ -HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ -HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ -HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@ -HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@ -HAVE_DECL_CEILF = @HAVE_DECL_CEILF@ -HAVE_DECL_CEILL = @HAVE_DECL_CEILL@ -HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@ -HAVE_DECL_COSL = @HAVE_DECL_COSL@ -HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ -HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@ -HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@ -HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@ -HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ -HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@ -HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ -HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ -HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@ -HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@ -HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ -HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ -HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ -HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ -HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ -HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ -HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ -HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ -HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ -HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ -HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ -HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ -HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ -HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ -HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ -HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@ -HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@ -HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@ -HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@ -HAVE_DECL_LOGB = @HAVE_DECL_LOGB@ -HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ -HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ -HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ -HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ -HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@ -HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@ -HAVE_DECL_RINTF = @HAVE_DECL_RINTF@ -HAVE_DECL_ROUND = @HAVE_DECL_ROUND@ -HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@ -HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@ -HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ -HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ -HAVE_DECL_SINL = @HAVE_DECL_SINL@ -HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ -HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ -HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ -HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ -HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ -HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ -HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ -HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ -HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ -HAVE_DECL_TANL = @HAVE_DECL_TANL@ -HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ -HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ -HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ -HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ -HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ -HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ -HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ -HAVE_DPRINTF = @HAVE_DPRINTF@ -HAVE_DUP2 = @HAVE_DUP2@ -HAVE_DUP3 = @HAVE_DUP3@ -HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ -HAVE_EXPF = @HAVE_EXPF@ -HAVE_EXPL = @HAVE_EXPL@ -HAVE_EXPM1 = @HAVE_EXPM1@ -HAVE_EXPM1F = @HAVE_EXPM1F@ -HAVE_FABSF = @HAVE_FABSF@ -HAVE_FABSL = @HAVE_FABSL@ -HAVE_FACCESSAT = @HAVE_FACCESSAT@ -HAVE_FCHDIR = @HAVE_FCHDIR@ -HAVE_FCHMODAT = @HAVE_FCHMODAT@ -HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ -HAVE_FCNTL = @HAVE_FCNTL@ -HAVE_FDATASYNC = @HAVE_FDATASYNC@ -HAVE_FEATURES_H = @HAVE_FEATURES_H@ -HAVE_FFSL = @HAVE_FFSL@ -HAVE_FFSLL = @HAVE_FFSLL@ -HAVE_FMA = @HAVE_FMA@ -HAVE_FMAF = @HAVE_FMAF@ -HAVE_FMAL = @HAVE_FMAL@ -HAVE_FMODF = @HAVE_FMODF@ -HAVE_FMODL = @HAVE_FMODL@ -HAVE_FREXPF = @HAVE_FREXPF@ -HAVE_FSEEKO = @HAVE_FSEEKO@ -HAVE_FSTATAT = @HAVE_FSTATAT@ -HAVE_FSYNC = @HAVE_FSYNC@ -HAVE_FTELLO = @HAVE_FTELLO@ -HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ -HAVE_FUTIMENS = @HAVE_FUTIMENS@ -HAVE_GCJ_C = @HAVE_GCJ_C@ -HAVE_GCJ_IN_PATH = @HAVE_GCJ_IN_PATH@ -HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ -HAVE_GETGROUPS = @HAVE_GETGROUPS@ -HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ -HAVE_GETLOGIN = @HAVE_GETLOGIN@ -HAVE_GETOPT_H = @HAVE_GETOPT_H@ -HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ -HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ -HAVE_GIJ = @HAVE_GIJ@ -HAVE_GIJ_IN_PATH = @HAVE_GIJ_IN_PATH@ -HAVE_GRANTPT = @HAVE_GRANTPT@ -HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ -HAVE_HYPOTF = @HAVE_HYPOTF@ -HAVE_HYPOTL = @HAVE_HYPOTL@ -HAVE_ILOGB = @HAVE_ILOGB@ -HAVE_ILOGBF = @HAVE_ILOGBF@ -HAVE_ILOGBL = @HAVE_ILOGBL@ -HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_ISNAND = @HAVE_ISNAND@ -HAVE_ISNANF = @HAVE_ISNANF@ -HAVE_ISNANL = @HAVE_ISNANL@ -HAVE_ISWBLANK = @HAVE_ISWBLANK@ -HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ -HAVE_JAVA = @HAVE_JAVA@ -HAVE_JAVAC = @HAVE_JAVAC@ -HAVE_JAVAC_ENVVAR = @HAVE_JAVAC_ENVVAR@ -HAVE_JAVAC_IN_PATH = @HAVE_JAVAC_IN_PATH@ -HAVE_JAVA_ENVVAR = @HAVE_JAVA_ENVVAR@ -HAVE_JAVA_IN_PATH = @HAVE_JAVA_IN_PATH@ -HAVE_JIKES = @HAVE_JIKES@ -HAVE_JIKES_IN_PATH = @HAVE_JIKES_IN_PATH@ -HAVE_JRE = @HAVE_JRE@ -HAVE_JRE_IN_PATH = @HAVE_JRE_IN_PATH@ -HAVE_JVIEW = @HAVE_JVIEW@ -HAVE_JVIEW_IN_PATH = @HAVE_JVIEW_IN_PATH@ -HAVE_LCHMOD = @HAVE_LCHMOD@ -HAVE_LCHOWN = @HAVE_LCHOWN@ -HAVE_LDEXPF = @HAVE_LDEXPF@ -HAVE_LINK = @HAVE_LINK@ -HAVE_LINKAT = @HAVE_LINKAT@ -HAVE_LOG10F = @HAVE_LOG10F@ -HAVE_LOG10L = @HAVE_LOG10L@ -HAVE_LOG1P = @HAVE_LOG1P@ -HAVE_LOG1PF = @HAVE_LOG1PF@ -HAVE_LOG1PL = @HAVE_LOG1PL@ -HAVE_LOGBF = @HAVE_LOGBF@ -HAVE_LOGBL = @HAVE_LOGBL@ -HAVE_LOGF = @HAVE_LOGF@ -HAVE_LOGL = @HAVE_LOGL@ -HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ -HAVE_LSTAT = @HAVE_LSTAT@ -HAVE_MBRLEN = @HAVE_MBRLEN@ -HAVE_MBRTOWC = @HAVE_MBRTOWC@ -HAVE_MBSINIT = @HAVE_MBSINIT@ -HAVE_MBSLEN = @HAVE_MBSLEN@ -HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ -HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ -HAVE_MEMCHR = @HAVE_MEMCHR@ -HAVE_MEMPCPY = @HAVE_MEMPCPY@ -HAVE_MKDIRAT = @HAVE_MKDIRAT@ -HAVE_MKDTEMP = @HAVE_MKDTEMP@ -HAVE_MKFIFO = @HAVE_MKFIFO@ -HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ -HAVE_MKNOD = @HAVE_MKNOD@ -HAVE_MKNODAT = @HAVE_MKNODAT@ -HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ -HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ -HAVE_MKSTEMP = @HAVE_MKSTEMP@ -HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ -HAVE_MODFF = @HAVE_MODFF@ -HAVE_MODFL = @HAVE_MODFL@ -HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ -HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ -HAVE_OPENAT = @HAVE_OPENAT@ -HAVE_OS_H = @HAVE_OS_H@ -HAVE_PCLOSE = @HAVE_PCLOSE@ -HAVE_PIPE = @HAVE_PIPE@ -HAVE_PIPE2 = @HAVE_PIPE2@ -HAVE_POPEN = @HAVE_POPEN@ -HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ -HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ -HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ -HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@ -HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ -HAVE_POWF = @HAVE_POWF@ -HAVE_PREAD = @HAVE_PREAD@ -HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ -HAVE_PTSNAME = @HAVE_PTSNAME@ -HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ -HAVE_PWRITE = @HAVE_PWRITE@ -HAVE_RAISE = @HAVE_RAISE@ -HAVE_RANDOM = @HAVE_RANDOM@ -HAVE_RANDOM_H = @HAVE_RANDOM_H@ -HAVE_RANDOM_R = @HAVE_RANDOM_R@ -HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ -HAVE_READLINK = @HAVE_READLINK@ -HAVE_READLINKAT = @HAVE_READLINKAT@ -HAVE_REALPATH = @HAVE_REALPATH@ -HAVE_REMAINDER = @HAVE_REMAINDER@ -HAVE_REMAINDERF = @HAVE_REMAINDERF@ -HAVE_RENAMEAT = @HAVE_RENAMEAT@ -HAVE_RINT = @HAVE_RINT@ -HAVE_RINTL = @HAVE_RINTL@ -HAVE_RPMATCH = @HAVE_RPMATCH@ -HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@ -HAVE_SCHED_H = @HAVE_SCHED_H@ -HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ -HAVE_SETENV = @HAVE_SETENV@ -HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ -HAVE_SIGACTION = @HAVE_SIGACTION@ -HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ -HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ -HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ -HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ -HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ -HAVE_SIGSET_T = @HAVE_SIGSET_T@ -HAVE_SINF = @HAVE_SINF@ -HAVE_SINHF = @HAVE_SINHF@ -HAVE_SINL = @HAVE_SINL@ -HAVE_SLEEP = @HAVE_SLEEP@ -HAVE_SPAWN_H = @HAVE_SPAWN_H@ -HAVE_SQRTF = @HAVE_SQRTF@ -HAVE_SQRTL = @HAVE_SQRTL@ -HAVE_STDINT_H = @HAVE_STDINT_H@ -HAVE_STPCPY = @HAVE_STPCPY@ -HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASESTR = @HAVE_STRCASESTR@ -HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ -HAVE_STRPBRK = @HAVE_STRPBRK@ -HAVE_STRPTIME = @HAVE_STRPTIME@ -HAVE_STRSEP = @HAVE_STRSEP@ -HAVE_STRTOD = @HAVE_STRTOD@ -HAVE_STRTOLL = @HAVE_STRTOLL@ -HAVE_STRTOULL = @HAVE_STRTOULL@ -HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ -HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ -HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ -HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ -HAVE_SYMLINK = @HAVE_SYMLINK@ -HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ -HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ -HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ -HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ -HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ -HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_TANF = @HAVE_TANF@ -HAVE_TANHF = @HAVE_TANHF@ -HAVE_TANL = @HAVE_TANL@ -HAVE_TIMEGM = @HAVE_TIMEGM@ -HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ -HAVE_UNISTD_H = @HAVE_UNISTD_H@ -HAVE_UNLINKAT = @HAVE_UNLINKAT@ -HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ -HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_USLEEP = @HAVE_USLEEP@ -HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ -HAVE_VASPRINTF = @HAVE_VASPRINTF@ -HAVE_VDPRINTF = @HAVE_VDPRINTF@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ -HAVE_WCHAR_T = @HAVE_WCHAR_T@ -HAVE_WCPCPY = @HAVE_WCPCPY@ -HAVE_WCPNCPY = @HAVE_WCPNCPY@ -HAVE_WCRTOMB = @HAVE_WCRTOMB@ -HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ -HAVE_WCSCAT = @HAVE_WCSCAT@ -HAVE_WCSCHR = @HAVE_WCSCHR@ -HAVE_WCSCMP = @HAVE_WCSCMP@ -HAVE_WCSCOLL = @HAVE_WCSCOLL@ -HAVE_WCSCPY = @HAVE_WCSCPY@ -HAVE_WCSCSPN = @HAVE_WCSCSPN@ -HAVE_WCSDUP = @HAVE_WCSDUP@ -HAVE_WCSLEN = @HAVE_WCSLEN@ -HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ -HAVE_WCSNCAT = @HAVE_WCSNCAT@ -HAVE_WCSNCMP = @HAVE_WCSNCMP@ -HAVE_WCSNCPY = @HAVE_WCSNCPY@ -HAVE_WCSNLEN = @HAVE_WCSNLEN@ -HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ -HAVE_WCSPBRK = @HAVE_WCSPBRK@ -HAVE_WCSRCHR = @HAVE_WCSRCHR@ -HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ -HAVE_WCSSPN = @HAVE_WCSSPN@ -HAVE_WCSSTR = @HAVE_WCSSTR@ -HAVE_WCSTOK = @HAVE_WCSTOK@ -HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ -HAVE_WCSXFRM = @HAVE_WCSXFRM@ -HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ -HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ -HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ -HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ -HAVE_WINT_T = @HAVE_WINT_T@ -HAVE_WMEMCHR = @HAVE_WMEMCHR@ -HAVE_WMEMCMP = @HAVE_WMEMCMP@ -HAVE_WMEMCPY = @HAVE_WMEMCPY@ -HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ -HAVE_WMEMSET = @HAVE_WMEMSET@ -HAVE__BOOL = @HAVE__BOOL@ -HAVE__EXIT = @HAVE__EXIT@ -HELP2MAN = @HELP2MAN@ -INCLUDE_NEXT = @INCLUDE_NEXT@ -INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ -INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -ISNAND_LIBM = @ISNAND_LIBM@ -ISNANF_LIBM = @ISNANF_LIBM@ -ISNANL_LIBM = @ISNANL_LIBM@ -ISNAN_LIBM = @ISNAN_LIBM@ -LDEXPL_LIBM = @LDEXPL_LIBM@ -LDEXP_LIBM = @LDEXP_LIBM@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_IS_FLEX = @LEX_IS_FLEX@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBBISON_LIBDEPS = @LIBBISON_LIBDEPS@ -LIBBISON_LTLIBDEPS = @LIBBISON_LTLIBDEPS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBMULTITHREAD = @LIBMULTITHREAD@ -LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ -LIBS = @LIBS@ -LIBTHREAD = @LIBTHREAD@ -LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ -LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ -LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ -LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ -LOCALE_JA = @LOCALE_JA@ -LOCALE_ZH_CN = @LOCALE_ZH_CN@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ -LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ -LTLIBTHREAD = @LTLIBTHREAD@ -M4 = @M4@ -M4_DEBUGFILE = @M4_DEBUGFILE@ -M4_GNU = @M4_GNU@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ -NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ -NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ -NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ -NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ -NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ -NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@ -NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ -NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@ -NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ -NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ -NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ -NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ -NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ -NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ -NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ -NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ -NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ -NEXT_ERRNO_H = @NEXT_ERRNO_H@ -NEXT_FCNTL_H = @NEXT_FCNTL_H@ -NEXT_FLOAT_H = @NEXT_FLOAT_H@ -NEXT_GETOPT_H = @NEXT_GETOPT_H@ -NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ -NEXT_MATH_H = @NEXT_MATH_H@ -NEXT_SCHED_H = @NEXT_SCHED_H@ -NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ -NEXT_SPAWN_H = @NEXT_SPAWN_H@ -NEXT_STDDEF_H = @NEXT_STDDEF_H@ -NEXT_STDINT_H = @NEXT_STDINT_H@ -NEXT_STDIO_H = @NEXT_STDIO_H@ -NEXT_STDLIB_H = @NEXT_STDLIB_H@ -NEXT_STRING_H = @NEXT_STRING_H@ -NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ -NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ -NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ -NEXT_TIME_H = @NEXT_TIME_H@ -NEXT_UNISTD_H = @NEXT_UNISTD_H@ -NEXT_WCHAR_H = @NEXT_WCHAR_H@ -NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ -NO_STRICT_ALIAS_CXXFLAGS = @NO_STRICT_ALIAS_CXXFLAGS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_COPYRIGHT_YEAR = @PACKAGE_COPYRIGHT_YEAR@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -POSUB = @POSUB@ -PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ -PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ -PRIPTR_PREFIX = @PRIPTR_PREFIX@ -PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ -PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ -PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ -RANLIB = @RANLIB@ -REPLACE_BTOWC = @REPLACE_BTOWC@ -REPLACE_CALLOC = @REPLACE_CALLOC@ -REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ -REPLACE_CBRTF = @REPLACE_CBRTF@ -REPLACE_CBRTL = @REPLACE_CBRTL@ -REPLACE_CEIL = @REPLACE_CEIL@ -REPLACE_CEILF = @REPLACE_CEILF@ -REPLACE_CEILL = @REPLACE_CEILL@ -REPLACE_CHOWN = @REPLACE_CHOWN@ -REPLACE_CLOSE = @REPLACE_CLOSE@ -REPLACE_DPRINTF = @REPLACE_DPRINTF@ -REPLACE_DUP = @REPLACE_DUP@ -REPLACE_DUP2 = @REPLACE_DUP2@ -REPLACE_EXP2 = @REPLACE_EXP2@ -REPLACE_EXP2L = @REPLACE_EXP2L@ -REPLACE_EXPM1 = @REPLACE_EXPM1@ -REPLACE_EXPM1F = @REPLACE_EXPM1F@ -REPLACE_FABSL = @REPLACE_FABSL@ -REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ -REPLACE_FCLOSE = @REPLACE_FCLOSE@ -REPLACE_FCNTL = @REPLACE_FCNTL@ -REPLACE_FDOPEN = @REPLACE_FDOPEN@ -REPLACE_FFLUSH = @REPLACE_FFLUSH@ -REPLACE_FLOOR = @REPLACE_FLOOR@ -REPLACE_FLOORF = @REPLACE_FLOORF@ -REPLACE_FLOORL = @REPLACE_FLOORL@ -REPLACE_FMA = @REPLACE_FMA@ -REPLACE_FMAF = @REPLACE_FMAF@ -REPLACE_FMAL = @REPLACE_FMAL@ -REPLACE_FMOD = @REPLACE_FMOD@ -REPLACE_FMODF = @REPLACE_FMODF@ -REPLACE_FMODL = @REPLACE_FMODL@ -REPLACE_FOPEN = @REPLACE_FOPEN@ -REPLACE_FPRINTF = @REPLACE_FPRINTF@ -REPLACE_FPURGE = @REPLACE_FPURGE@ -REPLACE_FREOPEN = @REPLACE_FREOPEN@ -REPLACE_FREXP = @REPLACE_FREXP@ -REPLACE_FREXPF = @REPLACE_FREXPF@ -REPLACE_FREXPL = @REPLACE_FREXPL@ -REPLACE_FSEEK = @REPLACE_FSEEK@ -REPLACE_FSEEKO = @REPLACE_FSEEKO@ -REPLACE_FSTAT = @REPLACE_FSTAT@ -REPLACE_FSTATAT = @REPLACE_FSTATAT@ -REPLACE_FTELL = @REPLACE_FTELL@ -REPLACE_FTELLO = @REPLACE_FTELLO@ -REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ -REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ -REPLACE_GETCWD = @REPLACE_GETCWD@ -REPLACE_GETDELIM = @REPLACE_GETDELIM@ -REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ -REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ -REPLACE_GETLINE = @REPLACE_GETLINE@ -REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ -REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ -REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ -REPLACE_HYPOT = @REPLACE_HYPOT@ -REPLACE_HYPOTF = @REPLACE_HYPOTF@ -REPLACE_HYPOTL = @REPLACE_HYPOTL@ -REPLACE_ILOGB = @REPLACE_ILOGB@ -REPLACE_ILOGBF = @REPLACE_ILOGBF@ -REPLACE_ISATTY = @REPLACE_ISATTY@ -REPLACE_ISFINITE = @REPLACE_ISFINITE@ -REPLACE_ISINF = @REPLACE_ISINF@ -REPLACE_ISNAN = @REPLACE_ISNAN@ -REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ -REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ -REPLACE_ITOLD = @REPLACE_ITOLD@ -REPLACE_LCHOWN = @REPLACE_LCHOWN@ -REPLACE_LDEXPL = @REPLACE_LDEXPL@ -REPLACE_LINK = @REPLACE_LINK@ -REPLACE_LINKAT = @REPLACE_LINKAT@ -REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ -REPLACE_LOG = @REPLACE_LOG@ -REPLACE_LOG10 = @REPLACE_LOG10@ -REPLACE_LOG10F = @REPLACE_LOG10F@ -REPLACE_LOG10L = @REPLACE_LOG10L@ -REPLACE_LOG1P = @REPLACE_LOG1P@ -REPLACE_LOG1PF = @REPLACE_LOG1PF@ -REPLACE_LOG1PL = @REPLACE_LOG1PL@ -REPLACE_LOG2 = @REPLACE_LOG2@ -REPLACE_LOG2F = @REPLACE_LOG2F@ -REPLACE_LOG2L = @REPLACE_LOG2L@ -REPLACE_LOGB = @REPLACE_LOGB@ -REPLACE_LOGBF = @REPLACE_LOGBF@ -REPLACE_LOGBL = @REPLACE_LOGBL@ -REPLACE_LOGF = @REPLACE_LOGF@ -REPLACE_LOGL = @REPLACE_LOGL@ -REPLACE_LSEEK = @REPLACE_LSEEK@ -REPLACE_LSTAT = @REPLACE_LSTAT@ -REPLACE_MALLOC = @REPLACE_MALLOC@ -REPLACE_MBRLEN = @REPLACE_MBRLEN@ -REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ -REPLACE_MBSINIT = @REPLACE_MBSINIT@ -REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ -REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ -REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ -REPLACE_MBTOWC = @REPLACE_MBTOWC@ -REPLACE_MEMCHR = @REPLACE_MEMCHR@ -REPLACE_MEMMEM = @REPLACE_MEMMEM@ -REPLACE_MKDIR = @REPLACE_MKDIR@ -REPLACE_MKFIFO = @REPLACE_MKFIFO@ -REPLACE_MKNOD = @REPLACE_MKNOD@ -REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ -REPLACE_MKTIME = @REPLACE_MKTIME@ -REPLACE_MODF = @REPLACE_MODF@ -REPLACE_MODFF = @REPLACE_MODFF@ -REPLACE_MODFL = @REPLACE_MODFL@ -REPLACE_NAN = @REPLACE_NAN@ -REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ -REPLACE_NULL = @REPLACE_NULL@ -REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ -REPLACE_OPEN = @REPLACE_OPEN@ -REPLACE_OPENAT = @REPLACE_OPENAT@ -REPLACE_PERROR = @REPLACE_PERROR@ -REPLACE_POPEN = @REPLACE_POPEN@ -REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ -REPLACE_PREAD = @REPLACE_PREAD@ -REPLACE_PRINTF = @REPLACE_PRINTF@ -REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ -REPLACE_PTSNAME = @REPLACE_PTSNAME@ -REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ -REPLACE_PUTENV = @REPLACE_PUTENV@ -REPLACE_PWRITE = @REPLACE_PWRITE@ -REPLACE_RAISE = @REPLACE_RAISE@ -REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ -REPLACE_READ = @REPLACE_READ@ -REPLACE_READLINK = @REPLACE_READLINK@ -REPLACE_REALLOC = @REPLACE_REALLOC@ -REPLACE_REALPATH = @REPLACE_REALPATH@ -REPLACE_REMAINDER = @REPLACE_REMAINDER@ -REPLACE_REMAINDERF = @REPLACE_REMAINDERF@ -REPLACE_REMAINDERL = @REPLACE_REMAINDERL@ -REPLACE_REMOVE = @REPLACE_REMOVE@ -REPLACE_RENAME = @REPLACE_RENAME@ -REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ -REPLACE_RMDIR = @REPLACE_RMDIR@ -REPLACE_ROUND = @REPLACE_ROUND@ -REPLACE_ROUNDF = @REPLACE_ROUNDF@ -REPLACE_ROUNDL = @REPLACE_ROUNDL@ -REPLACE_SETENV = @REPLACE_SETENV@ -REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ -REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ -REPLACE_SLEEP = @REPLACE_SLEEP@ -REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ -REPLACE_SPRINTF = @REPLACE_SPRINTF@ -REPLACE_SQRTL = @REPLACE_SQRTL@ -REPLACE_STAT = @REPLACE_STAT@ -REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ -REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ -REPLACE_STPNCPY = @REPLACE_STPNCPY@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ -REPLACE_STRDUP = @REPLACE_STRDUP@ -REPLACE_STRERROR = @REPLACE_STRERROR@ -REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ -REPLACE_STRNCAT = @REPLACE_STRNCAT@ -REPLACE_STRNDUP = @REPLACE_STRNDUP@ -REPLACE_STRNLEN = @REPLACE_STRNLEN@ -REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ -REPLACE_STRSTR = @REPLACE_STRSTR@ -REPLACE_STRTOD = @REPLACE_STRTOD@ -REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ -REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ -REPLACE_SYMLINK = @REPLACE_SYMLINK@ -REPLACE_TIMEGM = @REPLACE_TIMEGM@ -REPLACE_TMPFILE = @REPLACE_TMPFILE@ -REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ -REPLACE_TRUNC = @REPLACE_TRUNC@ -REPLACE_TRUNCF = @REPLACE_TRUNCF@ -REPLACE_TRUNCL = @REPLACE_TRUNCL@ -REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ -REPLACE_UNLINK = @REPLACE_UNLINK@ -REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ -REPLACE_UNSETENV = @REPLACE_UNSETENV@ -REPLACE_USLEEP = @REPLACE_USLEEP@ -REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ -REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ -REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ -REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ -REPLACE_VPRINTF = @REPLACE_VPRINTF@ -REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ -REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ -REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ -REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ -REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ -REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ -REPLACE_WCTOB = @REPLACE_WCTOB@ -REPLACE_WCTOMB = @REPLACE_WCTOMB@ -REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ -REPLACE_WRITE = @REPLACE_WRITE@ -SCHED_H = @SCHED_H@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ -SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ -STDBOOL_H = @STDBOOL_H@ -STDDEF_H = @STDDEF_H@ -STDINT_H = @STDINT_H@ -STRIP = @STRIP@ -SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ -TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ -UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ -UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ -UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ -UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ -UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ -USE_NLS = @USE_NLS@ -VALGRIND = @VALGRIND@ -VALGRIND_PREBISON = @VALGRIND_PREBISON@ -VERSION = @VERSION@ -WARN_CFLAGS = @WARN_CFLAGS@ -WARN_CFLAGS_TEST = @WARN_CFLAGS_TEST@ -WARN_CXXFLAGS = @WARN_CXXFLAGS@ -WARN_CXXFLAGS_TEST = @WARN_CXXFLAGS_TEST@ -WARN_NO_NULL_CONVERSION_CXXFLAGS = @WARN_NO_NULL_CONVERSION_CXXFLAGS@ -WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ -WERROR_CXXFLAGS = @WERROR_CXXFLAGS@ -WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ -WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ -WINT_T_SUFFIX = @WINT_T_SUFFIX@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -XSLTPROC = @XSLTPROC@ -YACC = @YACC@ -YACC_LIBRARY = @YACC_LIBRARY@ -YACC_SCRIPT = @YACC_SCRIPT@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -aclocaldir = @aclocaldir@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gl_LIBOBJS = @gl_LIBOBJS@ -gl_LTLIBOBJS = @gl_LTLIBOBJS@ -gltests_LIBOBJS = @gltests_LIBOBJS@ -gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ -gltests_WITNESS = @gltests_WITNESS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -lispdir = @lispdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -EXTRA_DIST = \ - cross-options.pl \ - darwin11.4.0.valgrind \ - prev-version.txt \ - update-b4-copyright - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu build-aux/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu build-aux/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ - ctags-am distclean distclean-generic distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags-am uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/build-aux/announce-gen b/build-aux/announce-gen index 3a64ec6..eeb9071 100755 --- a/build-aux/announce-gen +++ b/build-aux/announce-gen @@ -1,15 +1,15 @@ -eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' +eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' & eval 'exec perl -wS "$0" $argv:q' if 0; # Generate a release announcement message. -my $VERSION = '2012-06-08 06:53'; # UTC +my $VERSION = '2018-03-07 03:46'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,22 +22,25 @@ my $VERSION = '2012-06-08 06:53'; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # Written by Jim Meyering use strict; use Getopt::Long; -use Digest::MD5; -eval { require Digest::SHA; } - or eval 'use Digest::SHA1'; use POSIX qw(strftime); (my $ME = $0) =~ s|.*/||; my %valid_release_types = map {$_ => 1} qw (alpha beta stable); my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz'); +my %digest_classes = + ( + 'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'), + 'sha1' => ((eval { require Digest::SHA; } and 'Digest::SHA') + or (eval { require Digest::SHA1; } and 'Digest::SHA1')) + ); my $srcdir = '.'; sub usage ($) @@ -157,15 +160,13 @@ sub print_checksums (@) foreach my $meth (qw (md5 sha1)) { + my $class = $digest_classes{$meth} or next; foreach my $f (@file) { open IN, '<', $f or die "$ME: $f: cannot open for reading: $!\n"; binmode IN; - my $dig = - ($meth eq 'md5' - ? Digest::MD5->new->addfile(*IN)->hexdigest - : Digest::SHA1->new->addfile(*IN)->hexdigest); + my $dig = $class->new->addfile(*IN)->hexdigest; close IN; print "$dig $f\n"; } @@ -416,14 +417,15 @@ sub get_tool_versions ($$) @url_dir_list or (warn "URL directory name(s) not specified\n"), $fail = 1; - my @tool_list = split ',', $bootstrap_tools; + my @tool_list = split ',', $bootstrap_tools + if $bootstrap_tools; grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version and (warn "when specifying gnulib as a tool, you must also specify\n" . "--gnulib-version=V, where V is the result of running git describe\n" . "in the gnulib source directory.\n"), $fail = 1; - exists $valid_release_types{$release_type} + !$release_type || exists $valid_release_types{$release_type} or (warn "'$release_type': invalid release type\n"), $fail = 1; @ARGV @@ -490,17 +492,17 @@ EOF if ($url_dir_list[0] =~ "gnu\.org") { print "Use a mirror for higher download bandwidth:\n"; - if (@tarballs == 1 && $url_dir_list[0] =~ m!http://ftp\.gnu\.org/gnu/!) + if (@tarballs == 1 && $url_dir_list[0] =~ m!https://ftp\.gnu\.org/gnu/!) { (my $m = "$url_dir_list[0]/$tarballs[0]") - =~ s!http://ftp\.gnu\.org/gnu/!http://ftpmirror\.gnu\.org/!; + =~ s!https://ftp\.gnu\.org/gnu/!https://ftpmirror\.gnu\.org/!; print " $m\n" . " $m.sig\n\n"; } else { - print " http://www.gnu.org/order/ftp.html\n\n"; + print " https://www.gnu.org/order/ftp.html\n\n"; } } @@ -547,9 +549,9 @@ EOF ## perl-label-offset: -2 ## perl-extra-newline-before-brace: t ## perl-merge-trailing-else: nil -## eval: (add-hook 'write-file-hooks 'time-stamp) +## eval: (add-hook 'before-save-hook 'time-stamp) ## time-stamp-start: "my $VERSION = '" ## time-stamp-format: "%:y-%02m-%02d %02H:%02M" -## time-stamp-time-zone: "UTC" +## time-stamp-time-zone: "UTC0" ## time-stamp-end: "'; # UTC" ## End: diff --git a/build-aux/compile b/build-aux/compile index 531136b..99e5052 100755 --- a/build-aux/compile +++ b/build-aux/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/config.guess b/build-aux/config.guess index f475ceb..256083a 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2013-02-12' +timestamp='2018-03-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2013-02-12' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -24,12 +24,12 @@ timestamp='2013-02-12' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -107,9 +107,9 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; + ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -132,9 +132,37 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -147,21 +175,31 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -176,44 +214,67 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -230,63 +291,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -298,7 +350,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -325,38 +377,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + eval "$set_cc_for_build" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -365,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -394,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -440,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -482,17 +534,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -509,7 +561,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -521,14 +573,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -539,7 +591,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -553,26 +605,27 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -587,28 +640,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -641,13 +694,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -658,23 +711,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -699,11 +752,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -712,7 +765,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -720,9 +773,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -747,127 +800,109 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -880,63 +915,64 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -950,58 +986,70 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" exit ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1015,34 +1063,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1052,12 +1100,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1067,9 +1115,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1077,7 +1125,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1089,9 +1137,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1111,9 +1159,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1122,28 +1170,28 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1154,7 +1202,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1174,23 +1222,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1209,65 +1257,93 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + eval "$set_cc_for_build" + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1276,18 +1352,18 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1308,14 +1384,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1324,182 +1400,48 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); +echo "$0: unable to guess system type" >&2 - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 < -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize +the system type. Please install a C compiler and try again. EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi + ;; +esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1518,16 +1460,16 @@ hostinfo = `(hostinfo) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/build-aux/config.rpath b/build-aux/config.rpath index c38b914..fc5913d 100755 --- a/build-aux/config.rpath +++ b/build-aux/config.rpath @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2013 Free Software Foundation, Inc. +# Copyright 1996-2018 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # @@ -367,11 +367,7 @@ else dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; - freebsd2.2*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - freebsd2*) + freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; @@ -548,13 +544,11 @@ case "$host_os" in dgux*) library_names_spec='$libname$shrext' ;; + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' + ;; freebsd* | dragonfly*) - case "$host_os" in - freebsd[123]*) - library_names_spec='$libname$shrext$versuffix' ;; - *) - library_names_spec='$libname$shrext' ;; - esac + library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' diff --git a/build-aux/config.sub b/build-aux/config.sub index 872199a..20f7cf2 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2013-02-12' +timestamp='2018-05-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2013-02-12' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -25,7 +25,7 @@ timestamp='2013-02-12' # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -33,7 +33,7 @@ timestamp='2013-02-12' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,12 +53,11 @@ timestamp='2013-02-12' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -68,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -95,7 +94,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -111,28 +110,48 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; +# Spilt fields of configuration type +IFS="-" read -r field1 field2 field3 field4 <&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. @@ -366,21 +396,23 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -400,8 +432,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -410,19 +444,23 @@ case $basic_machine in | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ + | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -430,6 +468,8 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -443,7 +483,7 @@ case $basic_machine in # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) - basic_machine=i386-unknown + basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) @@ -477,7 +517,7 @@ case $basic_machine in basic_machine=x86_64-pc ;; amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl @@ -506,6 +546,9 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -519,7 +562,7 @@ case $basic_machine in os=-linux ;; blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) @@ -527,13 +570,13 @@ case $basic_machine in os=-cnk ;; c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray @@ -622,10 +665,18 @@ case $basic_machine in basic_machine=rs6000-bull os=-bosx ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -715,9 +766,6 @@ case $basic_machine in hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; - hppa-next) - os=-nextstep3 - ;; hppaosf) basic_machine=hppa1.1-hp os=-osf @@ -730,26 +778,26 @@ case $basic_machine in basic_machine=i370-ibm ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; - i386-vsta | vsta) + vsta) basic_machine=i386-unknown os=-vsta ;; @@ -767,17 +815,17 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; - m88k-omron*) - basic_machine=m88k-omron - ;; magnum | m3230) basic_machine=mips-mips os=-sysv @@ -794,7 +842,7 @@ case $basic_machine in os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -809,10 +857,10 @@ case $basic_machine in os=-mint ;; mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k @@ -822,15 +870,19 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -869,7 +921,7 @@ case $basic_machine in basic_machine=v70-nec os=-sysv ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) @@ -914,6 +966,12 @@ case $basic_machine in nsr-tandem) basic_machine=nsr-tandem ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -946,7 +1004,7 @@ case $basic_machine in os=-linux ;; parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) @@ -962,7 +1020,7 @@ case $basic_machine in basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -977,16 +1035,16 @@ case $basic_machine in basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -996,23 +1054,23 @@ case $basic_machine in ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm @@ -1066,17 +1124,10 @@ case $basic_machine in sequent) basic_machine=i386-sequent ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; sh5el) basic_machine=sh5le-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) + simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -1095,7 +1146,7 @@ case $basic_machine in os=-sysv4 ;; strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun @@ -1217,6 +1268,9 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + x64) + basic_machine=x86_64-pc + ;; xbox) basic_machine=i686-pc os=-mingw32 @@ -1225,20 +1279,12 @@ case $basic_machine in basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -1267,10 +1313,6 @@ case $basic_machine in vax) basic_machine=vax-dec ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; pdp11) basic_machine=pdp11-dec ;; @@ -1280,9 +1322,6 @@ case $basic_machine in sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; cydra) basic_machine=cydra-cydrome ;; @@ -1302,7 +1341,7 @@ case $basic_machine in # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac @@ -1310,10 +1349,10 @@ esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1321,11 +1360,11 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if [ x$os != x ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases that might get confused + # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux @@ -1336,45 +1375,48 @@ case $os in -solaris) os=-solaris2 ;; - -svr4*) - os=-sysv4 - ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. + # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1391,12 +1433,12 @@ case $os in -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc @@ -1405,10 +1447,10 @@ case $os in os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition @@ -1419,12 +1461,6 @@ case $os in -wince*) os=-wince ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; -utek*) os=-bsd ;; @@ -1449,7 +1485,7 @@ case $os in -nova*) os=-rtmk-nova ;; - -ns2 ) + -ns2) os=-nextstep2 ;; -nsk*) @@ -1471,7 +1507,7 @@ case $os in -oss*) os=-sysv3 ;; - -svr4) + -svr4*) os=-sysv4 ;; -svr3) @@ -1486,32 +1522,44 @@ case $os in -ose*) os=-ose ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; - -aros*) - os=-aros - ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; -nacl*) ;; + -ios) + ;; -none) ;; + -*-eabi) + case $basic_machine in + arm*) + ;; + esac + ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1546,6 +1594,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1589,9 +1640,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; @@ -1601,12 +1649,12 @@ case $basic_machine in sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; @@ -1646,7 +1694,7 @@ case $basic_machine in m88k-omron*) os=-luna ;; - *-next ) + *-next) os=-nextstep ;; *-sequent) @@ -1661,9 +1709,6 @@ case $basic_machine in i370-*) os=-mvs ;; - *-next) - os=-nextstep3 - ;; *-gould) os=-sysv ;; @@ -1773,15 +1818,15 @@ case $basic_machine in vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$basic_machine$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/build-aux/cross-options.pl b/build-aux/cross-options.pl index 7762e27..0f5009c 100755 --- a/build-aux/cross-options.pl +++ b/build-aux/cross-options.pl @@ -18,50 +18,50 @@ while () \s # Spaces. /x) { - my ($short, $long, $opt, $arg) = ($1, $2, $3, $4); - $short = '' if ! defined $short; - $short = '-d' if $long eq '--defines' && ! $short; - my $dir = '%' . substr($long, 2); - if (index ($scanner, "\"$dir\"") < 0) - { - if ($long eq '--force-define') { $dir = '%define'; } - else { $dir = ''; } - } - if ($arg) - { + my ($short, $long, $opt, $arg) = ($1, $2, $3, $4); + $short = '' if ! defined $short; + $short = '-d' if $long eq '--defines' && ! $short; + my $dir = '%' . substr($long, 2); + if (index ($scanner, "\"$dir\"") < 0) + { + if ($long eq '--force-define') { $dir = '%define'; } + else { $dir = ''; } + } + if ($arg) + { # if $opt, $arg contains the closing ]. substr ($arg, -1) = '' if $opt eq '['; - $arg =~ s/^=//; + $arg =~ s/^=//; $arg = lc ($arg); - my $dir_arg = $arg; + my $dir_arg = $arg; # If the argument is compite (e.g., for --define[=NAME[=VALUE]]), # put each word in @var, to build @var{name}[=@var{value}], not # @var{name[=value]}]. - $arg =~ s/(\w+)/\@var{$1}/g; - my $long_arg = "=$arg"; - if ($opt eq '[') { - $long_arg = "[$long_arg]"; - $arg = "[$arg]"; - } - # For arguments of directives: this only works if all arguments - # are strings and have the same syntax as on the command line. - if ($dir_arg eq 'name[=value]') - { - $dir_arg = '@var{name} ["@var{value}"]'; - } - else - { - $dir_arg =~ s/(\w+)/\@var{"$1"}/g; - $dir_arg = '[' . $dir_arg . ']' - if $opt eq '['; - } - $long = "$long$long_arg"; - $short = "$short $arg" if $short && $short ne '-d'; - $dir = "$dir $dir_arg" if $dir; - } - $option{$long} = $short; - $directive{$long} = $dir; + $arg =~ s/(\w+)/\@var{$1}/g; + my $long_arg = "=$arg"; + if ($opt eq '[') { + $long_arg = "[$long_arg]"; + $arg = "[$arg]"; + } + # For arguments of directives: this only works if all arguments + # are strings and have the same syntax as on the command line. + if ($dir_arg eq 'name[=value]') + { + $dir_arg = '@var{name} ["@var{value}"]'; + } + else + { + $dir_arg =~ s/(\w+)/\@var{"$1"}/g; + $dir_arg = '[' . $dir_arg . ']' + if $opt eq '['; + } + $long = "$long$long_arg"; + $short = "$short $arg" if $short && $short ne '-d'; + $dir = "$dir $dir_arg" if $dir; + } + $option{$long} = $short; + $directive{$long} = $dir; } } diff --git a/build-aux/depcomp b/build-aux/depcomp index 91d4bf8..65cbf70 100755 --- a/build-aux/depcomp +++ b/build-aux/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2012-10-18.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2012-10-18.11; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -251,6 +251,41 @@ hp) exit 1 ;; +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, @@ -517,6 +552,7 @@ $ { G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; @@ -747,9 +783,9 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/do-release-commit-and-tag b/build-aux/do-release-commit-and-tag index 0bd8ce8..4472ff5 100755 --- a/build-aux/do-release-commit-and-tag +++ b/build-aux/do-release-commit-and-tag @@ -3,11 +3,11 @@ # controlled .prev-version file, automate the procedure by which we record # the date, release-type and version string in the NEWS file. That commit # will serve to identify the release, so apply a signed tag to it as well. -VERSION=2012-08-01.09 # UTC +VERSION=2018-03-07.03 # UTC # Note: this is a bash script (could be zsh or dash) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ VERSION=2012-08-01.09 # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # Written by Jim Meyering @@ -67,7 +67,7 @@ version() cat < +License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. EOF @@ -94,7 +94,7 @@ do opt=$(echo "$1" | sed -e 's/=.*//') val=$(echo "$1" | sed -e 's/[^=]*=//') shift - set dummy "$opt" "$val" ${1+"$@"}; shift + set dummy "$opt" "$val" "$@"; shift ;; esac @@ -143,7 +143,7 @@ esac # Ensure the current branch name is correct: curr_br=$(git rev-parse --symbolic-full-name HEAD) -test "$curr_br" = refs/heads/$branch || die not on branch $branch +test "$curr_br" = "refs/heads/$branch" || die not on branch $branch # Extract package name from Makefile. Makefile=$builddir/Makefile @@ -171,9 +171,9 @@ git tag -s -m "$pkg $ver" v$ver HEAD || die 'git tag failed' # Local variables: # indent-tabs-mode: nil -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "VERSION=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: " # UTC" # End: diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh index 98c7523..9d418b9 100755 --- a/build-aux/gendocs.sh +++ b/build-aux/gendocs.sh @@ -2,10 +2,9 @@ # gendocs.sh -- generate a GNU manual in many formats. This script is # mentioned in maintain.texi. See the help message below for usage details. -scriptversion=2013-03-08.15 +scriptversion=2018-03-06.19 -# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 -# Free Software Foundation, Inc. +# Copyright 2003-2018 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,20 +17,19 @@ scriptversion=2013-03-08.15 # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # # Original author: Mohit Agarwal. -# Send bug reports and any other correspondence to bug-texinfo@gnu.org. +# Send bug reports and any other correspondence to bug-gnulib@gnu.org. # # The latest version of this script, and the companion template, is -# available from Texinfo CVS: -# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs.sh -# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs_template +# available from the Gnulib repository: # -# An up-to-date copy is also maintained in Gnulib (gnu.org/software/gnulib). +# https://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh +# https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template # TODO: -# - image importation was only implemented for HTML generated by +# - image importing was only implemented for HTML generated by # makeinfo. But it should be simple enough to adjust. # - images are not imported in the source tarball. All the needed # formats (PDF, PNG, etc.) should be included. @@ -39,12 +37,12 @@ scriptversion=2013-03-08.15 prog=`basename "$0"` srcdir=`pwd` -scripturl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs.sh" -templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs_template" +scripturl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh" +templateurl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template" : ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="} : ${MAKEINFO="makeinfo"} -: ${TEXI2DVI="texi2dvi -t @finalout"} +: ${TEXI2DVI="texi2dvi"} : ${DOCBOOK2HTML="docbook2html"} : ${DOCBOOK2PDF="docbook2pdf"} : ${DOCBOOK2TXT="docbook2txt"} @@ -54,9 +52,27 @@ templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/ unset CDPATH unset use_texi2html +MANUAL_TITLE= +PACKAGE= +EMAIL=webmasters@gnu.org # please override with --email +commonarg= # passed to all makeinfo/texi2html invcations. +dirargs= # passed to all tools (-I dir). +dirs= # -I directories. +htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual" +infoarg=--no-split +generate_ascii=true +generate_html=true +generate_info=true +generate_tex=true +outdir=manual +source_extra= +split=node +srcfile= +texarg="-t @finalout" + version="gendocs.sh $scriptversion -Copyright 2013 Free Software Foundation, Inc. +Copyright 2018 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." @@ -66,7 +82,7 @@ usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE Generate output in various formats from PACKAGE.texinfo (or .texi or .txi) source. See the GNU Maintainers document for a more extensive discussion: - http://www.gnu.org/prep/maintain_toc.html + https://www.gnu.org/prep/maintain_toc.html Options: --email ADR use ADR as contact in generated web pages; always give this. @@ -75,11 +91,16 @@ Options: -o OUTDIR write files into OUTDIR, instead of manual/. -I DIR append DIR to the Texinfo search path. --common ARG pass ARG in all invocations. - --html ARG pass ARG to makeinfo or texi2html for HTML targets. + --html ARG pass ARG to makeinfo or texi2html for HTML targets, + instead of '$htmlarg'. --info ARG pass ARG to makeinfo for Info, instead of --no-split. --no-ascii skip generating the plain text output. + --no-html skip generating the html output. + --no-info skip generating the info output. + --no-tex skip generating the dvi and pdf output. --source ARG include ARG in tar archive of sources. --split HOW make split HTML by node, section, chapter; default node. + --tex ARG pass ARG to texi2dvi for DVI and PDF, instead of -t @finalout. --texi2html use texi2html to make HTML target, with all split versions. --docbook convert through DocBook too (xml, txt, html, pdf). @@ -131,23 +152,9 @@ locale, since that's the language of most Texinfo manuals. If you happen to have a non-English manual and non-English web site, see the SETLANG setting in the source. -Email bug reports or enhancement requests to bug-texinfo@gnu.org. +Email bug reports or enhancement requests to bug-gnulib@gnu.org. " -MANUAL_TITLE= -PACKAGE= -EMAIL=webmasters@gnu.org # please override with --email -commonarg= # passed to all makeinfo/texi2html invcations. -dirargs= # passed to all tools (-I dir). -dirs= # -I's directories. -htmlarg= -infoarg=--no-split -generate_ascii=true -outdir=manual -source_extra= -split=node -srcfile= - while test $# -gt 0; do case $1 in -s) shift; srcfile=$1;; @@ -159,8 +166,12 @@ while test $# -gt 0; do --html) shift; htmlarg=$1;; --info) shift; infoarg=$1;; --no-ascii) generate_ascii=false;; + --no-html) generate_ascii=false;; + --no-info) generate_info=false;; + --no-tex) generate_tex=false;; --source) shift; source_extra=$1;; --split) shift; split=$1;; + --tex) shift; texarg=$1;; --texi2html) use_texi2html=1;; --help) echo "$usage"; exit 0;; @@ -221,8 +232,9 @@ calcsize() # copy_images OUTDIR HTML-FILE... # ------------------------------- -# Copy all the images needed by the HTML-FILEs into OUTDIR. Look -# for them in the -I directories. +# Copy all the images needed by the HTML-FILEs into OUTDIR. +# Look for them in . and the -I directories; this is simpler than what +# makeinfo supports with -I, but hopefully it will suffice. copy_images() { local odir @@ -232,7 +244,7 @@ copy_images() BEGIN { \$me = '$prog'; \$odir = '$odir'; - @dirs = qw($dirs); + @dirs = qw(. $dirs); } " -e ' /${srcdir}/$PACKAGE-db.xml" @@ -430,7 +457,8 @@ if test -n "$docbook"; then mv $PACKAGE-db.pdf "$outdir/" fi -printf "\nMaking index file...\n" +# +printf "\nMaking index.html for $PACKAGE...\n" if test -z "$use_texi2html"; then CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\ /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d" @@ -469,7 +497,7 @@ $GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html" echo "Done, see $outdir/ subdirectory for new files." # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen index 3468247..6d073fc 100755 --- a/build-aux/git-version-gen +++ b/build-aux/git-version-gen @@ -1,8 +1,8 @@ #!/bin/sh # Print a version string. -scriptversion=2012-12-31.23; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2007-2013 Free Software Foundation, Inc. +# Copyright (C) 2007-2018 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,9 +15,9 @@ scriptversion=2012-12-31.23; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . -# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/. # It may be run two ways: # - from a git repository in which the "git describe" command below # produces useful output (thus requiring at least one signed tag) @@ -85,8 +85,9 @@ Print a version string. Options: - --prefix prefix of git tags (default 'v') - --fallback fallback version to use if \"git --version\" fails + --prefix PREFIX prefix of git tags (default 'v') + --fallback VERSION + fallback version to use if \"git --version\" fails --help display this help and exit --version output version information and exit @@ -100,8 +101,8 @@ while test $# -gt 0; do case $1 in --help) echo "$usage"; exit 0;; --version) echo "$version"; exit 0;; - --prefix) shift; prefix="$1";; - --fallback) shift; fallback="$1";; + --prefix) shift; prefix=${1?};; + --fallback) shift; fallback=${1?};; -*) echo "$0: Unknown option '$1'." >&2 echo "$0: Try '--help' for more information." >&2 @@ -166,9 +167,10 @@ then # tag or the previous older version that did not? # Newer: v6.10-77-g0f8faeb # Older: v6.10-g0f8faeb - case $v in - *-*-*) : git describe is okay three part flavor ;; - *-*) + vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v + case $vprefix in + *-*) : git describe is probably okay three part flavor ;; + *) : git describe is older two part flavor # Recreate the number of commits and rewrite such that the # result is the same as if we were using the newer version @@ -183,9 +185,9 @@ then ;; esac - # Change the first '-' to a '.', so version-comparing tools work properly. - # Remove the "g" in git describe's output string, to save a byte. - v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; + # Change the penultimate "-" to ".", for version-comparing tools. + # Remove the "g" to save a byte. + v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`; v_from_git=1 elif test "x$fallback" = x || git --version >/dev/null 2>&1; then v=UNKNOWN @@ -199,7 +201,7 @@ v=`echo "$v" |sed "s/^$prefix//"` # string we're using came from git. I.e., skip the test if it's "UNKNOWN" # or if it came from .tarball-version. if test "x$v_from_git" != x; then - # Don't declare a version "dirty" merely because a time stamp has changed. + # Don't declare a version "dirty" merely because a timestamp has changed. git update-index --refresh > /dev/null 2>&1 dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty= @@ -214,12 +216,12 @@ if test "x$v_from_git" != x; then fi # Omit the trailing newline, so that m4_esyscmd can use the result directly. -echo "$v" | tr -d "$nl" +printf %s "$v" # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index e02d34c..1e73f42 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -1,15 +1,15 @@ -eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' +eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' & eval 'exec perl -wS "$0" $argv:q' if 0; # Convert git log output to ChangeLog format. -my $VERSION = '2012-07-29 06:11'; # UTC +my $VERSION = '2018-03-07 03:47'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2008-2013 Free Software Foundation, Inc. +# Copyright (C) 2008-2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ my $VERSION = '2012-07-29 06:11'; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # Written by Jim Meyering @@ -33,7 +33,7 @@ use POSIX qw(strftime); (my $ME = $0) =~ s|.*/||; -# use File::Coda; # http://meyering.net/code/Coda/ +# use File::Coda; # https://meyering.net/code/Coda/ END { defined fileno STDOUT or return; close STDOUT and return; @@ -72,6 +72,9 @@ OPTIONS: directory can be derived. --since=DATE convert only the logs since DATE; the default is to convert all log entries. + --until=DATE convert only the logs older than DATE. + --ignore-matching=PAT ignore commit messages whose first lines match PAT. + --ignore-line=PAT ignore lines of commit messages that match PAT. --format=FMT set format string for commit subject and body; see 'man git-log' for the list of format metacharacters; the default is '%s%n%b%n' @@ -220,10 +223,13 @@ sub git_dir_option($) { my $since_date; + my $until_date; my $format_string = '%s%n%b%n'; my $amend_file; my $append_dot = 0; my $cluster = 1; + my $ignore_matching; + my $ignore_line; my $strip_tab = 0; my $strip_cherry_pick = 0; my $srcdir; @@ -232,10 +238,13 @@ sub git_dir_option($) help => sub { usage 0 }, version => sub { print "$ME version $VERSION\n"; exit }, 'since=s' => \$since_date, + 'until=s' => \$until_date, 'format=s' => \$format_string, 'amend=s' => \$amend_file, 'append-dot' => \$append_dot, 'cluster!' => \$cluster, + 'ignore-matching=s' => \$ignore_matching, + 'ignore-line=s' => \$ignore_line, 'strip-tab' => \$strip_tab, 'strip-cherry-pick' => \$strip_cherry_pick, 'srcdir=s' => \$srcdir, @@ -243,6 +252,8 @@ sub git_dir_option($) defined $since_date and unshift @ARGV, "--since=$since_date"; + defined $until_date + and unshift @ARGV, "--until=$until_date"; # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/) # that makes a correction in the log or attribution of that commit. @@ -259,6 +270,7 @@ sub git_dir_option($) my $prev_multi_paragraph; my $prev_date_line = ''; my @prev_coauthors = (); + my @skipshas = (); while (1) { defined (my $in = ) @@ -279,6 +291,19 @@ sub git_dir_option($) $sha =~ /^[0-9a-fA-F]{40}$/ or die "$ME:$.: invalid SHA1: $sha\n"; + my $skipflag = 0; + if (@skipshas) + { + foreach(@skipshas) + { + if ($sha =~ /^$_/) + { + $skipflag = $_; + last; + } + } + } + # If this commit's log requires any transformation, do it now. my $code = $amend_code->{$sha}; if (defined $code) @@ -306,7 +331,7 @@ sub git_dir_option($) $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; } - my @line = split "\n", $rest; + my @line = split /[ \t]*\n/, $rest; my $author_line = shift @line; defined $author_line or die "$ME:$.: unexpected EOF\n"; @@ -316,17 +341,18 @@ sub git_dir_option($) # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog # `(tiny change)' annotation. - my $tiny = (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @line) + my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line) ? ' (tiny change)' : ''); my $date_line = sprintf "%s %s$tiny\n", - strftime ("%F", localtime ($1)), $2; + strftime ("%Y-%m-%d", localtime ($1)), $2; my @coauthors = grep /^Co-authored-by:.*$/, @line; # Omit meta-data lines we've already interpreted. @line = grep !/^(?:Signed-off-by:[ ].*>$ |Co-authored-by:[ ] |Copyright-paperwork-exempt:[ ] + |Tiny-change:[ ] )/x, @line; # Remove leading and trailing blank lines. @@ -336,68 +362,109 @@ sub git_dir_option($) while ($line[$#line] =~ /^\s*$/) { pop @line; } } - # Record whether there are two or more paragraphs. - my $multi_paragraph = grep /^\s*$/, @line; - - # Format 'Co-authored-by: A U Thor ' lines in - # standard multi-author ChangeLog format. - for (@coauthors) + # Handle Emacs gitmerge.el "skipped" commits. + # Yes, this should be controlled by an option. So sue me. + if ( grep /^(; )?Merge from /, @line ) + { + my $found = 0; + foreach (@line) + { + if (grep /^The following commit.*skipped:$/, $_) + { + $found = 1; + ## Reset at each merge to reduce chance of false matches. + @skipshas = (); + next; + } + if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/) + { + push ( @skipshas, $1 ); + } + } + } + + # Ignore commits that match the --ignore-matching pattern, if specified. + if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/) { - s/^Co-authored-by:\s*/\t /; - s/\s*/ - or warn "$ME: warning: missing email address for " - . substr ($_, 5) . "\n"; + $skipflag = 1; } - - # If clustering of commit messages has been disabled, if this header - # would be different from the previous date/name/email/coauthors header, - # or if this or the previous entry consists of two or more paragraphs, - # then print the header. - if ( ! $cluster - || $date_line ne $prev_date_line - || "@coauthors" ne "@prev_coauthors" - || $multi_paragraph - || $prev_multi_paragraph) + elsif ($skipflag) { - $prev_date_line eq '' - or print "\n"; - print $date_line; - @coauthors - and print join ("\n", @coauthors), "\n"; + ## Perhaps only warn if a pattern matches more than once? + warn "$ME: warning: skipping $sha due to $skipflag\n"; } - $prev_date_line = $date_line; - @prev_coauthors = @coauthors; - $prev_multi_paragraph = $multi_paragraph; - # If there were any lines - if (@line == 0) + if (! $skipflag) { - warn "$ME: warning: empty commit message:\n $date_line\n"; - } - else - { - if ($append_dot) + if (defined $ignore_line && @line) + { + @line = grep ! /$ignore_line/, @line; + while ($line[$#line] =~ /^\s*$/) { pop @line; } + } + + # Record whether there are two or more paragraphs. + my $multi_paragraph = grep /^\s*$/, @line; + + # Format 'Co-authored-by: A U Thor ' lines in + # standard multi-author ChangeLog format. + for (@coauthors) + { + s/^Co-authored-by:\s*/\t /; + s/\s*/ + or warn "$ME: warning: missing email address for " + . substr ($_, 5) . "\n"; + } + + # If clustering of commit messages has been disabled, if this header + # would be different from the previous date/name/etc. header, + # or if this or the previous entry consists of two or more paragraphs, + # then print the header. + if ( ! $cluster + || $date_line ne $prev_date_line + || "@coauthors" ne "@prev_coauthors" + || $multi_paragraph + || $prev_multi_paragraph) { - # If the first line of the message has enough room, then - if (length $line[0] < 72) + $prev_date_line eq '' + or print "\n"; + print $date_line; + @coauthors + and print join ("\n", @coauthors), "\n"; + } + $prev_date_line = $date_line; + @prev_coauthors = @coauthors; + $prev_multi_paragraph = $multi_paragraph; + + # If there were any lines + if (@line == 0) + { + warn "$ME: warning: empty commit message:\n $date_line\n"; + } + else + { + if ($append_dot) { - # append a dot if there is no other punctuation or blank - # at the end. - $line[0] =~ /[[:punct:]\s]$/ - or $line[0] .= '.'; + # If the first line of the message has enough room, then + if (length $line[0] < 72) + { + # append a dot if there is no other punctuation or blank + # at the end. + $line[0] =~ /[[:punct:]\s]$/ + or $line[0] .= '.'; + } } - } - # Remove one additional leading TAB from each line. - $strip_tab - and map { s/^\t// } @line; + # Remove one additional leading TAB from each line. + $strip_tab + and map { s/^\t// } @line; - # Prefix each non-empty line with a TAB. - @line = map { length $_ ? "\t$_" : '' } @line; + # Prefix each non-empty line with a TAB. + @line = map { length $_ ? "\t$_" : '' } @line; - print "\n", join ("\n", @line), "\n"; + print "\n", join ("\n", @line), "\n"; + } } defined ($in = ) @@ -424,9 +491,9 @@ sub git_dir_option($) # Local Variables: # mode: perl # indent-tabs-mode: nil -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "my $VERSION = '" # time-stamp-format: "%:y-%02m-%02d %02H:%02M" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "'; # UTC" # End: diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update index 268ecc0..356c561 100755 --- a/build-aux/gnu-web-doc-update +++ b/build-aux/gnu-web-doc-update @@ -1,10 +1,10 @@ #!/bin/sh # Run this after each non-alpha release, to update the web documentation at -# http://www.gnu.org/software/$pkg/manual/ +# https://www.gnu.org/software/$pkg/manual/ -VERSION=2012-12-16.14; # UTC +VERSION=2018-03-07.03; # UTC -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ VERSION=2012-12-16.14; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } @@ -30,7 +30,7 @@ Usage: $ME Run this script from top_srcdir (no arguments) after each non-alpha release, to update the web documentation at -http://www.gnu.org/software/\$pkg/manual/ +https://www.gnu.org/software/\$pkg/manual/ This script assumes you're using git for revision control, and requires a .prev-version file as well as a Makefile, from which it @@ -40,6 +40,7 @@ assumes all documentation is in the doc/ sub-directory. Options: -C, --builddir=DIR location of (configured) Makefile (default: .) -n, --dry-run don't actually commit anything + -m, --mirror remove out of date files from document server --help print this help, then exit --version print version number, then exit @@ -54,7 +55,7 @@ version() cat < +License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. EOF @@ -107,6 +108,7 @@ find_tool XARGS gxargs xargs builddir=. dryrun= +rm_stale='echo' while test $# != 0 do # Handle --option=value by splitting apart and putting back on argv. @@ -115,7 +117,7 @@ do opt=$(echo "$1" | sed -e 's/=.*//') val=$(echo "$1" | sed -e 's/[^=]*=//') shift - set dummy "$opt" "$val" ${1+"$@"}; shift + set dummy "$opt" "$val" "$@"; shift ;; esac @@ -123,6 +125,7 @@ do --help|--version) ${1#--};; -C|--builddir) shift; builddir=$1; shift ;; -n|--dry-run) dryrun=echo; shift;; + -m|--mirror) rm_stale=''; shift;; --*) die "unrecognized option: $1";; *) break;; esac @@ -159,6 +162,7 @@ $GIT submodule update --recursive ./bootstrap srcdir=$(pwd) cd "$builddir" +builddir=$(pwd) ./config.status --recheck ./config.status make @@ -175,20 +179,32 @@ $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual cd $tmp/$pkg/manual # Add all the files. This is simpler than trying to add only the - # new ones because of new directories: it would require iterating on - # adding the outer directories, and then their contents. - # - # find guarantees that we add outer directories first. - find . -name CVS -prune -o -print \ + # new ones because of new directories + # First add non empty dirs individually + find . -name CVS -prune -o -type d \! -empty -print \ + | $XARGS -n1 --no-run-if-empty -- $dryrun $CVS add -ko + # Now add all files + find . -name CVS -prune -o -type f -print \ | $XARGS --no-run-if-empty -- $dryrun $CVS add -ko + # Report/Remove stale files + # excluding doc server specific files like CVS/* and .symlinks + if test -n "$rm_stale"; then + echo 'Consider the --mirror option if all of the manual is generated,' >&2 + echo 'which will run `cvs remove` to remove stale files.' >&2 + fi + { find . \( -name CVS -o -type f -name '.*' \) -prune -o -type f -print + (cd "$builddir"/doc/manual/ && find . -type f -print | sed p) + } | sort | uniq -u \ + | $XARGS --no-run-if-empty -- ${rm_stale:-$dryrun} $CVS remove -f + $dryrun $CVS ci -m $version ) # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "VERSION=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/gnupload b/build-aux/gnupload index 7a137c1..c3545b3 100755 --- a/build-aux/gnupload +++ b/build-aux/gnupload @@ -1,9 +1,9 @@ #!/bin/sh # Sign files and upload them. -scriptversion=2013-03-19.17; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2013-03-19.17; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # Originally written by Alexandre Duret-Lutz . # The master copy of this file is maintained in the gnulib Git repository. @@ -78,7 +78,7 @@ in the current working directory, its contents are prepended to the actual command line options. Use this to keep your defaults. Comments (#) and empty lines in $conffile are allowed. - + gives some further background. Examples: @@ -108,7 +108,7 @@ Examples: gnupload executes a program ncftpput to do the transfers; if you don't happen to have an ncftp package installed, the ncftpput-ftp script in the build-aux/ directory of the gnulib package -(http://savannah.gnu.org/projects/gnulib) may serve as a replacement. +(https://savannah.gnu.org/projects/gnulib) may serve as a replacement. Send patches and bug reports to ." @@ -432,9 +432,9 @@ done exit 0 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/install-sh b/build-aux/install-sh index 377bb86..8175c64 100755 --- a/build-aux/install-sh +++ b/build-aux/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -266,122 +271,113 @@ do fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +387,51 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -450,8 +444,8 @@ do else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 @@ -472,15 +466,12 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +484,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 @@ -519,9 +510,9 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/javacomp.sh.in b/build-aux/javacomp.sh.in index 4d5020d..130718b 100644 --- a/build-aux/javacomp.sh.in +++ b/build-aux/javacomp.sh.in @@ -1,7 +1,7 @@ #!/bin/sh # Compile a Java program. -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # Written by Bruno Haible , 2001. # # This program is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # This uses the same choices as javacomp.c, but instead of relying on the # environment settings at run time, it uses the environment variables diff --git a/build-aux/javaexec.sh.in b/build-aux/javaexec.sh.in index 1524501..196cdd7 100644 --- a/build-aux/javaexec.sh.in +++ b/build-aux/javaexec.sh.in @@ -1,7 +1,7 @@ #!/bin/sh # Execute a Java program. -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # Written by Bruno Haible , 2001. # # This program is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # This uses the same choices as javaexec.c, but instead of relying on the # environment settings at run time, it uses the environment variables diff --git a/build-aux/Makefile.am b/build-aux/local.mk similarity index 69% rename from build-aux/Makefile.am rename to build-aux/local.mk index d307de4..70a900f 100644 --- a/build-aux/Makefile.am +++ b/build-aux/local.mk @@ -1,5 +1,5 @@ -## Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc. - +# Copyright (C) 2000-2015, 2018 Free Software Foundation, Inc. +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -13,8 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -EXTRA_DIST = \ - cross-options.pl \ - darwin11.4.0.valgrind \ - prev-version.txt \ - update-b4-copyright +EXTRA_DIST += \ + build-aux/Darwin.valgrind \ + build-aux/Linux.valgrind \ + build-aux/cross-options.pl \ + build-aux/move-if-change \ + build-aux/prev-version.txt \ + build-aux/update-b4-copyright diff --git a/build-aux/mdate-sh b/build-aux/mdate-sh index b3719cf..8c7a590 100755 --- a/build-aux/mdate-sh +++ b/build-aux/mdate-sh @@ -1,9 +1,9 @@ #!/bin/sh # Get modification time of a file or directory and pretty-print it. -scriptversion=2010-08-21.06; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1995-2013 Free Software Foundation, Inc. +# Copyright (C) 1995-2018 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2010-08-21.06; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -74,6 +74,10 @@ export LC_ALL LC_TIME=C export LC_TIME +# Use UTC to get reproducible result. +TZ=UTC0 +export TZ + # GNU ls changes its time format in response to the TIME_STYLE # variable. Since we cannot assume 'unset' works, revert this # variable to its documented default. @@ -216,9 +220,9 @@ echo $day $month $year # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/missing b/build-aux/missing index cdea514..625aeb1 100755 --- a/build-aux/missing +++ b/build-aux/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-06-26.16; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ else exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -160,7 +160,7 @@ give_advice () ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) @@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/move-if-change b/build-aux/move-if-change new file mode 100755 index 0000000..5da3eae --- /dev/null +++ b/build-aux/move-if-change @@ -0,0 +1,83 @@ +#!/bin/sh +# Like mv $1 $2, but if the files are the same, just delete $1. +# Status is zero if successful, nonzero otherwise. + +VERSION='2018-03-07 03:47'; # UTC +# The definition above must lie within the first 8 lines in order +# for the Emacs time-stamp write hook (at end) to update it. +# If you change this file with Emacs, please let the write hook +# do its job. Otherwise, update this string manually. + +# Copyright (C) 2002-2018 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +usage="usage: $0 SOURCE DEST" + +help="$usage + or: $0 OPTION +If SOURCE is different than DEST, then move it to DEST; else remove SOURCE. + + --help display this help and exit + --version output version information and exit + +The variable CMPPROG can be used to specify an alternative to 'cmp'. + +Report bugs to ." + +version=`expr "$VERSION" : '\([^ ]*\)'` +version="move-if-change (gnulib) $version +Copyright (C) 2011 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law." + +cmpprog=${CMPPROG-cmp} + +for arg +do + case $arg in + --help | --hel | --he | --h) + exec echo "$help" ;; + --version | --versio | --versi | --vers | --ver | --ve | --v) + exec echo "$version" ;; + --) + shift + break ;; + -*) + echo "$0: invalid option: $arg" >&2 + exit 1 ;; + *) + break ;; + esac +done + +test $# -eq 2 || { echo "$0: $usage" >&2; exit 1; } + +if test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null; then + rm -f -- "$1" +else + if mv -f -- "$1" "$2"; then :; else + # Ignore failure due to a concurrent move-if-change. + test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null && rm -f -- "$1" + fi +fi + +## Local Variables: +## eval: (add-hook 'before-save-hook 'time-stamp) +## time-stamp-start: "VERSION='" +## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-time-zone: "UTC0" +## time-stamp-end: "'; # UTC" +## End: diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk new file mode 100755 index 0000000..67b723f --- /dev/null +++ b/build-aux/prefix-gnulib-mk @@ -0,0 +1,238 @@ +eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' + & eval 'exec perl -wS "$0" $argv:q' + if 0; + +use strict; +use IO::File; +use Getopt::Long; +use File::Basename; # for dirname + +my $VERSION = '2012-01-21 17:13'; # UTC +(my $ME = $0) =~ s|.*/||; + +my $prefix; +my $lib_name; + +sub usage ($) +{ + my ($exit_code) = @_; + my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR); + if ($exit_code != 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + print $STREAM <getline or die "$file"; + $f->close; + return $contents; +} + +# prefix_word ($WORD) +# ------------------- +# Do not prefix special words such as variable dereferences. Also, +# "Makefile" is really "Makefile", since precisely there is no +# lib/Makefile. +sub prefix_word ($) +{ + local ($_) = @_; + $_ = $prefix . $_ + unless (/^-/ || m{^\$\(\w+\)} || $_ eq "Makefile" || $_ eq '\\' + || $_ eq '@ALLOCA@'); + return $_; +} + + +# prefix_words ($TEXT) +# -------------------- +sub prefix_words ($) +{ + local ($_) = @_; + s{(\S+)}{prefix_word($1)}gem; + return $_; +} + + +# prefix_assignment ($LHS-AND-ASSIGN-OP, $RHS) +# -------------------------------------------- +sub prefix_assignment ($$) +{ + my ($lhs_and_assign_op, $rhs) = @_; + my $res; + + # Some variables are initialized by gnulib.mk, and we don't want + # that. Change '=' to '+='. + if ($lhs_and_assign_op =~ /^(GPERF|V_GPERF.*) =$/) + { + # Do not change the RHS, which specifies the GPERF program. + } + elsif ($lhs_and_assign_op =~ + /^(SUBDIRS|EXTRA_DIST|BUILT_SOURCES|SUFFIXES|MOSTLYCLEANFILES + |CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES|AM_CFLAGS + |AM_CPPFLAGS|AM_GNU_GETTEXT)\ =/x) + { + $lhs_and_assign_op =~ s/=/+=/; + } + # We don't want to inherit gnulib's AUTOMAKE_OPTIONS, comment them. + elsif ($lhs_and_assign_op =~ /^AUTOMAKE_OPTIONS =/) + { + $lhs_and_assign_op =~ s/^/# /; + } + elsif ($lhs_and_assign_op =~ /^SUFFIXES /) + { + # Elide any SUFFIXES assignment or concatenation. + $lhs_and_assign_op =~ s/^/# /; + } + # The words are (probably) paths to files in lib/: prefix them. + else + { + $rhs = prefix_words($rhs) + } + + # Variables which name depend on the location: libbison_a_SOURCES => + # lib_libbison_a_SOURCES. + $lhs_and_assign_op =~ s/($lib_name)/lib_$1/g; + + return $lhs_and_assign_op . $rhs; +} + +# prefix $CONTENTS +# ---------------- +# $CONTENTS is a Makefile content. Post-process it so that each file-name +# is prefixed with $prefix (e.g., "lib/"). +# +# Relies heavily on the regularity of the file generated by gnulib-tool. +sub prefix ($) +{ + # Work on $_. + local ($_) = @_; + + # Prefix all the occurrence of files in rules. If there is nothing + # after in the :, it's probably a phony target, or a suffix rule. + # Don't touch it. + s{^([-\w+/]+\.[-\w.]+ *: *\S.*)$} + {prefix_words($1)}gem; + + # Prefix files in variables. + s{^([\w.]+\s*\+?=)(.*)$} + {prefix_assignment($1, $2)}gem; + + # These three guys escape all the other regular rules. + # Require the leading white space to avoid inserting the prefix + # on a line like this: + # charset_alias = $(DESTDIR)$(libdir)/charset.alias + # With $(libdir), it would be erroneous. + s{(\s)(charset\.alias|ref-add\.sed|ref-del\.sed)}{$1$prefix$2}g; + # Unfortunately, as a result we sometimes have lib/lib. + s{($prefix){2}}{$1}g; + + # $(srcdir)/ is actually $(top_srcdir)/$prefix/. + # The trailing slash is required to avoid matching this rule: + # test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile + s{\$\(srcdir\)/}{\$(top_srcdir)/$prefix}g; + + # Sometimes, t-$@ is used instead of $@-t, which, of course, does + # not work when we have a $@ with a directory in it. + s{t-\$\@}{\$\@-t}g; + + # Some AC_SUBST patterns remain and would better be Make macros. + s{\@(MKDIR_P)\@}{\$($1)}g; + + # Adjust paths in mkdir. + s{(\$\(MKDIR_P\))\s*(\w+)}{$1 $prefix$2}g; + + return $_; +} + +# process ($IN) +# ------------- +sub process ($) +{ + my ($file) = @_; + my ($bak) = "$file.bak"; + rename ($file, $bak) or die "$ME: rename $file $bak failed: $!\n"; + my $contents = contents ($bak); + $contents = prefix ($contents); + my $out = new IO::File(">$file") + or die "$ME: $file: failed to open for writing: $!\n"; + print $out $contents; +} + +{ + GetOptions + ( + 'lib-name=s' => \$lib_name, + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + ) or usage 1; + + my $fail = 0; + defined $lib_name + or (warn "$ME: no library name; use --lib-name=NAME\n"), $fail = 1; + + # There must be exactly one argument. + @ARGV == 0 + and (warn "$ME: missing FILE argument\n"), $fail = 1; + 1 < @ARGV + and (warn "$ME: too many arguments:\n", join ("\n", @ARGV), "\n"), + $fail = 1; + $fail + and usage 1; + + my $file = $ARGV[0]; + $prefix = (dirname $file) . '/'; + warn "prefix=$prefix\n"; + + process $file; +} + +### Setup "GNU" style for perl-mode and cperl-mode. +## Local Variables: +## perl-indent-level: 2 +## perl-continued-statement-offset: 2 +## perl-continued-brace-offset: 0 +## perl-brace-offset: 0 +## perl-brace-imaginary-offset: 0 +## perl-label-offset: -2 +## cperl-indent-level: 2 +## cperl-brace-offset: 0 +## cperl-continued-brace-offset: 0 +## cperl-label-offset: -2 +## cperl-extra-newline-before-brace: t +## cperl-merge-trailing-else: nil +## cperl-continued-statement-offset: 2 +## eval: (add-hook 'before-save-hook 'time-stamp) +## time-stamp-start: "my $VERSION = '" +## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-time-zone: "UTC0" +## time-stamp-end: "'; # UTC" +## End: diff --git a/build-aux/test-driver b/build-aux/test-driver index 32bf39e..b8521a4 100755 --- a/build-aux/test-driver +++ b/build-aux/test-driver @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2012-06-27.10; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2018 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2012-06-27.10; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -44,13 +44,12 @@ print_usage () Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } -# TODO: better error handling in option parsing (in particular, ensure -# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. @@ -69,10 +68,23 @@ while test $# -gt 0; do --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; + *) break;; esac shift done +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. @@ -94,11 +106,14 @@ trap "st=143; $do_exit" 15 # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -107,6 +122,12 @@ case $estatus:$expect_failure in *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + # Report outcome to console. echo "${col}${res}${std}: $test_name" @@ -119,9 +140,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex index 85f184c..aa4f256 100644 --- a/build-aux/texinfo.tex +++ b/build-aux/texinfo.tex @@ -3,11 +3,12 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2013-02-01.11} +\def\texinfoversion{2018-03-10.14} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. +% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 +% Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -20,7 +21,7 @@ % General Public License for more details. % % You should have received a copy of the GNU General Public License -% along with this program. If not, see . +% along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without @@ -29,9 +30,9 @@ % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: -% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or -% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or -% http://www.gnu.org/software/texinfo/ (the Texinfo home page) +% https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or +% https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or +% https://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % @@ -55,7 +56,7 @@ % extent. You can get the existing language-specific files from the % full Texinfo distribution. % -% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. +% The GNU Texinfo home page is https://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} @@ -66,6 +67,10 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} +% LaTeX's \typeout. This ensures that the messages it is used for +% are identical in format to the corresponding ones from latex/pdflatex. +\def\typeout{\immediate\write17}% + \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. @@ -96,7 +101,9 @@ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ +\let\ptexsp=\sp \let\ptexstar=\* +\let\ptexsup=\sup \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode @@ -155,22 +162,13 @@ \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -% Since the category of space is not known, we have to be careful. -\chardef\spacecat = 10 -\def\spaceisspace{\catcode`\ =\spacecat} +% Give the space character the catcode for a space. +\def\spaceisspace{\catcode`\ =10\relax} + +% Likewise for ^^M, the end of line character. +\def\endlineisspace{\catcode13=10\relax} -% sometimes characters are active, so we need control sequences. -\chardef\ampChar = `\& -\chardef\colonChar = `\: -\chardef\commaChar = `\, \chardef\dashChar = `\- -\chardef\dotChar = `\. -\chardef\exclamChar= `\! -\chardef\hashChar = `\# -\chardef\lquoteChar= `\` -\chardef\questChar = `\? -\chardef\rquoteChar= `\' -\chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ @@ -193,17 +191,6 @@ wide-spread wrap-around } -% Margin to add to right of even pages, to left of odd pages. -\newdimen\bindingoffset -\newdimen\normaloffset -\newdimen\pagewidth \newdimen\pageheight - -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). -% -\def\finalout{\overfullrule=0pt } - % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make @@ -248,6 +235,15 @@ \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} +% Output routine +% + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt } + % Do @cropmarks to get crop marks. % \newif\ifcropmarks @@ -270,10 +266,18 @@ % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top -% of a page, or that at the bottom of a page. The solution is -% described on page 260 of The TeXbook. It involves outputting two -% marks for the sectioning macros, one before the section break, and -% one after. I won't pretend I can describe this better than DEK... +% of a page, or that at the bottom of a page. + +% \domark is called twice inside \chapmacro, to add one +% mark before the section break, and one after. +% In the second call \prevchapterdefs is the same as \lastchapterdefs, +% and \prevsectiondefs is the same as \lastsectiondefs. +% Then if the page is not broken at the mark, some of the previous +% section appears on the page, and we can get the name of this section +% from \firstmark for @everyheadingmarks top. +% @everyheadingmarks bottom uses \botmark. +% +% See page 260 of The TeXbook. \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% @@ -281,11 +285,15 @@ \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% - \the\toks0 \the\toks2 - \noexpand\or \the\toks4 \the\toks6 - \noexpand\else \the\toks8 + \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top + \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom + \noexpand\else \the\toks8 % 2: color marks }% } + +% \gettopheadingmarks, \getbottomheadingmarks, +% \getcolormarks - extract needed part of mark. +% % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., @@ -301,33 +309,67 @@ % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} +\def\lastsection{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\txipagewidth \newdimen\txipageheight + % Main output routine. +% \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox -% \onepageout takes a vbox as an argument. Note that \pagecontents -% does insertions, but you have to call it yourself. +% \onepageout takes a vbox as an argument. +% \shipout a vbox for a single page, adding an optional header, footer, +% cropmarks, and footnote. This also causes index entries for this page +% to be written to the auxiliary files. +% \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % + % Common context changes for both heading and footing. % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). + \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars} + % + % Retrieve the information for the headings from the marks in the page, + % and call Plain TeX's \makeheadline and \makefootline, which use the + % values in \headline and \footline. + % + % This is used to check if we are on the first page of a chapter. + \ifcase1\topmark\fi + \let\prevchaptername\thischaptername + \ifcase0\firstmark\fi + \let\curchaptername\thischaptername + % \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi - \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi - \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % + \ifx\curchaptername\prevchaptername + \let\thischapterheading\thischapter + \else + % \thischapterheading is the same as \thischapter except it is blank + % for the first page of a chapter. This is to prevent the chapter name + % being shown twice. + \def\thischapterheading{}% + \fi + % + \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% + \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% % {% + % Set context for writing to auxiliary files like index files. % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. @@ -336,10 +378,10 @@ \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: - % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be - % {\code {{\tt \backslashcurfont }acronym} + % {\code {{\backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi @@ -397,7 +439,8 @@ \newinsert\margin \dimen\margin=\maxdimen -\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +% Main part of page, including any footnotes +\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) @@ -419,9 +462,13 @@ \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Argument parsing + % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. +% For example, \def\foo{\parsearg\fooxxx}. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% @@ -440,9 +487,11 @@ }% } -% First remove any @comment, then any @c comment. +% First remove any @comment, then any @c comment. Also remove a @texinfoc +% comment (see \scanmacro for details). Pass the result on to \argcheckspaces. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} -\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} +\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % @@ -477,14 +526,13 @@ % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef - define a command taking an argument on the line +% % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} -% -% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my -% favourite TeX trick. --kasal, 16nov03 - \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } @@ -674,21 +722,26 @@ \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. + \addgroupbox + \prevdepth = \dimen1 + \checkinserts +} + +\def\addgroupbox{ % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). - \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 - \ifdim \pagetotal < \vfilllimit\pageheight + \ifdim \pagetotal < \vfilllimit\txipageheight \page \fi \fi \box\groupbox - \prevdepth = \dimen1 - \checkinserts } + % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. @@ -812,36 +865,6 @@ where each line of input produces a line of output.} \temp } -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). This command -% is not documented, not supported, and doesn't work. -% -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% -} - % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} @@ -930,13 +953,14 @@ where each line of input produces a line of output.} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment -% -\def\comment{\begingroup \catcode`\^^M=\other% + + +\def\c{\begingroup \catcode`\^^M=\active% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% -\commentxxx} -{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} +\cxxx} +{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} % -\let\c=\comment +\let\comment\c % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. @@ -1007,69 +1031,23 @@ where each line of input produces a line of output.} % paragraph. % \gdef\dosuppressfirstparagraphindent{% - \gdef\indent{% - \restorefirstparagraphindent - \indent - }% - \gdef\noindent{% - \restorefirstparagraphindent - \noindent - }% - \global\everypar = {% - \kern -\parindent - \restorefirstparagraphindent - }% + \gdef\indent {\restorefirstparagraphindent \indent}% + \gdef\noindent{\restorefirstparagraphindent \noindent}% + \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% } - +% \gdef\restorefirstparagraphindent{% - \global \let \indent = \ptexindent - \global \let \noindent = \ptexnoindent - \global \everypar = {}% + \global\let\indent = \ptexindent + \global\let\noindent = \ptexnoindent + \global\everypar = {}% } % @refill is a no-op. \let\refill=\relax -% If working on a large document in chapters, it is convenient to -% be able to disable indexing, cross-referencing, and contents, for test runs. -% This is done with @novalidate (before @setfilename). -% -\newif\iflinks \linkstrue % by default we want the aux files. -\let\novalidate = \linksfalse - -% @setfilename is done at the beginning of every texinfo file. -% So open here the files we need to have open while reading the input. -% This makes it possible to make a .fmt file for texinfo. -\def\setfilename{% - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \iflinks - \tryauxfile - % Open the new aux file. TeX will close it automatically at exit. - \immediate\openout\auxfile=\jobname.aux - \fi % \openindices needs to do some work in any case. - \openindices - \let\setfilename=\comment % Ignore extra @setfilename cmds. - % - % If texinfo.cnf is present on the system, read it. - % Useful for site-wide @afourpaper, etc. - \openin 1 texinfo.cnf - \ifeof 1 \else \input texinfo.cnf \fi - \closein 1 - % - \comment % Ignore the actual filename. -} - -% Called from \setfilename. -% -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} +% @setfilename INFO-FILENAME - ignored +\let\setfilename=\comment % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} @@ -1087,10 +1065,91 @@ where each line of input produces a line of output.} \newtoks\toksC \newtoks\toksD \newbox\boxA +\newbox\boxB \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest +% +% For LuaTeX +% + +\newif\iftxiuseunicodedestname +\txiuseunicodedestnamefalse % For pdfTeX etc. + +\ifx\luatexversion\thisisundefined +\else + % Use Unicode destination names + \txiuseunicodedestnametrue + % Escape PDF strings with converting UTF-16 from UTF-8 + \begingroup + \catcode`\%=12 + \directlua{ + function UTF16oct(str) + tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377') + for c in string.utfvalues(str) do + if c < 0x10000 then + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', + (c / 256), (c % 256))) + else + c = c - 0x10000 + local c_hi = c / 1024 + 0xd800 + local c_lo = c % 1024 + 0xdc00 + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', + (c_hi / 256), (c_hi % 256), + (c_lo / 256), (c_lo % 256))) + end + end + end + } + \endgroup + \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}} + % Escape PDF strings without converting + \begingroup + \directlua{ + function PDFescstr(str) + for c in string.bytes(str) do + if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o', + c)) + else + tex.sprint(string.char(c)) + end + end + end + } + \endgroup + \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} + \ifnum\luatexversion>84 + % For LuaTeX >= 0.85 + \def\pdfdest{\pdfextension dest} + \let\pdfoutput\outputmode + \def\pdfliteral{\pdfextension literal} + \def\pdfcatalog{\pdfextension catalog} + \def\pdftexversion{\numexpr\pdffeedback version\relax} + \let\pdfximage\saveimageresource + \let\pdfrefximage\useimageresource + \let\pdflastximage\lastsavedimageresourceindex + \def\pdfendlink{\pdfextension endlink\relax} + \def\pdfoutline{\pdfextension outline} + \def\pdfstartlink{\pdfextension startlink} + \def\pdffontattr{\pdfextension fontattr} + \def\pdfobj{\pdfextension obj} + \def\pdflastobj{\numexpr\pdffeedback lastobj\relax} + \let\pdfpagewidth\pagewidth + \let\pdfpageheight\pageheight + \edef\pdfhorigin{\pdfvariable horigin} + \edef\pdfvorigin{\pdfvariable vorigin} + \fi +\fi + % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined @@ -1121,12 +1180,21 @@ where each line of input produces a line of output.} \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. + \xdef#1{#1}% \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } +\def\txiescapepdfutfsixteen#1{% + \ifx\pdfescapestrutfsixteen\thisisundefined + % No UTF-16 converting macro available. + \txiescapepdf{#1}% + \else + \xdef#1{\pdfescapestrutfsixteen{#1}}% + \fi +} \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot @@ -1135,15 +1203,17 @@ output) for that.)} \ifpdf % - % Color manipulation macros based on pdfcolor.tex, + % Color manipulation macros using ideas from pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead - % of actual black. + % of actual black. The dark red here is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. We use + % black by default, though. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % - % k sets the color for filling (usual text, etc.); - % K sets the color for stroking (thin rules, e.g., normal _'s). + % rg sets the color for filling (usual text, etc.); + % RG sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, @@ -1234,24 +1304,83 @@ output) for that.)} \pdfrefximage \pdflastximage \fi} % - \def\pdfmkdest#1{{% + \def\setpdfdestname#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts - \turnoffactive \makevalueexpandable + \turnoffactive + \iftxiuseunicodedestname + \ifx \declaredencoding \latone + % Pass through Latin-1 characters. + % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode. + \else + \ifx \declaredencoding \utfeight + % Pass through Unicode characters. + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \fi + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi \def\pdfdestname{#1}% \txiescapepdf\pdfdestname - \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % + \def\setpdfoutlinetext#1{{% + \indexnofonts + \makevalueexpandable + \turnoffactive + \ifx \declaredencoding \latone + % The PDF format can use an extended form of Latin-1 in bookmark + % strings. See Appendix D of the PDF Reference, Sixth Edition, for + % the "PDFDocEncoding". + \passthroughcharstrue + % Pass through Latin-1 characters. + % LuaTeX: Convert to Unicode + % pdfTeX: Use Latin-1 as PDFDocEncoding + \def\pdfoutlinetext{#1}% + \else + \ifx \declaredencoding \utfeight + \ifx\luatexversion\thisisundefined + % For pdfTeX with UTF-8. + % TODO: the PDF format can use UTF-16 in bookmark strings, + % but the code for this isn't done yet. + % Use ASCII approximations. + \passthroughcharsfalse + \def\pdfoutlinetext{#1}% + \else + % For LuaTeX with UTF-8. + % Pass through Unicode characters for title texts. + \passthroughcharstrue + \def\pdfoutlinetext{#1}% + \fi + \else + % For non-Latin-1 or non-UTF-8 encodings. + % Use ASCII approximations. + \passthroughcharsfalse + \def\pdfoutlinetext{#1}% + \fi + \fi + % LuaTeX: Convert to UTF-16 + % pdfTeX: Use Latin-1 as PDFDocEncoding + \txiescapepdfutfsixteen\pdfoutlinetext + }} + % + \def\pdfmkdest#1{% + \setpdfdestname{#1}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + } + % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % - % by default, use a color that is dark enough to print on paper as - % nearly black, but still distinguishable for online viewing. - \def\urlcolor{\rgbDarkRed} - \def\linkcolor{\rgbDarkRed} + % by default, use black for everything. + \def\urlcolor{\rgbBlack} + \def\linkcolor{\rgbBlack} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines @@ -1273,18 +1402,13 @@ output) for that.)} % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. - \edef\pdfoutlinedest{#3}% - \ifx\pdfoutlinedest\empty - \def\pdfoutlinedest{#4}% - \else - \txiescapepdf\pdfoutlinedest + \setpdfoutlinetext{#1} + \setpdfdestname{#3} + \ifx\pdfdestname\empty + \def\pdfdestname{#4}% \fi % - % Also escape PDF chars in the display string. - \edef\pdfoutlinetext{#1}% - \txiescapepdf\pdfoutlinetext - % - \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% @@ -1439,41 +1563,297 @@ output) for that.)} \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput - -\message{fonts,} - -% Change the current font style to #1, remembering it in \curfontstyle. -% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in -% italics, not bold italics. % -\def\setfontstyle#1{% - \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. - \csname ten#1\endcsname % change the current font -} - -% Select #1 fonts with the current style. +% For XeTeX % -\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} - -\def\rm{\fam=0 \setfontstyle{rm}} -\def\it{\fam=\itfam \setfontstyle{it}} -\def\sl{\fam=\slfam \setfontstyle{sl}} -\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} -\def\tt{\fam=\ttfam \setfontstyle{tt}} - -% Unfortunately, we have to override this for titles and the like, since -% in those cases "rm" is bold. Sigh. -\def\rmisbold{\rm\def\curfontstyle{bf}} +\ifx\XeTeXrevision\thisisundefined +\else + % + % XeTeX version check + % + \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1 + % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307. + % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941). + % For avoiding PDF destination name replacement, we use this special + % instead of xdvipdfmx's command line option `-C 0x0010'. + \special{dvipdfmx:config C 0x0010} + % XeTeX 0.99995+ comes with xdvipdfmx 20160307+. + % It can handle Unicode destination names for PDF. + \txiuseunicodedestnametrue + \else + % XeTeX < 0.99996 (TeX Live < 2016) cannot use the + % `dvipdfmx:config' special. + % So for avoiding PDF destination name replacement, + % xdvipdfmx's command line option `-C 0x0010' is necessary. + % + % XeTeX < 0.99995 can not handle Unicode destination names for PDF + % because xdvipdfmx 20150315 has a UTF-16 conversion issue. + % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). + \txiuseunicodedestnamefalse + \fi + % + % Color support + % + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % PDF outline support + % + % Emulate pdfTeX primitive + \def\pdfdest name#1 xyz{% + \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}% + } + % + \def\setpdfdestname#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \makevalueexpandable + \turnoffactive + \iftxiuseunicodedestname + % Pass through Unicode characters. + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + }} + % + \def\setpdfoutlinetext#1{{% + \turnoffactive + % Always use Unicode characters in title texts. + \def\pdfoutlinetext{#1}% + % For XeTeX, xdvipdfmx converts to UTF-16. + % So we do not convert. + \txiescapepdf\pdfoutlinetext + }} + % + \def\pdfmkdest#1{% + \setpdfdestname{#1}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + } + % + % by default, use black for everything. + \def\urlcolor{\rgbBlack} + \def\linkcolor{\rgbBlack} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + \def\dopdfoutline#1#2#3#4{% + \setpdfoutlinetext{#1} + \setpdfdestname{#3} + \ifx\pdfdestname\empty + \def\pdfdestname{#4}% + \fi + % + \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A + << /S /GoTo /D (\pdfdestname) >> >> }% + } + % + \def\pdfmakeoutlines{% + \begingroup + % + % For XeTeX, counts of subentries are not necessary. + % Therefore, we read toc only once. + % + % We use node names as destinations. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{1}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{2}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{3}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{4}{##3}{##4}}% + % + \let\appentry\numchapentry% + \let\appsecentry\numsecentry% + \let\appsubsecentry\numsubsecentry% + \let\appsubsubsecentry\numsubsubsecentry% + \let\unnchapentry\numchapentry% + \let\unnsecentry\numsecentry% + \let\unnsubsecentry\numsubsecentry% + \let\unnsubsubsecentry\numsubsubsecentry% + % + % For XeTeX, xdvipdfmx converts strings to UTF-16. + % Therefore, the encoding and the language may not be considered. + % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] -% Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf. -\newfam\sffam -\def\sf{\fam=\sffam \setfontstyle{sf}} -\let\li = \sf % Sometimes we call it \li, not \sf. + \special{pdf:docview << /PageMode /UseOutlines >> } + % ``\special{pdf:tounicode ...}'' is not necessary + % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it. + % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, + % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. + % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). +% + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \special{pdf:bann << /Border [0 0 0] + /Subtype /Link /A << /S /URI /URI (#1) >> >>}% + \endgroup} + \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \special{pdf:bann << /Border [0 0 0] + /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +% + % + % @image support + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\doxeteximage#1#2#3{% + \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\xeteximgext=\empty + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errmessage{Could not find image file #1 for XeTeX}% + \else \gdef\xeteximgext{JPG}% + \fi + \else \gdef\xeteximgext{jpeg}% + \fi + \else \gdef\xeteximgext{jpg}% + \fi + \else \gdef\xeteximgext{png}% + \fi + \else \gdef\xeteximgext{PDF}% + \fi + \else \gdef\xeteximgext{pdf}% + \fi + \closein 1 + \endgroup + % + \def\xetexpdfext{pdf}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \def\xetexpdfext{PDF}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \XeTeXpicfile "#1".\xeteximgext "" + \fi + \fi + \ifdim \wd0 >0pt width \xeteximagewidth \fi + \ifdim \wd2 >0pt height \xeteximageheight \fi \relax + } +\fi -% We don't need math for this font style. -\def\ttsl{\setfontstyle{ttsl}} +% +\message{fonts,} % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers @@ -1822,8 +2202,10 @@ end % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defsl\slshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} +\def\df{\let\ttfont=\deftt \let\bffont = \defbf +\let\ttslfont=\defttsl \let\slfont=\defsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} @@ -1853,6 +2235,20 @@ end \font\smallersy=cmsy8 \def\smallerecsize{0800} +% Fonts for math mode superscripts (7pt). +\def\sevennominalsize{7pt} +\setfont\sevenrm\rmshape{7}{1000}{OT1} +\setfont\seventt\ttshape{10}{700}{OT1TT} +\setfont\sevenbf\bfshape{10}{700}{OT1} +\setfont\sevenit\itshape{7}{1000}{OT1IT} +\setfont\sevensl\slshape{10}{700}{OT1} +\setfont\sevensf\sfshape{10}{700}{OT1} +\setfont\sevensc\scshape{10}{700}{OT1} +\setfont\seventtsl\ttslshape{10}{700}{OT1TT} +\font\seveni=cmmi7 +\font\sevensy=cmsy7 +\def\sevenecsize{0700} + % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} @@ -1884,6 +2280,7 @@ end % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} @@ -1909,7 +2306,7 @@ end \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} -% Reduced fonts for @acro in text (10pt). +% Reduced fonts for @acronym in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} @@ -1953,8 +2350,10 @@ end % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defsl\slshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} +\def\df{\let\ttfont=\deftt \let\bffont = \defbf +\let\slfont=\defsl \let\ttslfont=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} @@ -1984,6 +2383,20 @@ end \font\smallersy=cmsy8 \def\smallerecsize{0800} +% Fonts for math mode superscripts (7pt). +\def\sevennominalsize{7pt} +\setfont\sevenrm\rmshape{7}{1000}{OT1} +\setfont\seventt\ttshape{10}{700}{OT1TT} +\setfont\sevenbf\bfshape{10}{700}{OT1} +\setfont\sevenit\itshape{7}{1000}{OT1IT} +\setfont\sevensl\slshape{10}{700}{OT1} +\setfont\sevensf\sfshape{10}{700}{OT1} +\setfont\sevensc\scshape{10}{700}{OT1} +\setfont\seventtsl\ttslshape{10}{700}{OT1TT} +\font\seveni=cmmi7 +\font\sevensy=cmsy7 +\def\sevenecsize{0700} + % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} @@ -2040,7 +2453,7 @@ end \font\ssecsy=cmsy10 \def\ssececsize{1000} -% Reduced fonts for @acro in text (9pt). +% Reduced fonts for @acronym in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} @@ -2060,6 +2473,12 @@ end \rm } % end of 10pt text font size definitions, \definetextfontsizex +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + % We provide the user-level command % @fonttextsize 10 @@ -2086,102 +2505,121 @@ end \endgroup } +% +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname #1font\endcsname % change the current font +} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + % In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. Since -% texinfo doesn't allow for producing subscripts and superscripts except -% in the main text, we don't bother to reset \scriptfont and -% \scriptscriptfont (which would also require loading a lot more fonts). +% we have to define the \textfont of the standard families. +% We don't bother to reset \scriptscriptfont; awaiting user need. % \def\resetmathfonts{% - \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy - \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf - \textfont\ttfam=\tentt \textfont\sffam=\tensf + \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont + \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont + \textfont\ttfam=\ttfont \textfont\sffam=\sffont + % + % Fonts for superscript. Note that the 7pt fonts are used regardless + % of the current font size. + \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy + \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl + \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt + \scriptfont\sffam=\sevensf } -% The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this because \STYLE needs to also set the -% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire -% \tenSTYLE to set the current font. +% + +% The font-changing commands (all called \...fonts) redefine the meanings +% of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs +% to also set the current \fam for math mode. Our \STYLE (e.g., \rm) +% commands hardwire \STYLEfont to set the current font. +% +% The fonts used for \ifont are for "math italics" (\itfont is for italics +% in regular text). \syfont is also used in math mode only. % % Each font-changing command also sets the names \lsize (one size lower) -% and \lllsize (three sizes lower). These relative commands are used in -% the LaTeX logo and acronyms. +% and \lllsize (three sizes lower). These relative commands are used +% in, e.g., the LaTeX logo and acronyms. % % This all needs generalizing, badly. % -\def\textfonts{% - \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl - \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy - \let\tenttsl=\textttsl - \def\curfontsize{text}% - \def\lsize{reduced}\def\lllsize{smaller}% - \resetmathfonts \setleading{\textleading}} -\def\titlefonts{% - \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl - \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc - \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy - \let\tenttsl=\titlettsl - \def\curfontsize{title}% - \def\lsize{chap}\def\lllsize{subsec}% - \resetmathfonts \setleading{27pt}} -\def\titlefont#1{{\titlefonts\rmisbold #1}} -\def\chapfonts{% - \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl - \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy - \let\tenttsl=\chapttsl - \def\curfontsize{chap}% - \def\lsize{sec}\def\lllsize{text}% - \resetmathfonts \setleading{19pt}} -\def\secfonts{% - \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl - \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy - \let\tenttsl=\secttsl - \def\curfontsize{sec}% - \def\lsize{subsec}\def\lllsize{reduced}% - \resetmathfonts \setleading{16pt}} -\def\subsecfonts{% - \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl - \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy - \let\tenttsl=\ssecttsl - \def\curfontsize{ssec}% - \def\lsize{text}\def\lllsize{small}% - \resetmathfonts \setleading{15pt}} -\let\subsubsecfonts = \subsecfonts -\def\reducedfonts{% - \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl - \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc - \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy - \let\tenttsl=\reducedttsl - \def\curfontsize{reduced}% - \def\lsize{small}\def\lllsize{smaller}% - \resetmathfonts \setleading{10.5pt}} -\def\smallfonts{% - \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl - \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc - \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy - \let\tenttsl=\smallttsl - \def\curfontsize{small}% - \def\lsize{smaller}\def\lllsize{smaller}% - \resetmathfonts \setleading{10.5pt}} -\def\smallerfonts{% - \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl - \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc - \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy - \let\tenttsl=\smallerttsl - \def\curfontsize{smaller}% - \def\lsize{smaller}\def\lllsize{smaller}% - \resetmathfonts \setleading{9.5pt}} -% Fonts for short table of contents. -\setfont\shortcontrm\rmshape{12}{1000}{OT1} -\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 -\setfont\shortcontsl\slshape{12}{1000}{OT1} -\setfont\shortconttt\ttshape{12}{1000}{OT1TT} +\def\assignfonts#1{% + \expandafter\let\expandafter\rmfont\csname #1rm\endcsname + \expandafter\let\expandafter\itfont\csname #1it\endcsname + \expandafter\let\expandafter\slfont\csname #1sl\endcsname + \expandafter\let\expandafter\bffont\csname #1bf\endcsname + \expandafter\let\expandafter\ttfont\csname #1tt\endcsname + \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname + \expandafter\let\expandafter\sffont \csname #1sf\endcsname + \expandafter\let\expandafter\ifont \csname #1i\endcsname + \expandafter\let\expandafter\syfont \csname #1sy\endcsname + \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname +} + +\newif\ifrmisbold + +% Select smaller font size with the current style. Used to change font size +% in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for +% normal roman text, also use bold fonts for roman text in the smaller size. +\def\switchtolllsize{% + \expandafter\assignfonts\expandafter{\lllsize}% + \ifrmisbold + \let\rmfont\bffont + \fi + \csname\curfontstyle\endcsname +}% + +\def\switchtolsize{% + \expandafter\assignfonts\expandafter{\lsize}% + \ifrmisbold + \let\rmfont\bffont + \fi + \csname\curfontstyle\endcsname +}% + +\def\definefontsetatsize#1#2#3#4#5{% +\expandafter\def\csname #1fonts\endcsname{% + \def\curfontsize{#1}% + \def\lsize{#2}\def\lllsize{#3}% + \csname rmisbold#5\endcsname + \assignfonts{#1}% + \resetmathfonts + \setleading{#4}% +}} + +\definefontsetatsize{text} {reduced}{smaller}{\textleading}{false} +\definefontsetatsize{title} {chap} {subsec} {27pt} {true} +\definefontsetatsize{chap} {sec} {text} {19pt} {true} +\definefontsetatsize{sec} {subsec} {reduced}{17pt} {true} +\definefontsetatsize{ssec} {text} {small} {15pt} {true} +\definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false} +\definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false} +\definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false} + +\def\titlefont#1{{\titlefonts\rm #1}} +\let\subsecfonts = \ssecfonts +\let\subsubsecfonts = \ssecfonts % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} @@ -2219,26 +2657,11 @@ end % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost -% style and the set of \ifmarkupSTYLE switches for all styles -% currently in effect. -\newif\ifmarkupvar -\newif\ifmarkupsamp -\newif\ifmarkupkey -%\newif\ifmarkupfile % @file == @samp. -%\newif\ifmarkupoption % @option == @samp. -\newif\ifmarkupcode -\newif\ifmarkupkbd -%\newif\ifmarkupenv % @env == @code. -%\newif\ifmarkupcommand % @command == @code. -\newif\ifmarkuptex % @tex (and part of @math, for now). -\newif\ifmarkupexample -\newif\ifmarkupverb -\newif\ifmarkupverbatim +% style. \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% - \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } @@ -2300,11 +2723,15 @@ end % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% - \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax - \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax - '% + \ifmonospace + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi \else \char'15 \fi - \else \char'15 \fi + \else + '% + \fi } % % and a similar option for the left quote char vs. a grave accent. @@ -2312,13 +2739,17 @@ end % the code environments to do likewise. % \def\codequoteleft{% - \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax - \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax - % [Knuth] pp. 380,381,391 - % \relax disables Spanish ligatures ?` and !` of \tt font. - \relax`% + \ifmonospace + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi \else \char'22 \fi - \else \char'22 \fi + \else + \relax`% + \fi } % Commands to set the quote options. @@ -2377,8 +2808,10 @@ end \ifx\next,% \else\ifx\next-% \else\ifx\next.% + \else\ifx\next\.% + \else\ifx\next\comma% \else\ptexslash - \fi\fi\fi + \fi\fi\fi\fi\fi \aftersmartic } @@ -2426,8 +2859,8 @@ end % \catcode`@=11 \def\plainfrenchspacing{% - \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m - \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m + \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% @@ -2475,14 +2908,14 @@ end } % We *must* turn on hyphenation at `-' and `_' in @code. +% (But see \codedashfinish below.) % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate at a dash. -% -- rms. +% and arrange explicitly to hyphenate at a dash. -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active @@ -2499,14 +2932,35 @@ end \let-\normaldash \let_\realunder \fi - \codex + % Given -foo (with a single dash), we do not want to allow a break + % after the hyphen. + \global\let\codedashprev=\codedash + % + \codex + } + % + \gdef\codedash{\futurelet\next\codedashfinish} + \gdef\codedashfinish{% + \normaldash % always output the dash character itself. + % + % Now, output a discretionary to allow a line break, unless + % (a) the next character is a -, or + % (b) the preceding character is a -. + % E.g., given --posix, we do not want to allow a break after either -. + % Given --foo-bar, we do want to allow a break between the - and the b. + \ifx\next\codedash \else + \ifx\codedashprev\codedash + \else \discretionary{}{}{}\fi + \fi + % we need the space after the = for the case when \next itself is a + % space token; it would get swallowed otherwise. As in @code{- a}. + \global\let\codedashprev= \next } } - +\def\normaldash{-} +% \def\codex #1{\tclose{#1}\endgroup} -\def\normaldash{-} -\def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) @@ -2548,37 +3002,21 @@ end \let\file=\code \let\option=\code -% @uref (abbreviation for `urlref') takes an optional (comma-separated) -% second argument specifying the text to display and an optional third -% arg as text to display instead of (rather than in addition to) the url -% itself. First (mandatory) arg is the url. -% (This \urefnobreak definition isn't used now, leaving it for a while -% for comparison.) -\def\urefnobreak#1{\dourefnobreak #1,,,\finish} -\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup - \unsepspaces - \pdfurl{#1}% - \setbox0 = \hbox{\ignorespaces #3}% - \ifdim\wd0 > 0pt - \unhbox0 % third arg given, show only that - \else - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0 > 0pt - \ifpdf - \unhbox0 % PDF: 2nd arg given, show only it - \else - \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url - \fi - \else - \code{#1}% only url given, so show it - \fi - \fi - \endlink -\endgroup} +% @uref (abbreviation for `urlref') aka @url takes an optional +% (comma-separated) second argument specifying the text to display and +% an optional third arg as text to display instead of (rather than in +% addition to) the url itself. First (mandatory) arg is the url. + +% TeX-only option to allow changing PDF output to show only the second +% arg (if given), and not the url (which is then just the link target). +\newif\ifurefurlonlylink -% This \urefbreak definition is the active one. +% The main macro is \urefbreak, which allows breaking at expected +% places within the url. (There used to be another version, which +% didn't support automatic breaking.) \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak +% \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces @@ -2587,12 +3025,32 @@ end \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else - \setbox0 = \hbox{\ignorespaces #2}% + \setbox0 = \hbox{\ignorespaces #2}% look for second arg \ifdim\wd0 > 0pt \ifpdf - \unhbox0 % PDF: 2nd arg given, show only it + % For pdfTeX and LuaTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg + \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. + \unhbox0\ (\urefcode{#1})% + \fi \else - \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url + \ifx\XeTeXrevision\thisisundefined + \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \else + % For XeTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg + \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. + \unhbox0\ (\urefcode{#1})% + \fi + \fi \fi \else \urefcode{#1}% only url given, so show it @@ -2603,9 +3061,9 @@ end % Allow line breaks around only a few characters (only). \def\urefcatcodes{% - \catcode\ampChar=\active \catcode\dotChar=\active - \catcode\hashChar=\active \catcode\questChar=\active - \catcode\slashChar=\active + \catcode`\&=\active \catcode`\.=\active + \catcode`\#=\active \catcode`\?=\active + \catcode`\/=\active } { \urefcatcodes @@ -2632,8 +3090,10 @@ end % we put a little stretch before and after the breakable chars, to help % line breaking of long url's. The unequal skips make look better in % cmtt at least, especially for dots. -\def\urefprestretch{\urefprebreak \hskip0pt plus.13em } -\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } +\def\urefprestretchamount{.13em} +\def\urefpoststretchamount{.1em} +\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax} +\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax} % \def\urefcodeamp{\urefprestretch \&\urefpoststretch} \def\urefcodedot{\urefprestretch .\urefpoststretch} @@ -2691,7 +3151,18 @@ end \endlink \endgroup} \else - \let\email=\uref + \ifx\XeTeXrevision\thisisundefined + \let\email=\uref + \else + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} + \fi \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), @@ -2760,18 +3231,13 @@ end % \def\dmn#1{\thinspace #1} -% @l was never documented to mean ``switch to the Lisp font'', -% and it is not used as such in any manual I can find. We need it for -% Polish suppressed-l. --karl, 22sep96. -%\def\l#1{{\li #1}\null} - % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% - {\selectfonts\lsize #1}% + {\switchtolsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% @@ -2817,21 +3283,24 @@ end \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% - \tex - \mathunderscore - \let\\ = \mathbackslash - \mathactive - % make the texinfo accent commands work in math mode - \let\"=\ddot - \let\'=\acute - \let\==\bar - \let\^=\hat - \let\`=\grave - \let\u=\breve - \let\v=\check - \let\~=\tilde - \let\dotaccent=\dot - $\finishmath + \ifmmode\else % only go into math if not in math mode already + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + % have to provide another name for sup operator + \let\mathopsup=\sup + $\expandafter\finishmath\fi } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. @@ -2854,8 +3323,17 @@ end } } -% ctrl is no longer a Texinfo command, but leave this definition for fun. -\def\ctrl #1{{\tt \rawbackslash \hat}#1} +% for @sub and @sup, if in math mode, just do a normal sub/superscript. +% If in text, use math to place as sub/superscript, but switch +% into text mode, with smaller fonts. This is a different font than the +% one used for real math sub/superscripts (8pt vs. 7pt), but let's not +% fix it (significant additions to font machinery) until someone notices. +% +\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} +\def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}% +% +\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} +\def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, @@ -2868,6 +3346,15 @@ end \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } +% +% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if +% FMTNAME is tex, else ELSE-TEXT. +\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} +\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi +} +% % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being @@ -2884,6 +3371,23 @@ end \endgroup % close group opened by \tex. } +% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. +% +\long\def\inlineifset#1{\doinlineifset #1,\finish} +\long\def\doinlineifset#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax + \else\ignorespaces#2\fi +} + +% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. +% +\long\def\inlineifclear#1{\doinlineifclear #1,\finish} +\long\def\doinlineifclear#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi +} + \message{glyphs,} % and logos. @@ -2893,23 +3397,10 @@ end \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. -% Unless we're in typewriter, use \ecfont because the CM text fonts do -% not have braces, and we don't want to switch into math. -\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} -\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} -\let\{=\mylbrace \let\lbracechar=\{ -\let\}=\myrbrace \let\rbracechar=\} -\begingroup - % Definitions to produce \{ and \} commands for indices, - % and @{ and @} for the aux/toc files. - \catcode`\{ = \other \catcode`\} = \other - \catcode`\[ = 1 \catcode`\] = 2 - \catcode`\! = 0 \catcode`\\ = \other - !gdef!lbracecmd[\{]% - !gdef!rbracecmd[\}]% - !gdef!lbraceatcmd[@{]% - !gdef!rbraceatcmd[@}]% -!endgroup +\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} +\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} +\let\{=\lbracechar +\let\}=\rbracechar % @comma{} to avoid , parsing problems. \let\comma = , @@ -2927,8 +3418,8 @@ end % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} -\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} -\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} +\def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} @@ -2957,12 +3448,12 @@ end {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt - % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. + % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. - \selectfonts\lllsize A% + \switchtolllsize A% \fi }% \vss @@ -2971,11 +3462,16 @@ end \TeX } -% Some math mode symbols. -\def\bullet{$\ptexbullet$} -\def\geq{\ifmmode \ge\else $\ge$\fi} -\def\leq{\ifmmode \le\else $\le$\fi} -\def\minus{\ifmmode -\else $-$\fi} +% Some math mode symbols. Define \ensuremath to switch into math mode +% unless we are already there. Expansion tricks may not be needed here, +% but safer, and can't hurt. +\def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi} +\def\ensuredmath#1{$\relax#1$} +% +\def\bullet{\ensuremath\ptexbullet} +\def\geq{\ensuremath\ge} +\def\leq{\ensuremath\le} +\def\minus{\ensuremath-} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm @@ -3023,7 +3519,7 @@ end % \newbox\errorbox % -{\tentt \global\dimen0 = 3em}% Width of the box. +{\ttfont \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} @@ -3139,8 +3635,15 @@ end \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % -% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. -\def\ecfont{% +% Use the European Computer Modern fonts (cm-super in outline format) +% for non-CM glyphs. That is ec* for regular text and tc* for the text +% companion symbols (LaTeX TS1 encoding). Both are part of the ec +% package and follow the same conventions. +% +\def\ecfont{\etcfont{e}} +\def\tcfont{\etcfont{t}} +% +\def\etcfont#1{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so @@ -3149,14 +3652,14 @@ end \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: - \font\thisecfont = ectt\ecsize \space at \nominalsize + \font\thisecfont = #1ctt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: - \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: - \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont @@ -3167,7 +3670,7 @@ end % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% - $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}% \hfil\crcr\Orb}}% }$% } @@ -3200,13 +3703,16 @@ end \newif\ifseenauthor \newif\iffinishedtitlepage -% Do an implicit @contents or @shortcontents after @end titlepage if the -% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. -% -\newif\ifsetcontentsaftertitlepage - \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue -\newif\ifsetshortcontentsaftertitlepage - \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue +% @setcontentsaftertitlepage used to do an implicit @contents or +% @shortcontents after @end titlepage, but it is now obsolete. +\def\setcontentsaftertitlepage{% + \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo + command; move your @contents command if you want the contents + after the title page.}}% +\def\setshortcontentsaftertitlepage{% + \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo + command; move your @shortcontents and @contents commands if you + want the contents after the title page.}}% \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% @@ -3248,20 +3754,6 @@ end % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon - % - % If they want short, they certainly want long too. - \ifsetshortcontentsaftertitlepage - \shortcontents - \contents - \global\let\shortcontents = \relax - \global\let\contents = \relax - \fi - % - \ifsetcontentsaftertitlepage - \contents - \global\let\contents = \relax - \global\let\shortcontents = \relax - \fi } \def\finishtitlepage{% @@ -3272,12 +3764,11 @@ end % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used -% inside a \vbox, and fonts need to be set appropriately first. Because -% it is always used for titles, nothing else, we call \rmisbold. \par -% should be specified before the end of the \vbox, since a vbox is a group. +% inside a \vbox, and fonts need to be set appropriately first. \par should +% be specified before the end of the \vbox, since a vbox is a group. % \def\raggedtitlesettings{% - \rmisbold + \rm \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 @@ -3286,7 +3777,7 @@ end % Macros to be used within @titlepage: -\let\subtitlerm=\tenrm +\let\subtitlerm=\rmfont \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% @@ -3312,7 +3803,7 @@ end \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi - {\secfonts\rmisbold \leftline{#1}}% + {\secfonts\rm \leftline{#1}}% \fi } @@ -3326,7 +3817,7 @@ end \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages -% Now make TeX use those variables +% Now make \makeheadline and \makefootline in Plain TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline @@ -3365,7 +3856,7 @@ end % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. - \global\advance\pageheight by -12pt + \global\advance\txipageheight by -12pt \global\advance\vsize by -12pt } @@ -3382,13 +3873,17 @@ end % @everyheadingmarks % @everyfootingmarks +% These define \getoddheadingmarks, \getevenheadingmarks, +% \getoddfootingmarks, and \getevenfootingmarks, each to one of +% \gettopheadingmarks, \getbottomheadingmarks. +% \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} -\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} +\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } -\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} +\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% @@ -3409,7 +3904,7 @@ end % By default, they are off at the start of a document, % and turned `on' after @end titlepage. -\def\headings #1 {\csname HEADINGS#1\endcsname} +\parseargdef\headings{\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% @@ -3429,7 +3924,7 @@ end \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager @@ -3440,8 +3935,8 @@ end \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} @@ -3452,7 +3947,7 @@ end \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } @@ -3460,8 +3955,8 @@ end \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chappager } @@ -3639,7 +4134,7 @@ end \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % - % Try typesetting the item mark that if the document erroneously says + % Try typesetting the item mark so that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if @@ -3671,7 +4166,12 @@ end \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % - \vadjust{\penalty 1200}}% not good to break after first line of item. + \ifinner\else + \vadjust{\penalty 1200}% not good to break after first line of item. + \fi + % We can be in inner vertical mode in a footnote, although an + % @itemize looks awful there. + }% \flushcr } @@ -3889,19 +4389,23 @@ end } % multitable-only commands. -% -% @headitem starts a heading row, which we typeset in bold. -% Assignments have to be global since we are inside the implicit group -% of an alignment entry. \everycr resets \everytab so we don't have to +% +% @headitem starts a heading row, which we typeset in bold. Assignments +% have to be global since we are inside the implicit group of an +% alignment entry. \everycr below resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr + \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % +% default for tables with no headings. +\let\headitemcrhook=\relax +% % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. @@ -3932,15 +4436,15 @@ end % \everycr = {% \noalign{% - \global\everytab={}% + \global\everytab={}% Reset from possible headitem. \global\colcount=0 % Reset the column counter. - % Check for saved footnotes, etc. + % + % Check for saved footnotes, etc.: \checkinserts - % Keeps underfull box messages off when table breaks over pages. - %\filbreak - % Maybe so, but it also creates really weird page breaks when the - % table breaks over pages. Wouldn't \vfil be better? Wait until the - % problem manifests itself, so it can be fixed for real --karl. + % + % Perhaps a \nobreak, then reset: + \headitemcrhook + \global\let\headitemcrhook=\relax }% }% % @@ -4179,7 +4683,7 @@ end \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { - \catcode`\- = \active \catcode`\_ = \active + \catcode`\-=\active \catcode`\_=\active % \gdef\makevalueexpandable{% \let\value = \expandablevalue @@ -4199,7 +4703,12 @@ end % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). -% +% +% Unfortunately, this has the consequence that when _ is in the *value* +% of an @set, it does not print properly in the roman fonts (get the cmr +% dot accent at position 126 instead). No fix comes to mind, and it's +% been this way since 2003 or earlier, so just ignore it. +% \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% @@ -4209,10 +4718,36 @@ end \fi } +% Like \expandablevalue, but completely expandable (the \message in the +% definition above operates at the execution level of TeX). Used when +% writing to auxiliary files, due to the expansion that \write does. +% If flag is undefined, pass through an unexpanded @value command: maybe it +% will be set by the time it is read back in. +% +% NB flag names containing - or _ may not work here. +\def\dummyvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \noexpand\value{#1}% + \else + \csname SET#1\endcsname + \fi +} + +% Used for @value's in index entries to form the sort key: expand the @value +% if possible, otherwise sort late. +\def\indexnofontsvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + ZZZZZZZ + \else + \csname SET#1\endcsname + \fi +} + % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. -% -% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +% To get the special treatment we need for `@end ifset,' we call +% \makecond and then redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} @@ -4283,19 +4818,16 @@ end % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} -% \newindex {foo} defines an index named foo. -% It automatically defines \fooindex such that -% \fooindex ...rest of line... puts an entry in the index foo. -% It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. +% \newindex {foo} defines an index named IX. +% It automatically defines \IXindex such that +% \IXindex ...rest of line... puts an entry in the index IX. +% It also defines \IXindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is IX. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - \fi + \expandafter\chardef\csname#1indfile\endcsname=0 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } @@ -4309,14 +4841,19 @@ end \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 - \fi + \expandafter\chardef\csname#1indfile\endcsname=0 \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } +% The default indices: +\newindex{cp}% concepts, +\newcodeindex{fn}% functions, +\newcodeindex{vr}% variables, +\newcodeindex{tp}% types, +\newcodeindex{ky}% keys +\newcodeindex{pg}% and programs. + % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. @@ -4330,14 +4867,7 @@ end % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% - % Only do \closeout if we haven't already done it, else we'll end up - % closing the target index. - \expandafter \ifx\csname donesynindex#2\endcsname \relax - % The \closeout helps reduce unnecessary open files; the limit on the - % Acorn RISC OS is a mere 16 files. - \expandafter\closeout\csname#2indfile\endcsname - \expandafter\let\csname donesynindex#2\endcsname = 1 - \fi + \requireopenindexfile{#3}% % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp @@ -4345,108 +4875,72 @@ end \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } -% Define \doindex, the driver for all \fooindex macros. +% Define \doindex, the driver for all index macros. % Argument #1 is generated by the calling \fooindex macro, -% and it is "foo", the name of the index. +% and it is the two-letter name of the index. -% \doindex just uses \parsearg; it calls \doind for the actual work. -% This is because \doind is more useful to call from other macros. - -% There is also \dosubind {index}{topic}{subtopic} -% which makes an entry in a two-level index such as the operation index. - -\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} -\def\singleindexer #1{\doind{\indexname}{#1}} +\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} +\def\doindexxxx #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. -\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} -\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} +\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} +\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} -% Take care of Texinfo commands that can appear in an index entry. -% Since there are some commands we want to expand, and others we don't, -% we have to laboriously prevent expansion for those that we don't. + +% Used when writing an index entry out to an index file to prevent +% expansion of Texinfo commands that can appear in an index entry. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. - \def\@{@}% change to @@ when we switch to @ as escape char in index files. - \def\ {\realbackslash\space }% - % - % Need these unexpandable (because we define \tt as a dummy) - % definitions when @{ or @} appear in index entry text. Also, more - % complicated, when \tex is in effect and \{ is a \delimiter again. - % We can't use \lbracecmd and \rbracecmd because texindex assumes - % braces and backslashes are used only as delimiters. Perhaps we - % should define @lbrace and @rbrace commands a la @comma. - \def\{{{\tt\char123}}% - \def\}{{\tt\char125}}% - % - % I don't entirely understand this, but when an index entry is - % generated from a macro call, the \endinput which \scanmacro inserts - % causes processing to be prematurely terminated. This is, - % apparently, because \indexsorttmp is fully expanded, and \endinput - % is an expandable command. The redefinition below makes \endinput - % disappear altogether for that purpose -- although logging shows that - % processing continues to some further point. On the other hand, it - % seems \endinput does not hurt in the printed index arg, since that - % is still getting written without apparent harm. - % - % Sample source (mac-idx3.tex, reported by Graham Percival to - % help-texinfo, 22may06): - % @macro funindex {WORD} - % @findex xyz - % @end macro - % ... - % @funindex commtest - % - % The above is not enough to reproduce the bug, but it gives the flavor. - % - % Sample whatsit resulting: - % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} - % - % So: - \let\endinput = \empty + \definedummyletter\@% + \definedummyletter\ % + % + % For texindex which always views { and } as separators. + \def\{{\lbracechar{}}% + \def\}{\rbracechar{}}% % % Do the redefinitions. - \commondummies + \definedummies } -% For the aux and toc files, @ is the escape character. So we want to -% redefine everything using @ as the escape character (instead of -% \realbackslash, still used for index files). When everything uses @, -% this will be simpler. +% Used for the aux and toc files, where @ is the escape character. % \def\atdummies{% - \def\@{@@}% - \def\ {@ }% - \let\{ = \lbraceatcmd - \let\} = \rbraceatcmd + \definedummyletter\@% + \definedummyletter\ % + \definedummyletter\{% + \definedummyletter\}% % % Do the redefinitions. - \commondummies + \definedummies \otherbackslash } -% Called from \indexdummies and \atdummies. +% \definedummyword defines \#1 as \string\#1\space, thus effectively +% preventing its expansion. This is used only for control words, +% not control letters, because the \space would be incorrect for +% control characters, but is needed to separate the control word +% from whatever follows. % -\def\commondummies{% - % - % \definedummyword defines \#1 as \string\#1\space, thus effectively - % preventing its expansion. This is used only for control words, - % not control letters, because the \space would be incorrect for - % control characters, but is needed to separate the control word - % from whatever follows. - % - % For control letters, we have \definedummyletter, which omits the - % space. - % - % These can be used both for control words that take an argument and - % those that do not. If it is followed by {arg} in the input, then - % that will dutifully get written to the index (or wherever). - % - \def\definedummyword ##1{\def##1{\string##1\space}}% - \def\definedummyletter##1{\def##1{\string##1}}% - \let\definedummyaccent\definedummyletter +% These can be used both for control words that take an argument and +% those that do not. If it is followed by {arg} in the input, then +% that will dutifully get written to the index (or wherever). +% +% For control letters, we have \definedummyletter, which omits the +% space. +% +\def\definedummyword #1{\def#1{\string#1\space}}% +\def\definedummyletter#1{\def#1{\string#1}}% +\let\definedummyaccent\definedummyletter + +% Called from \indexdummies and \atdummies, to effectively prevent +% the expansion of commands. +% +\def\definedummies{% % + \let\commondummyword\definedummyword + \let\commondummyletter\definedummyletter + \let\commondummyaccent\definedummyaccent \commondummiesnofonts % \definedummyletter\_% @@ -4487,6 +4981,7 @@ end \definedummyword\TeX % % Assorted special characters. + \definedummyword\atchar \definedummyword\arrow \definedummyword\bullet \definedummyword\comma @@ -4506,6 +5001,7 @@ end \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq + \definedummyword\mathopsup \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds @@ -4519,88 +5015,136 @@ end \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result + \definedummyword\sub + \definedummyword\sup \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist + \let\value\dummyvalue % \normalturnoffactive - % - % Handle some cases of @value -- where it does not contain any - % (non-fully-expandable) commands. - \makevalueexpandable } -% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% \commondummiesnofonts: common to \definedummies and \indexnofonts. +% Define \commondummyletter, \commondummyaccent and \commondummyword before +% using. Used for accents, font commands, and various control letters. % \def\commondummiesnofonts{% % Control letters and accents. - \definedummyletter\!% - \definedummyaccent\"% - \definedummyaccent\'% - \definedummyletter\*% - \definedummyaccent\,% - \definedummyletter\.% - \definedummyletter\/% - \definedummyletter\:% - \definedummyaccent\=% - \definedummyletter\?% - \definedummyaccent\^% - \definedummyaccent\`% - \definedummyaccent\~% - \definedummyword\u - \definedummyword\v - \definedummyword\H - \definedummyword\dotaccent - \definedummyword\ogonek - \definedummyword\ringaccent - \definedummyword\tieaccent - \definedummyword\ubaraccent - \definedummyword\udotaccent - \definedummyword\dotless + \commondummyletter\!% + \commondummyaccent\"% + \commondummyaccent\'% + \commondummyletter\*% + \commondummyaccent\,% + \commondummyletter\.% + \commondummyletter\/% + \commondummyletter\:% + \commondummyaccent\=% + \commondummyletter\?% + \commondummyaccent\^% + \commondummyaccent\`% + \commondummyaccent\~% + \commondummyword\u + \commondummyword\v + \commondummyword\H + \commondummyword\dotaccent + \commondummyword\ogonek + \commondummyword\ringaccent + \commondummyword\tieaccent + \commondummyword\ubaraccent + \commondummyword\udotaccent + \commondummyword\dotless % % Texinfo font commands. - \definedummyword\b - \definedummyword\i - \definedummyword\r - \definedummyword\sansserif - \definedummyword\sc - \definedummyword\slanted - \definedummyword\t + \commondummyword\b + \commondummyword\i + \commondummyword\r + \commondummyword\sansserif + \commondummyword\sc + \commondummyword\slanted + \commondummyword\t % % Commands that take arguments. - \definedummyword\abbr - \definedummyword\acronym - \definedummyword\anchor - \definedummyword\cite - \definedummyword\code - \definedummyword\command - \definedummyword\dfn - \definedummyword\dmn - \definedummyword\email - \definedummyword\emph - \definedummyword\env - \definedummyword\file - \definedummyword\image - \definedummyword\indicateurl - \definedummyword\inforef - \definedummyword\kbd - \definedummyword\key - \definedummyword\math - \definedummyword\option - \definedummyword\pxref - \definedummyword\ref - \definedummyword\samp - \definedummyword\strong - \definedummyword\tie - \definedummyword\uref - \definedummyword\url - \definedummyword\var - \definedummyword\verb - \definedummyword\w - \definedummyword\xref + \commondummyword\abbr + \commondummyword\acronym + \commondummyword\anchor + \commondummyword\cite + \commondummyword\code + \commondummyword\command + \commondummyword\dfn + \commondummyword\dmn + \commondummyword\email + \commondummyword\emph + \commondummyword\env + \commondummyword\file + \commondummyword\image + \commondummyword\indicateurl + \commondummyword\inforef + \commondummyword\kbd + \commondummyword\key + \commondummyword\math + \commondummyword\option + \commondummyword\pxref + \commondummyword\ref + \commondummyword\samp + \commondummyword\strong + \commondummyword\tie + \commondummyword\U + \commondummyword\uref + \commondummyword\url + \commondummyword\var + \commondummyword\verb + \commondummyword\w + \commondummyword\xref +} + +% For testing: output @{ and @} in index sort strings as \{ and \}. +\newif\ifusebracesinindexes + +\let\indexlbrace\relax +\let\indexrbrace\relax + +{\catcode`\@=0 +\catcode`\\=13 + @gdef@backslashdisappear{@def\{}} +} + +{ +\catcode`\<=13 +\catcode`\-=13 +\catcode`\`=13 + \gdef\indexnonalnumdisappear{% + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else + % @set txiindexlquoteignore makes us ignore left quotes in the sort term. + % (Introduced for FSFS 2nd ed.) + \let`=\empty + \fi + % + \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else + \backslashdisappear + \fi + % + \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else + \def-{}% + \fi + \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else + \def<{}% + \fi + \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else + \def\@{}% + \fi + } + + \gdef\indexnonalnumreappear{% + \useindexbackslash + \let-\normaldash + \let<\normalless + \def\@{@}% + } } + % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string @@ -4608,12 +5152,11 @@ end % \def\indexnofonts{% % Accent commands should become @asis. - \def\definedummyaccent##1{\let##1\asis}% + \def\commondummyaccent##1{\let##1\asis}% % We can just ignore other control letters. - \def\definedummyletter##1{\let##1\empty}% + \def\commondummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. - \let\definedummyword\definedummyaccent - % + \let\commondummyword\commondummyaccent \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command @@ -4626,14 +5169,10 @@ end \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % - % Unfortunately, texindex is not prepared to handle braces in the - % content at all. So for index sorting, we map @{ and @} to strings - % starting with |, since that ASCII character is between ASCII { and }. - \def\{{|a}% - \def\lbracechar{|a}% - % - \def\}{|b}% - \def\rbracechar{|b}% + \uccode`\1=`\{ \uppercase{\def\{{1}}% + \uccode`\1=`\} \uppercase{\def\}{1}}% + \let\lbracechar\{% + \let\rbracechar\}% % % Non-English letters. \def\AA{AA}% @@ -4642,7 +5181,7 @@ end \def\L{L}% \def\OE{OE}% \def\O{O}% - \def\TH{ZZZ}% + \def\TH{TH}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% @@ -4654,45 +5193,45 @@ end \def\o{o}% \def\questiondown{?}% \def\ss{ss}% - \def\th{zzz}% + \def\th{th}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % - % Assorted special characters. - % (The following {} will end up in the sort string, but that's ok.) - \def\arrow{->}% - \def\bullet{bullet}% - \def\comma{,}% - \def\copyright{copyright}% - \def\dots{...}% - \def\enddots{...}% - \def\equiv{==}% - \def\error{error}% - \def\euro{euro}% - \def\expansion{==>}% - \def\geq{>=}% - \def\guillemetleft{<<}% - \def\guillemetright{>>}% - \def\guilsinglleft{<}% - \def\guilsinglright{>}% - \def\leq{<=}% - \def\minus{-}% - \def\point{.}% - \def\pounds{pounds}% - \def\print{-|}% - \def\quotedblbase{"}% - \def\quotedblleft{"}% - \def\quotedblright{"}% - \def\quoteleft{`}% - \def\quoteright{'}% - \def\quotesinglbase{,}% - \def\registeredsymbol{R}% - \def\result{=>}% - \def\textdegree{o}% - % - \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax - \else \indexlquoteignore \fi + % Assorted special characters. \defglyph gives the control sequence a + % definition that removes the {} that follows its use. + \defglyph\atchar{@}% + \defglyph\arrow{->}% + \defglyph\bullet{bullet}% + \defglyph\comma{,}% + \defglyph\copyright{copyright}% + \defglyph\dots{...}% + \defglyph\enddots{...}% + \defglyph\equiv{==}% + \defglyph\error{error}% + \defglyph\euro{euro}% + \defglyph\expansion{==>}% + \defglyph\geq{>=}% + \defglyph\guillemetleft{<<}% + \defglyph\guillemetright{>>}% + \defglyph\guilsinglleft{<}% + \defglyph\guilsinglright{>}% + \defglyph\leq{<=}% + \defglyph\lbracechar{\{}% + \defglyph\minus{-}% + \defglyph\point{.}% + \defglyph\pounds{pounds}% + \defglyph\print{-|}% + \defglyph\quotedblbase{"}% + \defglyph\quotedblleft{"}% + \defglyph\quotedblright{"}% + \defglyph\quoteleft{`}% + \defglyph\quoteright{'}% + \defglyph\quotesinglbase{,}% + \defglyph\rbracechar{\}}% + \defglyph\registeredsymbol{R}% + \defglyph\result{=>}% + \defglyph\textdegree{o}% % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. @@ -4705,21 +5244,24 @@ end % goes to end-of-line is not handled. % \macrolist + \let\value\indexnofontsvalue } +\def\defglyph#1#2{\def#1##1{#2}} % see above + + -% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us -% ignore left quotes in the sort term. -{\catcode`\`=\active - \gdef\indexlquoteignore{\let`=\empty}} -\let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} -% Workhorse for all \fooindexes. +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. +% TODO: Two-level index? Operation index? + +% Workhorse for all indexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). @@ -4727,6 +5269,7 @@ end \def\dosubind#1#2#3{% \iflinks {% + \requireopenindexfile{#1}% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. @@ -4742,7 +5285,50 @@ end \fi } -% Write the entry in \toks0 to the index file: +% Check if an index file has been opened, and if not, open it. +\def\requireopenindexfile#1{% +\ifnum\csname #1indfile\endcsname=0 + \expandafter\newwrite \csname#1indfile\endcsname + \edef\suffix{#1}% + % A .fls suffix would conflict with the file extension for the output + % of -recorder, so use .f1s instead. + \ifx\suffix\indexisfl\def\suffix{f1}\fi + % Open the file + \immediate\openout\csname#1indfile\endcsname \jobname.\suffix + % Using \immediate above here prevents an object entering into the current + % box, which could confound checks such as those in \safewhatsit for + % preceding skips. + \typeout{Writing index file \jobname.\suffix}% +\fi} +\def\indexisfl{fl} + +% Output \ as {\indexbackslash}, because \ is an escape character in +% the index files. +\let\indexbackslash=\relax +{\catcode`\@=0 \catcode`\\=\active + @gdef@useindexbackslash{@def\{{@indexbackslash}}} +} + +% Definition for writing index entry text. +\def\sortas#1{\ignorespaces}% + +% Definition for writing index entry sort key. Should occur at the at +% the beginning of the index entry, like +% @cindex @sortas{september} \september +% The \ignorespaces takes care of following space, but there's no way +% to remove space before it. +{ +\catcode`\-=13 +\gdef\indexwritesortas{% + \begingroup + \indexnonalnumreappear + \indexwritesortasxxx} +\gdef\indexwritesortasxxx#1{% + \xdef\indexsortkey{#1}\endgroup} +} + + +% Write the entry in \toks0 to the index file. % \def\dosubindwrite{% % Put the index entry in the margin if desired. @@ -4752,14 +5338,26 @@ end % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage - \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. + \useindexbackslash % \indexbackslash isn't defined now so it will be output + % as is; and it will print as backslash. + % The braces around \indexbrace are recognized by texindex. % - % Process the index entry with all font commands turned off, to - % get the string to sort by. + % Get the string to sort by, by processing the index entry with all + % font commands turned off. {\indexnofonts - \edef\temp{\the\toks0}% need full expansion - \xdef\indexsorttmp{\temp}% + \def\lbracechar{{\indexlbrace}}% + \def\rbracechar{{\indexrbrace}}% + \let\{=\lbracechar + \let\}=\rbracechar + \indexnonalnumdisappear + \xdef\indexsortkey{}% + \let\sortas=\indexwritesortas + \edef\temp{\the\toks0}% + \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas + \ifx\indexsortkey\empty + \xdef\indexsortkey{\temp}% + \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi + \fi }% % % Set up the complete index entry, with both the sort key and @@ -4769,10 +5367,11 @@ end % sorted result. \edef\temp{% \write\writeto{% - \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% }% \temp } +\newbox\dummybox % used above % Take care of unwanted page breaks/skips around a whatsit: % @@ -4897,52 +5496,113 @@ end % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). - \catcode`\@ = 11 - \openin 1 \jobname.#1s + \catcode`\@ = 12 + % See comment in \requireopenindexfile. + \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi + \openin 1 \jobname.\indexname s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent + \typeout{No file \jobname.\indexname s.}% \else + \catcode`\\ = 0 % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. - \read 1 to \temp + \read 1 to \thisline \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. - \def\indexbackslash{\backslashcurfont}% - \catcode`\\ = 0 - \escapechar = `\\ + \def\indexbackslash{\ttbackslash}% + \let\indexlbrace\{ % Likewise, set these sequences for braces + \let\indexrbrace\} % used in the sort key. \begindoublecolumns - \input \jobname.#1s + \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty + % + % Read input from the index file line by line. + \loopdo + \ifeof1 \else + \read 1 to \nextline + \fi + % + \indexinputprocessing + \thisline + % + \ifeof1\else + \let\thisline\nextline + \repeat + %% \enddoublecolumns \fi \fi \closein 1 \endgroup} +\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx} +\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next} + +\def\indexinputprocessing{% + \ifeof1 + \let\firsttoken\relax + \else + \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}% + \act + \fi +} +\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken} +\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1} + % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. -\def\initial#1{{% - % Some minor font changes for the special characters. - \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt - % +{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 +\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 +\catcode`\$=3 +\gdef\initialglyphs{% + % Some changes for non-alphabetic characters. Using the glyphs from the + % math fonts looks more consistent than the typewriter font used elsewhere + % for these characters. + \def\indexbackslash{\math{\backslash}}% + \let\\=\indexbackslash + % + % Can't get bold backslash so don't use bold forward slash + \catcode`\/=13 + \def/{{\secrmnotbold \normalslash}}% + \def-{{\normaldash\normaldash}}% en dash `--' + \def^{{\chapbf \normalcaret}}% + \def~{{\chapbf \normaltilde}}% + \def\_{% + \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% + \def|{$\vert$}% + \def<{$\less$}% + \def>{$\gtr$}% + \def+{$\normalplus$}% +}} + +\def\initial{% + \bgroup + \initialglyphs + \initialx +} + +\def\initialx#1{% % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. + % The glue before the bonus allows a little bit of space at the + % bottom of a column to reduce an increase in inter-line spacing. \nobreak - \vskip 0pt plus 3\baselineskip - \penalty 0 - \vskip 0pt plus -3\baselineskip + \vskip 0pt plus 5\baselineskip + \penalty -300 + \vskip 0pt plus -5\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column @@ -4950,63 +5610,45 @@ end % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. - \vskip 1.67\baselineskip plus .5\baselineskip - \leftline{\secbf #1}% + \vskip 1.67\baselineskip plus 1\baselineskip + \leftline{\secfonts \kern-0.05em \secbf #1}% + % \secfonts is inside the argument of \leftline so that the change of + % \baselineskip will not affect any glue inserted before the vbox that + % \leftline creates. % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip -}} + \egroup % \initialglyphs +} + +\newdimen\entryrightmargin +\entryrightmargin=0pt % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % -% A straightforward implementation would start like this: -% \def\entry#1#2{... -% But this freezes the catcodes in the argument, and can cause problems to -% @code, which sets - active. This problem was fixed by a kludge--- -% ``-'' was active throughout whole index, but this isn't really right. -% The right solution is to prevent \entry from swallowing the whole text. -% --kasal, 21nov03 \def\entry{% \begingroup % + % For pdfTeX and XeTeX. + % The redefinition of \domark stops marks being added in \pdflink to + % preserve coloured links across page boundaries. Otherwise the marks + % would get in the way of \lastbox in \insertentrybox. + \let\domark\relax + % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % - % Do not fill out the last line with white space. - \parfillskip = 0in - % % No extra space above this paragraph. \parskip = 0in % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent = 2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % A bit of stretch before each entry for the benefit of balancing - % columns. - \vskip 0pt plus1pt - % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% - \def\entrybreak{\hfil\break}% + \def\entrybreak{\hfil\break}% An undocumented command % % Swallow the left brace of the text (first parameter): \afterassignment\doentry @@ -5014,45 +5656,168 @@ end } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% + % Save the text of the entry + \global\setbox\boxA=\hbox\bgroup \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. + % Not absorbing as a macro argument reduces the chance of problems + % with catcodes occurring. } -\def\finishentry#1{% +{\catcode`\@=11 +\gdef\finishentry#1{% + \egroup % end box A + \dimen@ = \wd\boxA % Length of text of entry + \global\setbox\boxA=\hbox\bgroup\unhbox\boxA % #1 is the page number. % - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \setbox\boxA = \hbox{#1}% - \ifdim\wd\boxA = 0pt - \ % + % Get the width of the page numbers, and only use + % leaders if they are present. + \global\setbox\boxB = \hbox{#1}% + \ifdim\wd\boxB = 0pt + \null\nobreak\hfill\ % \else % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. \ifpdf - \pdfgettoks#1.% - \ \the\toksA + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA + \else + \ifx\XeTeXrevision\thisisundefined + \hskip\skip\thinshrinkable #1% + \else + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA + \fi + \fi + \fi + \egroup % end \boxA + \ifdim\wd\boxB = 0pt + \global\setbox\entrybox=\vbox{\unhbox\boxA}% + \else + \global\setbox\entrybox=\vbox\bgroup + % We want the text of the entries to be aligned to the left, and the + % page numbers to be aligned to the right. + % + \parindent = 0pt + \advance\leftskip by 0pt plus 1fil + \advance\leftskip by 0pt plus -1fill + \rightskip = 0pt plus -1fil + \advance\rightskip by 0pt plus 1fill + % Cause last line, which could consist of page numbers on their own + % if the list of page numbers is long, to be aligned to the right. + \parfillskip=0pt plus -1fill + % + \advance\rightskip by \entryrightmargin + % Determine how far we can stretch into the margin. + % This allows, e.g., "Appendix H GNU Free Documentation License" to + % fit on one line in @letterpaper format. + \ifdim\entryrightmargin>2.1em + \dimen@i=2.1em \else - \ #1% + \dimen@i=0em \fi + \advance \parfillskip by 0pt minus 1\dimen@i + % + \dimen@ii = \hsize + \advance\dimen@ii by -1\leftskip + \advance\dimen@ii by -1\entryrightmargin + \advance\dimen@ii by 1\dimen@i + \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line + \ifdim\dimen@ > 0.8\dimen@ii % due to long index text + % Try to split the text roughly evenly. \dimen@ will be the length of + % the first line. + \dimen@ = 0.7\dimen@ + \dimen@ii = \hsize + \ifnum\dimen@>\dimen@ii + % If the entry is too long (for example, if it needs more than + % two lines), use all the space in the first line. + \dimen@ = \dimen@ii + \fi + \advance\leftskip by 0pt plus 1fill % ragged right + \advance \dimen@ by 1\rightskip + \parshape = 2 0pt \dimen@ 0em \dimen@ii + % Ideally we'd add a finite glue at the end of the first line only, + % instead of using \parshape with explicit line lengths, but TeX + % doesn't seem to provide a way to do such a thing. + % + % Indent all lines but the first one. + \advance\leftskip by 1em + \advance\parindent by -1em + \fi\fi + \indent % start paragraph + \unhbox\boxA + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % Word spacing - no stretch + \spaceskip=\fontdimen2\font minus \fontdimen4\font + % + \linepenalty=1000 % Discourage line breaks. + \hyphenpenalty=5000 % Discourage hyphenation. + % + \par % format the paragraph + \egroup % The \vbox \fi - \par \endgroup + \dotheinsertentrybox +}} + +\newskip\thinshrinkable +\skip\thinshrinkable=.15em minus .15em + +\newbox\entrybox +\def\insertentrybox{% + \ourunvbox\entrybox +} + +% default definition +\let\dotheinsertentrybox\insertentrybox + +% Use \lastbox to take apart vbox box by box, and add each sub-box +% to the current vertical list. +\def\ourunvbox#1{% +\bgroup % for local binding of \delayedbox + % Remove the last box from box #1 + \global\setbox#1=\vbox{% + \unvbox#1% + \unskip % remove any glue + \unpenalty + \global\setbox\interbox=\lastbox + }% + \setbox\delayedbox=\box\interbox + \ifdim\ht#1=0pt\else + \ourunvbox#1 % Repeat on what's left of the box + \nobreak + \fi + \box\delayedbox +\egroup +} +\newbox\delayedbox +\newbox\interbox + +% Used from \printindex. \firsttoken should be the first token +% after the \entry. If it's not another \entry, we are at the last +% line of a group of index entries, so insert a penalty to discourage +% widowed index entries. +\def\dotheinsertentryboxwithpenalty{% + \ifx\firsttoken\isentry + \else + \penalty 9000 + \fi + \insertentrybox } +\def\isentry{\entry}% % Like plain.tex's \dotfill, except uses up at least 1 em. +% The filll stretch here overpowers both the fil and fill stretch to push +% the page number to the right. \def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} + \def\primary #1{\line{#1\hfil}} @@ -5066,7 +5831,11 @@ end \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else - #2 + \ifx\XeTeXrevision\thisisundefined + #2 + \else + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \fi \fi \par }} @@ -5074,12 +5843,37 @@ end % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. -\catcode`\@=11 +\catcode`\@=11 % private names \newbox\partialpage \newdimen\doublecolumnhsize +% Use inside an output routine to save \topmark and \firstmark +\def\savemarks{% + \global\savedtopmark=\expandafter{\topmark }% + \global\savedfirstmark=\expandafter{\firstmark }% +} +\newtoks\savedtopmark +\newtoks\savedfirstmark + +% Set \topmark and \firstmark for next time \output runs. +% Can't be run from withinside \output (because any material +% added while an output routine is active, including +% penalties, is saved for after it finishes). The page so far +% should be empty, otherwise what's on it will be thrown away. +\def\restoremarks{% + \mark{\the\savedtopmark}% + \bgroup\output = {% + \setbox\dummybox=\box\PAGE + }abc\eject\egroup + % "abc" because output routine doesn't fire for a completely empty page. + \mark{\the\savedfirstmark}% +} + \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % If not much space left on page, start a new page. + \ifdim\pagetotal>0.8\vsize\vfill\eject\fi + % % Grab any single-column material above us. \output = {% % @@ -5099,8 +5893,15 @@ end \unvbox\PAGE \kern-\topskip \kern\baselineskip }% + \savemarks }% \eject % run that output routine to set \partialpage + \restoremarks + % + % We recover the two marks that the last output routine saved in order + % to propagate the information in marks added around a chapter heading, + % which could be otherwise be lost by the time the final page is output. + % % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% @@ -5126,27 +5927,31 @@ end \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % - % Double the \vsize as well. (We don't need a separate register here, - % since nobody clobbers \vsize.) + % Double the \vsize as well. + \advance\vsize by -\ht\partialpage \vsize = 2\vsize + % + % For the benefit of balancing columns + \advance\baselineskip by 0pt plus 0.5pt } % The double-column output routine for all double-column pages except -% the last. +% the last, which is done by \balancecolumns. % \def\doublecolumnout{% + % \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 - \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. - \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ + \global\advance\vsize by 2\ht\partialpage \onepageout\pagesofar - \unvbox255 + \unvbox\PAGE \penalty\outputpenalty } % @@ -5157,10 +5962,11 @@ end % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize - \hbox to\pagewidth{\box0\hfil\box2}% + \hbox to\txipagewidth{\box0\hfil\box2}% } -% -% All done with double columns. + + +% Finished with with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the @@ -5183,7 +5989,7 @@ end % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns - % and the final section into the vbox of \pageheight (see + % and the final section into the vbox of \txipageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the @@ -5191,53 +5997,88 @@ end \penalty0 % \output = {% - % Split the last of the double-column material. Leave it on the - % current page, no automatic page break. + % Split the last of the double-column material. + \savemarks \balancecolumns - % - % If we end up splitting too much material for the current page, - % though, there will be another page break right after this \output - % invocation ends. Having called \balancecolumns once, we do not + }% + \eject % call the \output just set + \ifdim\pagetotal=0pt + % Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal - % definition right away. (We hope \balancecolumns will never be - % called on to balance too much material, but if it is, this makes - % the output somewhat more palatable.) + % definition right away. \global\output = {\onepageout{\pagecontents\PAGE}}% - }% - \eject - \endgroup % started in \begindoublecolumns - % - % \pagegoal was set to the doubled \vsize above, since we restarted - % the current page. We're now back to normal single-column - % typesetting, so reset \pagegoal to the normal \vsize (after the - % \endgroup where \vsize got restored). - \pagegoal = \vsize + % + \endgroup % started in \begindoublecolumns + \restoremarks + % Leave the double-column material on the current page, no automatic + % page break. + \box\balancedcolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize. + \global\vsize = \txipageheight % + \pagegoal = \txipageheight % + \else + % We had some left-over material. This might happen when \doublecolumnout + % is called in \balancecolumns. Try again. + \expandafter\enddoublecolumns + \fi } +\newbox\balancedcolumns +\setbox\balancedcolumns=\vbox{shouldnt see this}% % -% Called at the end of the double column material. +% Only called for the last of the double column material. \doublecolumnout +% does the others. \def\balancecolumns{% - \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by 2 % target to split to - %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% - \splittopskip = \topskip - % Loop until we get a decent breakpoint. - {% - \vbadness = 10000 - \loop - \global\setbox3 = \copy0 - \global\setbox1 = \vsplit3 to \dimen@ - \ifdim\ht3>\dimen@ - \global\advance\dimen@ by 1pt - \repeat - }% - %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% - \setbox0=\vbox to\dimen@{\unvbox1}% - \setbox2=\vbox to\dimen@{\unvbox3}% + \ifdim\dimen@<5\baselineskip + % Don't split a short final column in two. + \setbox2=\vbox{}% + \global\setbox\balancedcolumns=\vbox{\pagesofar}% + \else + \divide\dimen@ by 2 % target to split to + \dimen@ii = \dimen@ + \splittopskip = \topskip + % Loop until left column is at least as high as the right column. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht1<\ht3 + \global\advance\dimen@ by 1pt + \repeat + }% + % Now the left column is in box 1, and the right column in box 3. + % + % Check whether the left column has come out higher than the page itself. + % (Note that we have doubled \vsize for the double columns, so + % the actual height of the page is 0.5\vsize). + \ifdim2\ht1>\vsize + % It appears that we have been called upon to balance too much material. + % Output some of it with \doublecolumnout, leaving the rest on the page. + \setbox\PAGE=\box0 + \doublecolumnout + \else + % Compare the heights of the two columns. + \ifdim4\ht1>5\ht3 + % Column heights are too different, so don't make their bottoms + % flush with each other. + \setbox2=\vbox to \ht1 {\unvbox3\vfill}% + \setbox0=\vbox to \ht1 {\unvbox1\vfill}% + \else + % Make column bottoms flush with each other. + \setbox2=\vbox to\ht1{\unvbox3\unskip}% + \setbox0=\vbox to\ht1{\unvbox1\unskip}% + \fi + \global\setbox\balancedcolumns=\vbox{\pagesofar}% + \fi + \fi % - \pagesofar } \catcode`\@ = \other @@ -5252,10 +6093,14 @@ end \null \vskip.3\vsize % move it down on the page a bit \begingroup - \noindent \titlefonts\rmisbold #1\par % the text + \noindent \titlefonts\rm #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page + % This outputs a mark at the end of the page that clears \thischapter + % and \thissection, as is done in \startcontents. + \let\pchapsepmacro\relax + \chapmacro{}{Yomitfromtoc}{}% \chapoddpage \endgroup } @@ -5500,9 +6345,6 @@ end % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% - % Well, we could do the following in a group, but that would break - % an assumption that \chapmacro is called at the outermost level. - % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax @@ -5626,7 +6468,11 @@ end % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} + +% Start a new page \def\chappager{\par\vfill\supereject} + +% \chapoddpage - start on an odd page for a new chapter % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. @@ -5641,7 +6487,7 @@ end \fi } -\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} +\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager @@ -5662,17 +6508,26 @@ end \CHAPPAGon -% Chapter opening. +% \chapmacro - Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. +% Not used for @heading series. % % To test against our argument. \def\Ynothingkeyword{Ynothing} -\def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} +\def\Yomitfromtockeyword{Yomitfromtoc} % \def\chapmacro#1#2#3{% + \expandafter\ifx\thisenv\titlepage\else + \checkenv{}% chapters, etc., should not start inside an environment. + \fi + % FIXME: \chapmacro is currently called from inside \titlepage when + % \setcontentsaftertitlepage to print the "Table of Contents" heading, but + % this should probably be done by \sectionheading with an option to print + % in chapter size. + % % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs @@ -5724,7 +6579,8 @@ end \domark % {% - \chapfonts \rmisbold + \chapfonts \rm + \let\footnote=\errfootnoteheading % give better error message % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called @@ -5777,30 +6633,6 @@ end } -% I don't think this chapter style is supported any more, so I'm not -% updating it with the new noderef stuff. We'll see. --karl, 11aug03. -% -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} -% -\def\unnchfopen #1{% - \chapoddpage - \vbox{\chapfonts \raggedtitlesettings #1\par}% - \nobreak\bigskip\nobreak -} -\def\chfopen #1#2{\chapoddpage {\chapfonts -\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% -\par\penalty 5000 % -} -\def\centerchfopen #1{% - \chapoddpage - \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% - \nobreak\bigskip \nobreak -} -\def\CHAPFopen{% - \global\let\chapmacro=\chfopen - \global\let\centerchapmacro=\centerchfopen} - - % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % @@ -5818,22 +6650,29 @@ end % Print any size, any type, section title. % -% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is -% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the -% section number. +% #1 is the text of the title, +% #2 is the section level (sec/subsec/subsubsec), +% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), +% #4 is the section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% - \checkenv{}% should not be in an environment. - % - % Switch to the right set of fonts. - \csname #2fonts\endcsname \rmisbold - % \def\sectionlevel{#2}% \def\temptype{#3}% % + % It is ok for the @heading series commands to appear inside an + % environment (it's been historically allowed, though the logic is + % dubious), but not the others. + \ifx\temptype\Yomitfromtockeyword\else + \checkenv{}% non-@*heading should not be in an environment. + \fi + \let\footnote=\errfootnoteheading + % + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rm + % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword @@ -5885,7 +6724,7 @@ end % % Now the second mark, after the heading break. No break points % between here and the heading. - \let\prevsectiondefs=\lastsectiondefs + \global\let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. @@ -5996,7 +6835,14 @@ end % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. - \ifpdf \global\pdfmakepagedesttrue \fi + \ifpdf + \global\pdfmakepagedesttrue + \else + \ifx\XeTeXrevision\thisisundefined + \else + \global\pdfmakepagedesttrue + \fi + \fi } @@ -6045,7 +6891,7 @@ end \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. + \entryrightmargin=\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi @@ -6139,7 +6985,15 @@ end % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} -\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} +\def\partentry#1#2#3#4{% + % Add stretch and a bonus for breaking the page before the part heading. + % This reduces the chance of the page being broken immediately after the + % part heading, before a following chapter heading. + \vskip 0pt plus 5\baselineskip + \penalty-300 + \vskip 0pt plus -5\baselineskip + \dochapentry{\numeralbox\labelspace#1}{}% +} % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% @@ -6150,7 +7004,7 @@ end % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} -% + % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% @@ -6165,7 +7019,7 @@ end \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % -\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} @@ -6198,6 +7052,8 @@ end \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup + % Move the page numbers slightly to the right + \advance\entryrightmargin by -0.05em \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup @@ -6252,14 +7108,14 @@ end \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other - \catcode`\`=\other - \catcode`\'=\other - \escapechar=`\\ + \catcode `\`=\other + \catcode `\'=\other % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % + % Inverse of the list at the beginning of the file. \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc @@ -6275,9 +7131,11 @@ end \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash + \let\sp=\ptexsp \let\*=\ptexstar + %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode \let\t=\ptext - \expandafter \let\csname top\endcsname=\ptextop % outer + \expandafter \let\csname top\endcsname=\ptextop % we've made it outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% @@ -6314,6 +7172,24 @@ end \endgraf \ifdim\lastskip<\envskipamount \removelastskip + \ifnum\lastpenalty<10000 + % Penalize breaking before the environment, because preceding text + % often leads into it. + \penalty100 + \fi + \vskip\envskipamount + \fi + \fi +}} + +\def\afterenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi @@ -6322,8 +7198,6 @@ end \fi }} -\let\afterenvbreak = \aboveenvbreak - % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax @@ -6361,15 +7235,13 @@ end % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing = t% % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % - \vbox\bgroup + \setbox\groupbox=\vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup @@ -6393,6 +7265,7 @@ end \egroup \cartbot \egroup + \addgroupbox \checkinserts } @@ -6402,7 +7275,7 @@ end \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak - \hfuzz = 12pt % Don't be fussy + \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output @@ -6529,9 +7402,13 @@ end % @raggedright does more-or-less normal line breaking but no right -% justification. From plain.tex. +% justification. From plain.tex. Don't stretch around special +% characters in urls in this environment, since the stretch at the right +% should be enough. \envdef\raggedright{% - \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax + \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax + \def\urefprestretchamount{0pt}% + \def\urefpoststretchamount{0pt}% } \let\Eraggedright\par @@ -6771,7 +7648,7 @@ end % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as -% possible is very desirable. +% possible is desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} @@ -6866,7 +7743,7 @@ end \temp } -% \domakedefun \deffn \deffnx \deffnheader +% \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) } % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. @@ -7075,7 +7952,7 @@ end \fi % no return type #3% output function name }% - {\rm\enskip}% hskip 0.5 em of \tenrm + {\rm\enskip}% hskip 0.5 em of \rmfont % \boldbrax % arguments will be output next, if any. @@ -7204,34 +8081,41 @@ end } \fi -\def\scanmacro#1{\begingroup +% alias because \c means cedilla in @tex or @math +\let\texinfoc=\c + +\newcount\savedcatcodeone +\newcount\savedcatcodetwo + +% Used at the time of macro expansion. +% Argument is macro body with arguments substituted +\def\scanmacro#1{% \newlinechar`\^^M - \let\xeatspaces\eatspaces + \def\xeatspaces{\eatspaces}% + % + % Temporarily undo catcode changes of \printindex. Set catcode of @ to + % 0 so that @-commands in macro expansions aren't printed literally when + % formatting an index file, where \ is used as the escape character. + \savedcatcodeone=\catcode`\@ + \savedcatcodetwo=\catcode`\\ + \catcode`\@=0 + \catcode`\\=\active % - % Undo catcode changes of \startcontents and \doprintindex - % When called from @insertcopying or (short)caption, we need active - % backslash to get it printed correctly. Previously, we had - % \catcode`\\=\other instead. We'll see whether a problem appears - % with macro expansion. --kasal, 19aug04 - \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % Process the macro body under the current catcode regime. + \scantokens{#1@texinfoc}% % - % ... and for \example: - \spaceisspace + \catcode`\@=\savedcatcodeone + \catcode`\\=\savedcatcodetwo % - % The \empty here causes a following catcode 5 newline to be eaten as - % part of reading whitespace after a control sequence. It does not - % eat a catcode 13 newline. There's no good way to handle the two - % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX - % would then have different behavior). See the Macro Details node in - % the manual for the workaround we recommend for macros and - % line-oriented commands. - % - \scantokens{#1\empty}% -\endgroup} + % The \texinfoc is to remove the \newlinechar added by \scantokens, and + % can be noticed by \parsearg. + % We avoid surrounding the call to \scantokens with \bgroup and \egroup + % to allow macros to open or close groups themselves. +} +% Used for copying and captions \def\scanexp#1{% - \edef\temp{\noexpand\scanmacro{#1}}% - \temp + \expandafter\scanmacro\expandafter{#1}% } \newcount\paramno % Count of parameters @@ -7239,7 +8123,7 @@ end \newif\ifrecursive % Is it recursive? % List of all defined macros in the form -% \definedummyword\macro1\definedummyword\macro2... +% \commondummyword\macro1\commondummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} @@ -7247,7 +8131,7 @@ end % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% - \toks0 = \expandafter{\macrolist\definedummyword#1}% + \toks0 = \expandafter{\macrolist\commondummyword#1}% \xdef\macrolist{\the\toks0}% } @@ -7297,48 +8181,45 @@ end \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other - \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other - \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi + \passthroughcharstrue } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt + \catcode`\@=\other \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt + \catcode`\ =\other + \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } -\def\macroargctxt{% used when scanning invocations +% Used when scanning braced macro arguments. Note, however, that catcode +% changes here are ineffectual if the macro invocation was nested inside +% an argument to another Texinfo command. +\def\macroargctxt{% \scanctxt - \catcode`\\=0 + \catcode`\ =\active + \catcode`\^^M=\other + \catcode`\\=\active } -% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" -% for the single characters \ { }. Thus, we end up with the "commands" -% that would be written @\ @{ @} in a Texinfo document. -% -% We already have @{ and @}. For @\, we define it here, and only for -% this purpose, to produce a typewriter backslash (so, the @\ that we -% define for @math can't be used with @macro calls): -% -\def\\{\normalbackslash}% -% -% We would like to do this for \, too, since that is what makeinfo does. -% But it is not possible, because Texinfo already has a command @, for a -% cedilla accent. Documents must use @comma{} instead. -% -% \anythingelse will almost certainly be an error of some kind. +\def\macrolineargctxt{% used for whole-line arguments without braces + \scanctxt + \catcode`\{=\other + \catcode`\}=\other +} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N @@ -7391,7 +8272,7 @@ end % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax - \let\definedummyword\unmacrodo + \let\commondummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else @@ -7406,61 +8287,40 @@ end \ifx #1\relax % remove this \else - \noexpand\definedummyword \noexpand#1% + \noexpand\commondummyword \noexpand#1% \fi } -% This makes use of the obscure feature that if the last token of a -% is #, then the preceding argument is delimited by -% an opening brace, and that opening brace is not consumed. +% \getargs -- Parse the arguments to a @macro line. Set \macname to +% the name of the macro, and \argl to the braced argument list. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} +% This made use of the feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. -% For macro processing make @ a letter so that we can make Texinfo private macro names. -\edef\texiatcatcode{\the\catcode`\@} -\catcode `@=11\relax - -% Parse the optional {params} list. Set up \paramno and \paramlist -% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH -% in the params list to some hook where the argument si to be expanded. If -% there are less than 10 arguments that hook is to be replaced by ##N where N +% Parse the optional {params} list to @macro or @rmacro. +% Set \paramno to the number of arguments, +% and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a +% three-param macro.) Define \macarg.BLAH for each BLAH in the params +% list to some hook where the argument is to be expanded. If there are +% less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % -% We need to get `macro parameter char #' into several definitions. -% The technique used is stolen from LaTeX: let \hash be something -% unexpandable, insert that wherever you need a #, and then redefine -% it to # just before using the token list produced. -% -% The same technique is used to protect \eatspaces till just before -% the macro is used. +% If there are 10 or more arguments, a different technique is used: see +% \parsemmanyargdef. % -% If there are 10 or more arguments, a different technique is used, where the -% hook remains in the body, and when macro is to be expanded the body is -% processed again to replace the arguments. -% -% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the -% argument N value and then \edef the body (nothing else will expand because of -% the catcode regime underwhich the body was input). -% -% If you compile with TeX (not eTeX), and you have macros with 10 or more -% arguments, you need that no macro has more than 256 arguments, otherwise an -% error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax + % \hash is redefined to `#' later to get it into definitions \let\xeatspaces\relax \parsemargdefxxx#1,;,% - % In case that there are 10 or more arguments we parse again the arguments - % list to set new definitions for the \macarg.BLAH macros corresponding to - % each BLAH argument. It was anyhow needed to parse already once this list - % in order to count the arguments, and as macros with at most 9 arguments - % are by far more frequent than macro with 10 or more arguments, defining - % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments @@ -7475,6 +8335,43 @@ end \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} +% \parsemacbody, \parsermacbody +% +% Read recursive and nonrecursive macro bodies. (They're different since +% rec and nonrec macros end differently.) +% +% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro +% body to be transformed. +% Set \macrobody to the body of the macro, and call \defmacro. +% +{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% +\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% +{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% +\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% + +% Make @ a letter, so that we can make private-to-Texinfo macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% + +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime under which the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, no macro can have more than 256 arguments (else error). +% +% In case that there are 10 or more arguments we parse again the arguments +% list to set new definitions for the \macarg.BLAH macros corresponding to +% each BLAH argument. It was anyhow needed to parse already once this list +% in order to count the arguments, and as macros with at most 9 arguments +% are by far more frequent than macro with 10 or more arguments, defining +% twice the \macarg.BLAH macros does not cost too much processing power. \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else @@ -7490,16 +8387,6 @@ end \advance\paramno by 1\relax \fi\next} -% These two commands read recursive and nonrecursive macro bodies. -% (They're different since rec and nonrec macros end differently.) -% - -\catcode `\@\texiatcatcode -\long\def\parsemacbody#1@end macro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% -\long\def\parsermacbody#1@end rmacro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% -\catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax @@ -7507,7 +8394,7 @@ end \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its -% definition. It gets all the arguments values and assigns them to macros +% definition. It gets all the arguments' values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name @@ -7528,8 +8415,6 @@ end \getargvals@@ \fi } - -% \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. @@ -7573,7 +8458,8 @@ end } % Replace arguments by their values in the macro body, and place the result -% in macro \@tempa +% in macro \@tempa. +% \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument @@ -7597,8 +8483,9 @@ end \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } +% Define the named-macro outside of this group and then close this group. +% \def\macargexpandinbody@{% - %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ @@ -7635,14 +8522,8 @@ end \next } -% Save the token stack pointer into macro #1 -\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} -% Restore the token stack pointer from number in macro #1 -\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} -% newtoks that can be used non \outer . -\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} - -% Tailing missing arguments are set to empty +% Trailing missing arguments are set to empty. +% \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ @@ -7672,99 +8553,191 @@ end \long\def#2{#4}% } -% This defines a Texinfo @macro. There are eight cases: recursive and -% nonrecursive macros of zero, one, up to nine, and many arguments. -% Much magic with \expandafter here. + +%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%% + + +% This defines a Texinfo @macro or @rmacro, called by \parsemacbody. +% \macrobody has the body of the macro in it, with placeholders for +% its parameters, looking like "\xeatspaces{\hash 1}". +% \paramno is the number of parameters +% \paramlist is a TeX parameter text, e.g. "#1,#2,#3," +% There are four cases: macros of zero, one, up to nine, and many arguments. % \xdef is used so that macro definitions will survive the file -% they're defined in; @include reads the file inside a group. +% they're defined in: @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars - \ifrecursive - \ifcase\paramno - % 0 - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\scanmacro{\temp}}% - \or % 1 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname xxx\endcsname}% - \expandafter\xdef\csname\the\macname xxx\endcsname##1{% - \egroup\noexpand\scanmacro{\temp}}% - \else - \ifnum\paramno<10\relax % at most 9 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{\egroup\noexpand\scanmacro{\temp}}% - \else % 10 or more - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\getargvals@{\the\macname}{\argl}% - }% - \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp - \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble - \fi - \fi + \ifnum\paramno=1 + \def\xeatspaces##1{##1}% + % This removes the pair of braces around the argument. We don't + % use \eatspaces, because this can cause ends of lines to be lost + % when the argument to \eatspaces is read, leading to line-based + % commands like "@itemize" not being read correctly. \else - \ifcase\paramno - % 0 + \let\xeatspaces\relax % suppress expansion + \fi + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\spaceisspace + \noexpand\endlineisspace + \noexpand\expandafter % skip any whitespace after the macro name. + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname{% + \egroup + \noexpand\scanmacro{\macrobody}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \egroup + \noexpand\scanmacro{\macrobody}% + }% + \else % at most 9 + \ifnum\paramno<10\relax + % @MACNAME sets the context for reading the macro argument + % @MACNAME@@ gets the argument, processes backslashes and appends a + % comma. + % @MACNAME@@@ removes braces surrounding the argument list. + % @MACNAME@@@@ scans the macro body with arguments substituted. \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \or % 1 + \bgroup + \noexpand\expandafter % This \expandafter skip any spaces after the + \noexpand\macroargctxt % macro before we change the catcode of space. + \noexpand\expandafter + \expandafter\noexpand\csname\the\macname @@\endcsname}% + \expandafter\xdef\csname\the\macname @@\endcsname##1{% + \noexpand\passargtomacro + \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname @@@@\endcsname\paramlist{% + \egroup\noexpand\scanmacro{\macrobody}}% + \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname xxx\endcsname}% - \expandafter\xdef\csname\the\macname xxx\endcsname##1{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \else % at most 9 - \ifnum\paramno<10\relax - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \expandafter\noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \else % 10 or more: - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\getargvals@{\the\macname}{\argl}% - }% - \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp - \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse - \fi + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi} -\catcode `\@\texiatcatcode\relax +\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} -% \braceorline decides whether the next nonwhitespace character is a -% {. If so it reads up to the closing }, if not, it reads the whole -% line. Whatever was read is then fed to the next control sequence -% as an argument (by \parsebrace or \parsearg). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape +@catcode`@_=11 % private names +@catcode`@!=11 % used as argument separator + +% \passargtomacro#1#2 - +% Call #1 with a list of tokens #2, with any doubled backslashes in #2 +% compressed to one. +% +% This implementation works by expansion, and not execution (so we cannot use +% \def or similar). This reduces the risk of this failing in contexts where +% complete expansion is done with no execution (for example, in writing out to +% an auxiliary file for an index entry). +% +% State is kept in the input stream: the argument passed to +% @look_ahead, @gobble_and_check_finish and @add_segment is +% +% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) +% +% where: +% THE_MACRO - name of the macro we want to call +% ARG_RESULT - argument list we build to pass to that macro +% PENDING_BS - either a backslash or nothing +% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next + +@gdef@passargtomacro#1#2{% + @add_segment #1!{}@relax#2\@_finish\% +} +@gdef@_finish{@_finishx} @global@let@_finishx@relax + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 used to look ahead +% +% If the next token is not a backslash, process the rest of the argument; +% otherwise, remove the next token. +@gdef@look_ahead#1!#2#3#4{% + @ifx#4\% + @expandafter@gobble_and_check_finish + @else + @expandafter@add_segment + @fi#1!{#2}#4#4% +} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 should be a backslash, which is gobbled. +% #5 looks ahead +% +% Double backslash found. Add a single backslash, and look ahead. +@gdef@gobble_and_check_finish#1!#2#3#4#5{% + @add_segment#1\!{}#5#5% +} + +@gdef@is_fi{@fi} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 is input stream until next backslash +% +% Input stream is either at the start of the argument, or just after a +% backslash sequence, either a lone backslash, or a doubled backslash. +% NEXT_TOKEN contains the first token in the input stream: if it is \finish, +% finish; otherwise, append to ARG_RESULT the segment of the argument up until +% the next backslash. PENDING_BACKSLASH contains a backslash to represent +% a backslash just before the start of the input stream that has not been +% added to ARG_RESULT. +@gdef@add_segment#1!#2#3#4\{% +@ifx#3@_finish + @call_the_macro#1!% +@else + % append the pending backslash to the result, followed by the next segment + @expandafter@is_fi@look_ahead#1#2#4!{\}@fi + % this @fi is discarded by @look_ahead. + % we can't get rid of it with \expandafter because we don't know how + % long #4 is. +} + +% #1 - THE_MACRO +% #2 - ARG_RESULT +% #3 discards the res of the conditional in @add_segment, and @is_fi ends the +% conditional. +@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} + +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% \braceorline MAC is used for a one-argument macro MAC. It checks +% whether the next non-whitespace character is a {. It sets the context +% for reading the argument (slightly different in the two cases). Then, +% to read the argument, in the whole-line case, it then calls the regular +% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% - \ifx\nchar\bgroup\else - \expandafter\parsearg + \ifx\nchar\bgroup + \macroargctxt + \expandafter\passargtomacro + \else + \macrolineargctxt\expandafter\parsearg \fi \macnamexxx} @@ -7846,7 +8819,10 @@ end \pdfmkdest{#1}% \iflinks {% + \requireauxfile \atdummies % preserve commands, but don't expand them + % match definition in \xrdef, \refx, \xrefX. + \def\value##1{##1}% \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef @@ -7885,9 +8861,12 @@ end % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % -\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} -\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} -\def\ref#1{\xrefX[#1,,,,,,,]} +\def\pxref{\putwordsee{} \xrefXX} +\def\xref{\putwordSee{} \xrefXX} +\def\ref{\xrefXX} + +\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} +\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox @@ -7934,9 +8913,10 @@ end % % Make link in pdf output. \ifpdf + % For pdfTeX and LuaTeX {\indexnofonts - \turnoffactive \makevalueexpandable + \turnoffactive % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. @@ -7944,35 +8924,74 @@ end % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. - \edef\pdfxrefdest{#1}% - \ifx\pdfxrefdest\empty - \def\pdfxrefdest{Top}% no empty targets - \else - \txiescapepdf\pdfxrefdest % escape PDF special chars + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 - goto file{\the\filename.pdf} name{\pdfxrefdest}% + goto file{\the\filename.pdf} name{\pdfdestname}% \else - goto name{\pdfmkpgn{\pdfxrefdest}}% + goto name{\pdfmkpgn{\pdfdestname}}% \fi }% \setcolor{\linkcolor}% + \else + \ifx\XeTeXrevision\thisisundefined + \else + % For XeTeX + {\indexnofonts + \makevalueexpandable + \turnoffactive + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets + \fi + % + \leavevmode + \ifnum\filenamelength>0 + % With default settings, + % XeTeX (xdvipdfmx) replaces link destination names with integers. + % In this case, the replaced destination names of + % remote PDFs are no longer known. In order to avoid a replacement, + % you can use xdvipdfmx's command line option `-C 0x0010'. + % If you use XeTeX 0.99996+ (TeX Live 2016+), + % this command line option is no longer necessary + % because we can use the `dvipdfmx:config' special. + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% + \else + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoTo /D (\pdfdestname) >> >>}% + \fi + }% + \setcolor{\linkcolor}% + \fi \fi - % - % Float references are printed completely differently: "Figure 1.2" - % instead of "[somenode], p.3". We distinguish them by the - % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive + \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". \iffloat distinguishes them by + % \Xthisreftitle being set to a magic string. \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". @@ -8031,6 +9050,15 @@ end % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + % Add a , if xref followed by a space + \if\space\noexpand\tokenafterxref ,% + \else\ifx\ \tokenafterxref ,% @TAB + \else\ifx\*\tokenafterxref ,% @* + \else\ifx\ \tokenafterxref ,% @SPACE + \else\ifx\ + \tokenafterxref ,% @NL + \else\ifx\tie\tokenafterxref ,% @tie + \fi\fi\fi\fi\fi\fi \fi\fi \fi \endlink @@ -8097,13 +9125,14 @@ end \fi\fi\fi } -% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. -% If its value is nonempty, SUFFIX is output afterward. -% +% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX +% is output afterwards if non-empty. \def\refx#1#2{% + \requireauxfile {% \indexnofonts \otherbackslash + \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% @@ -8128,20 +9157,28 @@ end #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. Usually it's -% just a \def (we prepend XR to the control sequence name to avoid -% collisions). But if this is a float type, we have more work to do. +% This is the macro invoked by entries in the aux file. Define a control +% sequence for a cross-reference target (we prepend XR to the control sequence +% name to avoid collisions). The value is the page number. If this is a float +% type, we have more work to do. % \def\xrdef#1#2{% - {% The node name might contain 8-bit characters, which in our current - % implementation are changed to commands like @'e. Don't let these - % mess up the control sequence name. + {% Expand the node or anchor name to remove control sequences. + % \turnoffactive stops 8-bit characters being changed to commands + % like @'e. \refx does the same to retrieve the value in the definition. \indexnofonts \turnoffactive + \def\value##1{##1}% \xdef\safexrefname{#1}% }% % - \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref + \bgroup + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% + \egroup + % We put the \gdef inside a group to avoid the definitions building up on + % TeX's save stack, which can cause it to run out of space for aux files with + % thousands of lines. \gdef doesn't use the save stack, but \csname does + % when it defines an unknown control sequence as \relax. % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname @@ -8164,6 +9201,23 @@ end \fi } +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate at the beginning of the file. +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% Used when writing to the aux file, or when using data from it. +\def\requireauxfile{% + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi + \global\let\requireauxfile=\relax % Only do this once. +} + % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% @@ -8242,16 +9296,6 @@ end % now. --karl, 15jan04. \catcode`\\=\other % - % Make the characters 128-255 be printing characters. - {% - \count1=128 - \def\loop{% - \catcode\count1=\other - \advance\count1 by 1 - \ifnum \count1<256 \loop \fi - }% - }% - % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 @@ -8284,8 +9328,6 @@ end % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% - \let\indent=\ptexindent - \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % @@ -8309,10 +9351,15 @@ end % \gdef\dofootnote{% \insert\footins\bgroup + % + % Nested footnotes are not supported in TeX, that would take a lot + % more work. (\startsavinginserts does not suffice.) + \let\footnote=\errfootnotenest + % % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. - \hsize=\pagewidth + \hsize=\txipagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox @@ -8346,13 +9393,24 @@ end } }%end \catcode `\@=11 +\def\errfootnotenest{% + \errhelp=\EMsimple + \errmessage{Nested footnotes not supported in texinfo.tex, + even though they work in makeinfo; sorry} +} + +\def\errfootnoteheading{% + \errhelp=\EMsimple + \errmessage{Footnotes in chapters, sections, etc., are not supported} +} + % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. - +% % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. @@ -8426,7 +9484,7 @@ end \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get - it from ftp://tug.org/tex/epsf.tex.} + it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisisundefined @@ -8450,6 +9508,7 @@ end \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names + \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro % If the image is by itself, center it. \ifvmode \imagevmodetrue @@ -8479,12 +9538,21 @@ end % % Output the image. \ifpdf + % For pdfTeX and LuaTeX <= 0.80 \dopdfimage{#1}{#2}{#3}% \else - % \epsfbox itself resets \epsf?size at each figure. - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi - \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - \epsfbox{#1.eps}% + \ifx\XeTeXrevision\thisisundefined + % For epsf.tex + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \else + % For XeTeX + \doxeteximage{#1}{#2}{#3}% + \fi \fi % \ifimagevmode @@ -8606,7 +9674,7 @@ end % \ifx\thiscaption\empty \else \ifx\floatident\empty \else - \appendtomacro\captionline{: }% had ident, so need a colon between + \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. @@ -8630,32 +9698,20 @@ end % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% + \requireauxfile \atdummies % - % since we read the caption text in the macro world, where ^^M - % is turned into a normal character, we have to scan it back, so - % we don't write the literal three characters "^^M" into the aux file. - \scanexp{% - \xdef\noexpand\gtemp{% - \ifx\thisshortcaption\empty - \thiscaption - \else - \thisshortcaption - \fi - }% - }% + \ifx\thisshortcaption\empty + \def\gtemp{\thiscaption}% + \else + \def\gtemp{\thisshortcaption}% + \fi \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident - \ifx\gtemp\empty \else : \gtemp \fi}}% + \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % - % place the captured inserts - % - % BEWARE: when the floats start floating, we have to issue warning - % whenever an insert appears inside a float which could possibly - % float. --kasal, 26may04 - % \checkinserts } @@ -8769,20 +9825,20 @@ end { \catcode`\_ = \active \globaldefs=1 -\parseargdef\documentlanguage{\begingroup - \let_=\normalunderscore % normal _ character for filenames +\parseargdef\documentlanguage{% \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. + \let_ = \normalunderscore % normal _ character for filename test \openin 1 txi-#1.tex \ifeof 1 - \documentlanguagetrywithoutunderscore{#1_\finish}% + \documentlanguagetrywithoutunderscore #1_\finish \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX -\endgroup} +} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. @@ -8830,6 +9886,70 @@ directory should work if nowhere else does.} \global\righthyphenmin = #3\relax } +% XeTeX and LuaTeX can handle Unicode natively. +% Their default I/O uses UTF-8 sequences instead of a byte-wise operation. +% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise. +% +\newif\iftxinativeunicodecapable +\newif\iftxiusebytewiseio + +\ifx\XeTeXrevision\thisisundefined + \ifx\luatexversion\thisisundefined + \txinativeunicodecapablefalse + \txiusebytewiseiotrue + \else + \txinativeunicodecapabletrue + \txiusebytewiseiofalse + \fi +\else + \txinativeunicodecapabletrue + \txiusebytewiseiofalse +\fi + +% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex +% for non-UTF-8 (byte-wise) encodings. +% +\def\setbytewiseio{% + \ifx\XeTeXrevision\thisisundefined + \else + \XeTeXdefaultencoding "bytes" % For subsequent files to be read + \XeTeXinputencoding "bytes" % For document root file + % Unfortunately, there seems to be no corresponding XeTeX command for + % output encoding. This is a problem for auxiliary index and TOC files. + % The only solution would be perhaps to write out @U{...} sequences in + % place of non-ASCII characters. + \fi + + \ifx\luatexversion\thisisundefined + \else + \directlua{ + local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub + local function convert_char (char) + return utf8_char(byte(char)) + end + + local function convert_line (line) + return gsub(line, ".", convert_char) + end + + callback.register("process_input_buffer", convert_line) + + local function convert_line_out (line) + local line_out = "" + for c in string.utfvalues(line) do + line_out = line_out .. string.char(c) + end + return line_out + end + + callback.register("process_output_buffer", convert_line_out) + } + \fi + + \txiusebytewiseiotrue +} + + % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % @@ -8852,7 +9972,9 @@ directory should work if nowhere else does.} % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % -\parseargdef\documentencoding{% +\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} +\def\documentencodingzzz#1{% + % % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % @@ -8868,35 +9990,66 @@ directory should work if nowhere else does.} \asciichardefs % \else \ifx \declaredencoding \lattwo + \iftxinativeunicodecapable + \setbytewiseio + \fi \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone + \iftxinativeunicodecapable + \setbytewiseio + \fi \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine + \iftxinativeunicodecapable + \setbytewiseio + \fi \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight - \setnonasciicharscatcode\active - \utfeightchardefs + \iftxinativeunicodecapable + % For native Unicode handling (XeTeX and LuaTeX) + \nativeunicodechardefs + \else + % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX) + \setnonasciicharscatcode\active + % since we already invoked \utfeightchardefs at the top level + % (below), do not re-invoke it, otherwise our check for duplicated + % definitions gets triggered. Making non-ascii chars active is + % sufficient. + \fi % \else - \message{Unknown document encoding #1, ignoring.}% + \message{Ignoring unknown document encoding: #1.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii + % + \ifx\XeTeXrevision\thisisundefined + \else + \ifx \declaredencoding \utfeight + \else + \ifx \declaredencoding \ascii + \else + \message{Warning: XeTeX with non-UTF-8 encodings cannot handle % + non-ASCII characters in auxiliary files.}% + \fi + \fi + \fi } +% emacs-page % A message to be logged when using a character that isn't available % the default font encoding (OT1). % -\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} +\def\missingcharmsg#1{\message{Character missing, sorry: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} @@ -8906,111 +10059,119 @@ directory should work if nowhere else does.} % macros containing the character definitions. \setnonasciicharscatcode\active % + +\def\gdefchar#1#2{% +\gdef#1{% + \ifpassthroughchars + \string#1% + \else + #2% + \fi +}} + % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% - \gdef^^a0{\tie} - \gdef^^a1{\exclamdown} - \gdef^^a2{\missingcharmsg{CENT SIGN}} - \gdef^^a3{{\pounds}} - \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} - \gdef^^a5{\missingcharmsg{YEN SIGN}} - \gdef^^a6{\missingcharmsg{BROKEN BAR}} - \gdef^^a7{\S} - \gdef^^a8{\"{}} - \gdef^^a9{\copyright} - \gdef^^aa{\ordf} - \gdef^^ab{\guillemetleft} - \gdef^^ac{$\lnot$} - \gdef^^ad{\-} - \gdef^^ae{\registeredsymbol} - \gdef^^af{\={}} - % - \gdef^^b0{\textdegree} - \gdef^^b1{$\pm$} - \gdef^^b2{$^2$} - \gdef^^b3{$^3$} - \gdef^^b4{\'{}} - \gdef^^b5{$\mu$} - \gdef^^b6{\P} - % - \gdef^^b7{$^.$} - \gdef^^b8{\cedilla\ } - \gdef^^b9{$^1$} - \gdef^^ba{\ordm} - % - \gdef^^bb{\guillemetright} - \gdef^^bc{$1\over4$} - \gdef^^bd{$1\over2$} - \gdef^^be{$3\over4$} - \gdef^^bf{\questiondown} - % - \gdef^^c0{\`A} - \gdef^^c1{\'A} - \gdef^^c2{\^A} - \gdef^^c3{\~A} - \gdef^^c4{\"A} - \gdef^^c5{\ringaccent A} - \gdef^^c6{\AE} - \gdef^^c7{\cedilla C} - \gdef^^c8{\`E} - \gdef^^c9{\'E} - \gdef^^ca{\^E} - \gdef^^cb{\"E} - \gdef^^cc{\`I} - \gdef^^cd{\'I} - \gdef^^ce{\^I} - \gdef^^cf{\"I} - % - \gdef^^d0{\DH} - \gdef^^d1{\~N} - \gdef^^d2{\`O} - \gdef^^d3{\'O} - \gdef^^d4{\^O} - \gdef^^d5{\~O} - \gdef^^d6{\"O} - \gdef^^d7{$\times$} - \gdef^^d8{\O} - \gdef^^d9{\`U} - \gdef^^da{\'U} - \gdef^^db{\^U} - \gdef^^dc{\"U} - \gdef^^dd{\'Y} - \gdef^^de{\TH} - \gdef^^df{\ss} - % - \gdef^^e0{\`a} - \gdef^^e1{\'a} - \gdef^^e2{\^a} - \gdef^^e3{\~a} - \gdef^^e4{\"a} - \gdef^^e5{\ringaccent a} - \gdef^^e6{\ae} - \gdef^^e7{\cedilla c} - \gdef^^e8{\`e} - \gdef^^e9{\'e} - \gdef^^ea{\^e} - \gdef^^eb{\"e} - \gdef^^ec{\`{\dotless i}} - \gdef^^ed{\'{\dotless i}} - \gdef^^ee{\^{\dotless i}} - \gdef^^ef{\"{\dotless i}} - % - \gdef^^f0{\dh} - \gdef^^f1{\~n} - \gdef^^f2{\`o} - \gdef^^f3{\'o} - \gdef^^f4{\^o} - \gdef^^f5{\~o} - \gdef^^f6{\"o} - \gdef^^f7{$\div$} - \gdef^^f8{\o} - \gdef^^f9{\`u} - \gdef^^fa{\'u} - \gdef^^fb{\^u} - \gdef^^fc{\"u} - \gdef^^fd{\'y} - \gdef^^fe{\th} - \gdef^^ff{\"y} + \gdefchar^^a0{\tie} + \gdefchar^^a1{\exclamdown} + \gdefchar^^a2{{\tcfont \char162}} % cent + \gdefchar^^a3{\pounds{}} + \gdefchar^^a4{{\tcfont \char164}} % currency + \gdefchar^^a5{{\tcfont \char165}} % yen + \gdefchar^^a6{{\tcfont \char166}} % broken bar + \gdefchar^^a7{\S} + \gdefchar^^a8{\"{}} + \gdefchar^^a9{\copyright{}} + \gdefchar^^aa{\ordf} + \gdefchar^^ab{\guillemetleft{}} + \gdefchar^^ac{\ensuremath\lnot} + \gdefchar^^ad{\-} + \gdefchar^^ae{\registeredsymbol{}} + \gdefchar^^af{\={}} + % + \gdefchar^^b0{\textdegree} + \gdefchar^^b1{$\pm$} + \gdefchar^^b2{$^2$} + \gdefchar^^b3{$^3$} + \gdefchar^^b4{\'{}} + \gdefchar^^b5{$\mu$} + \gdefchar^^b6{\P} + \gdefchar^^b7{\ensuremath\cdot} + \gdefchar^^b8{\cedilla\ } + \gdefchar^^b9{$^1$} + \gdefchar^^ba{\ordm} + \gdefchar^^bb{\guillemetright{}} + \gdefchar^^bc{$1\over4$} + \gdefchar^^bd{$1\over2$} + \gdefchar^^be{$3\over4$} + \gdefchar^^bf{\questiondown} + % + \gdefchar^^c0{\`A} + \gdefchar^^c1{\'A} + \gdefchar^^c2{\^A} + \gdefchar^^c3{\~A} + \gdefchar^^c4{\"A} + \gdefchar^^c5{\ringaccent A} + \gdefchar^^c6{\AE} + \gdefchar^^c7{\cedilla C} + \gdefchar^^c8{\`E} + \gdefchar^^c9{\'E} + \gdefchar^^ca{\^E} + \gdefchar^^cb{\"E} + \gdefchar^^cc{\`I} + \gdefchar^^cd{\'I} + \gdefchar^^ce{\^I} + \gdefchar^^cf{\"I} + % + \gdefchar^^d0{\DH} + \gdefchar^^d1{\~N} + \gdefchar^^d2{\`O} + \gdefchar^^d3{\'O} + \gdefchar^^d4{\^O} + \gdefchar^^d5{\~O} + \gdefchar^^d6{\"O} + \gdefchar^^d7{$\times$} + \gdefchar^^d8{\O} + \gdefchar^^d9{\`U} + \gdefchar^^da{\'U} + \gdefchar^^db{\^U} + \gdefchar^^dc{\"U} + \gdefchar^^dd{\'Y} + \gdefchar^^de{\TH} + \gdefchar^^df{\ss} + % + \gdefchar^^e0{\`a} + \gdefchar^^e1{\'a} + \gdefchar^^e2{\^a} + \gdefchar^^e3{\~a} + \gdefchar^^e4{\"a} + \gdefchar^^e5{\ringaccent a} + \gdefchar^^e6{\ae} + \gdefchar^^e7{\cedilla c} + \gdefchar^^e8{\`e} + \gdefchar^^e9{\'e} + \gdefchar^^ea{\^e} + \gdefchar^^eb{\"e} + \gdefchar^^ec{\`{\dotless i}} + \gdefchar^^ed{\'{\dotless i}} + \gdefchar^^ee{\^{\dotless i}} + \gdefchar^^ef{\"{\dotless i}} + % + \gdefchar^^f0{\dh} + \gdefchar^^f1{\~n} + \gdefchar^^f2{\`o} + \gdefchar^^f3{\'o} + \gdefchar^^f4{\^o} + \gdefchar^^f5{\~o} + \gdefchar^^f6{\"o} + \gdefchar^^f7{$\div$} + \gdefchar^^f8{\o} + \gdefchar^^f9{\`u} + \gdefchar^^fa{\'u} + \gdefchar^^fb{\^u} + \gdefchar^^fc{\"u} + \gdefchar^^fd{\'y} + \gdefchar^^fe{\th} + \gdefchar^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. @@ -9018,119 +10179,119 @@ directory should work if nowhere else does.} % Encoding is almost identical to Latin1. \latonechardefs % - \gdef^^a4{\euro} - \gdef^^a6{\v S} - \gdef^^a8{\v s} - \gdef^^b4{\v Z} - \gdef^^b8{\v z} - \gdef^^bc{\OE} - \gdef^^bd{\oe} - \gdef^^be{\"Y} + \gdefchar^^a4{\euro{}} + \gdefchar^^a6{\v S} + \gdefchar^^a8{\v s} + \gdefchar^^b4{\v Z} + \gdefchar^^b8{\v z} + \gdefchar^^bc{\OE} + \gdefchar^^bd{\oe} + \gdefchar^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% - \gdef^^a0{\tie} - \gdef^^a1{\ogonek{A}} - \gdef^^a2{\u{}} - \gdef^^a3{\L} - \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} - \gdef^^a5{\v L} - \gdef^^a6{\'S} - \gdef^^a7{\S} - \gdef^^a8{\"{}} - \gdef^^a9{\v S} - \gdef^^aa{\cedilla S} - \gdef^^ab{\v T} - \gdef^^ac{\'Z} - \gdef^^ad{\-} - \gdef^^ae{\v Z} - \gdef^^af{\dotaccent Z} - % - \gdef^^b0{\textdegree} - \gdef^^b1{\ogonek{a}} - \gdef^^b2{\ogonek{ }} - \gdef^^b3{\l} - \gdef^^b4{\'{}} - \gdef^^b5{\v l} - \gdef^^b6{\'s} - \gdef^^b7{\v{}} - \gdef^^b8{\cedilla\ } - \gdef^^b9{\v s} - \gdef^^ba{\cedilla s} - \gdef^^bb{\v t} - \gdef^^bc{\'z} - \gdef^^bd{\H{}} - \gdef^^be{\v z} - \gdef^^bf{\dotaccent z} - % - \gdef^^c0{\'R} - \gdef^^c1{\'A} - \gdef^^c2{\^A} - \gdef^^c3{\u A} - \gdef^^c4{\"A} - \gdef^^c5{\'L} - \gdef^^c6{\'C} - \gdef^^c7{\cedilla C} - \gdef^^c8{\v C} - \gdef^^c9{\'E} - \gdef^^ca{\ogonek{E}} - \gdef^^cb{\"E} - \gdef^^cc{\v E} - \gdef^^cd{\'I} - \gdef^^ce{\^I} - \gdef^^cf{\v D} - % - \gdef^^d0{\DH} - \gdef^^d1{\'N} - \gdef^^d2{\v N} - \gdef^^d3{\'O} - \gdef^^d4{\^O} - \gdef^^d5{\H O} - \gdef^^d6{\"O} - \gdef^^d7{$\times$} - \gdef^^d8{\v R} - \gdef^^d9{\ringaccent U} - \gdef^^da{\'U} - \gdef^^db{\H U} - \gdef^^dc{\"U} - \gdef^^dd{\'Y} - \gdef^^de{\cedilla T} - \gdef^^df{\ss} - % - \gdef^^e0{\'r} - \gdef^^e1{\'a} - \gdef^^e2{\^a} - \gdef^^e3{\u a} - \gdef^^e4{\"a} - \gdef^^e5{\'l} - \gdef^^e6{\'c} - \gdef^^e7{\cedilla c} - \gdef^^e8{\v c} - \gdef^^e9{\'e} - \gdef^^ea{\ogonek{e}} - \gdef^^eb{\"e} - \gdef^^ec{\v e} - \gdef^^ed{\'{\dotless{i}}} - \gdef^^ee{\^{\dotless{i}}} - \gdef^^ef{\v d} - % - \gdef^^f0{\dh} - \gdef^^f1{\'n} - \gdef^^f2{\v n} - \gdef^^f3{\'o} - \gdef^^f4{\^o} - \gdef^^f5{\H o} - \gdef^^f6{\"o} - \gdef^^f7{$\div$} - \gdef^^f8{\v r} - \gdef^^f9{\ringaccent u} - \gdef^^fa{\'u} - \gdef^^fb{\H u} - \gdef^^fc{\"u} - \gdef^^fd{\'y} - \gdef^^fe{\cedilla t} - \gdef^^ff{\dotaccent{}} + \gdefchar^^a0{\tie} + \gdefchar^^a1{\ogonek{A}} + \gdefchar^^a2{\u{}} + \gdefchar^^a3{\L} + \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdefchar^^a5{\v L} + \gdefchar^^a6{\'S} + \gdefchar^^a7{\S} + \gdefchar^^a8{\"{}} + \gdefchar^^a9{\v S} + \gdefchar^^aa{\cedilla S} + \gdefchar^^ab{\v T} + \gdefchar^^ac{\'Z} + \gdefchar^^ad{\-} + \gdefchar^^ae{\v Z} + \gdefchar^^af{\dotaccent Z} + % + \gdefchar^^b0{\textdegree{}} + \gdefchar^^b1{\ogonek{a}} + \gdefchar^^b2{\ogonek{ }} + \gdefchar^^b3{\l} + \gdefchar^^b4{\'{}} + \gdefchar^^b5{\v l} + \gdefchar^^b6{\'s} + \gdefchar^^b7{\v{}} + \gdefchar^^b8{\cedilla\ } + \gdefchar^^b9{\v s} + \gdefchar^^ba{\cedilla s} + \gdefchar^^bb{\v t} + \gdefchar^^bc{\'z} + \gdefchar^^bd{\H{}} + \gdefchar^^be{\v z} + \gdefchar^^bf{\dotaccent z} + % + \gdefchar^^c0{\'R} + \gdefchar^^c1{\'A} + \gdefchar^^c2{\^A} + \gdefchar^^c3{\u A} + \gdefchar^^c4{\"A} + \gdefchar^^c5{\'L} + \gdefchar^^c6{\'C} + \gdefchar^^c7{\cedilla C} + \gdefchar^^c8{\v C} + \gdefchar^^c9{\'E} + \gdefchar^^ca{\ogonek{E}} + \gdefchar^^cb{\"E} + \gdefchar^^cc{\v E} + \gdefchar^^cd{\'I} + \gdefchar^^ce{\^I} + \gdefchar^^cf{\v D} + % + \gdefchar^^d0{\DH} + \gdefchar^^d1{\'N} + \gdefchar^^d2{\v N} + \gdefchar^^d3{\'O} + \gdefchar^^d4{\^O} + \gdefchar^^d5{\H O} + \gdefchar^^d6{\"O} + \gdefchar^^d7{$\times$} + \gdefchar^^d8{\v R} + \gdefchar^^d9{\ringaccent U} + \gdefchar^^da{\'U} + \gdefchar^^db{\H U} + \gdefchar^^dc{\"U} + \gdefchar^^dd{\'Y} + \gdefchar^^de{\cedilla T} + \gdefchar^^df{\ss} + % + \gdefchar^^e0{\'r} + \gdefchar^^e1{\'a} + \gdefchar^^e2{\^a} + \gdefchar^^e3{\u a} + \gdefchar^^e4{\"a} + \gdefchar^^e5{\'l} + \gdefchar^^e6{\'c} + \gdefchar^^e7{\cedilla c} + \gdefchar^^e8{\v c} + \gdefchar^^e9{\'e} + \gdefchar^^ea{\ogonek{e}} + \gdefchar^^eb{\"e} + \gdefchar^^ec{\v e} + \gdefchar^^ed{\'{\dotless{i}}} + \gdefchar^^ee{\^{\dotless{i}}} + \gdefchar^^ef{\v d} + % + \gdefchar^^f0{\dh} + \gdefchar^^f1{\'n} + \gdefchar^^f2{\v n} + \gdefchar^^f3{\'o} + \gdefchar^^f4{\^o} + \gdefchar^^f5{\H o} + \gdefchar^^f6{\"o} + \gdefchar^^f7{$\div$} + \gdefchar^^f8{\v r} + \gdefchar^^f9{\ringaccent u} + \gdefchar^^fa{\'u} + \gdefchar^^fb{\H u} + \gdefchar^^fc{\"u} + \gdefchar^^fd{\'y} + \gdefchar^^fe{\cedilla t} + \gdefchar^^ff{\dotaccent{}} } % UTF-8 character definitions. @@ -9160,38 +10321,94 @@ directory should work if nowhere else does.} \fi } +% Give non-ASCII bytes the active definitions for processing UTF-8 sequences \begingroup \catcode`\~13 + \catcode`\$12 \catcode`\"12 + % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp + % substituting ~ and $ with a character token of that value. \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx + \uccode`\$\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} + % For bytes other than the first in a UTF-8 sequence. Not expected to + % be expanded except when writing to auxiliary files. + \countUTFx = "80 + \countUTFy = "C2 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $\fi}}% + \UTFviiiLoop + \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}% \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}% \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiFourOctets\expandafter$\fi + }}% \UTFviiiLoop \endgroup +\def\globallet{\global\let} % save some \expandafter's below + +% @U{xxxx} to produce U+xxxx, if we support it. +\def\U#1{% + \expandafter\ifx\csname uni:#1\endcsname \relax + \iftxinativeunicodecapable + % All Unicode characters can be used if native Unicode handling is + % active. However, if the font does not have the glyph, + % letters are missing. + \begingroup + \uccode`\.="#1\relax + \uppercase{.} + \endgroup + \else + \errhelp = \EMsimple + \errmessage{Unicode character U+#1 not supported, sorry}% + \fi + \else + \csname uni:#1\endcsname + \fi +} + +% These macros are used here to construct the name of a control +% sequence to be defined. +\def\UTFviiiTwoOctetsName#1#2{% + \csname u8:#1\string #2\endcsname}% +\def\UTFviiiThreeOctetsName#1#2#3{% + \csname u8:#1\string #2\string #3\endcsname}% +\def\UTFviiiFourOctetsName#1#2#3#4{% + \csname u8:#1\string #2\string #3\string #4\endcsname}% + +% For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), +% provide a definition macro to replace a Unicode character; +% this gets used by the @U command +% \begingroup \catcode`\"=12 \catcode`\<=12 @@ -9200,459 +10417,839 @@ directory should work if nowhere else does.} \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 - - \gdef\DeclareUnicodeCharacter#1#2{% + \gdef\DeclareUnicodeCharacterUTFviii#1#2{% \countUTFz = "#1\relax - %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref - \def\UTFviiiTwoOctets##1##2{% - \csname u8:##1\string ##2\endcsname}% - \def\UTFviiiThreeOctets##1##2##3{% - \csname u8:##1\string ##2\string ##3\endcsname}% - \def\UTFviiiFourOctets##1##2##3##4{% - \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter - \gdef\UTFviiiTmp{#2}% + + % Give \u8:... its definition. The sequence of seven \expandafter's + % expands after the \gdef three times, e.g. + % + % 1. \UTFviiTwoOctetsName B1 B2 + % 2. \csname u8:B1 \string B2 \endcsname + % 3. \u8: B1 B2 (a single control sequence token) + % + \expandafter\expandafter + \expandafter\expandafter + \expandafter\expandafter + \expandafter\gdef \UTFviiiTmp{#2}% + % + \expandafter\ifx\csname uni:#1\endcsname \relax \else + \message{Internal error, already defined: #1}% + \fi + % + % define an additional control sequence for this code point. + \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp \endgroup} - + % + % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp + % to the corresponding UTF-8 sequence. \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% - \parseUTFviiiB C\UTFviiiTwoOctets.,% + \parseUTFviiiB C\UTFviiiTwoOctetsName.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% - \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% - \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}% \fi\fi\fi } + % Extract a byte from the end of the UTF-8 representation of \countUTFx. + % It must be a non-initial byte in the sequence. + % Change \uccode of #1 for it to be used in \parseUTFviiiB as one + % of the bytes. \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 - \countUTFy = \countUTFz + \countUTFy = \countUTFz % Save to be the future value of \countUTFz. \multiply\countUTFz by 64 + + % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract + % in order to get the last five bits. \advance\countUTFx by -\countUTFz + + % Convert this to the byte in the UTF-8 sequence. \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} + % Used to put a UTF-8 byte sequence into \UTFviiiTmp + % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8 + % sequence. + % #2 is one of the \UTFviii*OctetsName macros. + % #3 is always a full stop (.) + % #4 is a template for the other bytes in the sequence. The values for these + % bytes is substituted in here with \uppercase using the \uccode's. \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup +% For native Unicode handling (XeTeX and LuaTeX), +% provide a definition macro that sets a catcode to `other' non-globally +% +\def\DeclareUnicodeCharacterNativeOther#1#2{% + \catcode"#1=\other +} + +% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M +% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) +% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) +% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A +% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B +% +% Many of our renditions are less than wonderful, and all the missing +% characters are available somewhere. Loading the necessary fonts +% awaits user request. We can't truly support Unicode without +% reimplementing everything that's been done in LaTeX for many years, +% plus probably using luatex or xetex, and who knows what else. +% We won't be doing that here in this simple file. But we can try to at +% least make most of the characters not bomb out. +% +\def\unicodechardefs{% + \DeclareUnicodeCharacter{00A0}{\tie}% + \DeclareUnicodeCharacter{00A1}{\exclamdown}% + \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent + \DeclareUnicodeCharacter{00A3}{\pounds{}}% + \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency + \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen + \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar + \DeclareUnicodeCharacter{00A7}{\S}% + \DeclareUnicodeCharacter{00A8}{\"{ }}% + \DeclareUnicodeCharacter{00A9}{\copyright{}}% + \DeclareUnicodeCharacter{00AA}{\ordf}% + \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}% + \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}% + \DeclareUnicodeCharacter{00AD}{\-}% + \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% + \DeclareUnicodeCharacter{00AF}{\={ }}% + % + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% + \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% + \DeclareUnicodeCharacter{00B2}{$^2$}% + \DeclareUnicodeCharacter{00B3}{$^3$}% + \DeclareUnicodeCharacter{00B4}{\'{ }}% + \DeclareUnicodeCharacter{00B5}{$\mu$}% + \DeclareUnicodeCharacter{00B6}{\P}% + \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}% + \DeclareUnicodeCharacter{00B8}{\cedilla{ }}% + \DeclareUnicodeCharacter{00B9}{$^1$}% + \DeclareUnicodeCharacter{00BA}{\ordm}% + \DeclareUnicodeCharacter{00BB}{\guillemetright{}}% + \DeclareUnicodeCharacter{00BC}{$1\over4$}% + \DeclareUnicodeCharacter{00BD}{$1\over2$}% + \DeclareUnicodeCharacter{00BE}{$3\over4$}% + \DeclareUnicodeCharacter{00BF}{\questiondown}% + % + \DeclareUnicodeCharacter{00C0}{\`A}% + \DeclareUnicodeCharacter{00C1}{\'A}% + \DeclareUnicodeCharacter{00C2}{\^A}% + \DeclareUnicodeCharacter{00C3}{\~A}% + \DeclareUnicodeCharacter{00C4}{\"A}% + \DeclareUnicodeCharacter{00C5}{\AA}% + \DeclareUnicodeCharacter{00C6}{\AE}% + \DeclareUnicodeCharacter{00C7}{\cedilla{C}}% + \DeclareUnicodeCharacter{00C8}{\`E}% + \DeclareUnicodeCharacter{00C9}{\'E}% + \DeclareUnicodeCharacter{00CA}{\^E}% + \DeclareUnicodeCharacter{00CB}{\"E}% + \DeclareUnicodeCharacter{00CC}{\`I}% + \DeclareUnicodeCharacter{00CD}{\'I}% + \DeclareUnicodeCharacter{00CE}{\^I}% + \DeclareUnicodeCharacter{00CF}{\"I}% + % + \DeclareUnicodeCharacter{00D0}{\DH}% + \DeclareUnicodeCharacter{00D1}{\~N}% + \DeclareUnicodeCharacter{00D2}{\`O}% + \DeclareUnicodeCharacter{00D3}{\'O}% + \DeclareUnicodeCharacter{00D4}{\^O}% + \DeclareUnicodeCharacter{00D5}{\~O}% + \DeclareUnicodeCharacter{00D6}{\"O}% + \DeclareUnicodeCharacter{00D7}{\ensuremath\times}% + \DeclareUnicodeCharacter{00D8}{\O}% + \DeclareUnicodeCharacter{00D9}{\`U}% + \DeclareUnicodeCharacter{00DA}{\'U}% + \DeclareUnicodeCharacter{00DB}{\^U}% + \DeclareUnicodeCharacter{00DC}{\"U}% + \DeclareUnicodeCharacter{00DD}{\'Y}% + \DeclareUnicodeCharacter{00DE}{\TH}% + \DeclareUnicodeCharacter{00DF}{\ss}% + % + \DeclareUnicodeCharacter{00E0}{\`a}% + \DeclareUnicodeCharacter{00E1}{\'a}% + \DeclareUnicodeCharacter{00E2}{\^a}% + \DeclareUnicodeCharacter{00E3}{\~a}% + \DeclareUnicodeCharacter{00E4}{\"a}% + \DeclareUnicodeCharacter{00E5}{\aa}% + \DeclareUnicodeCharacter{00E6}{\ae}% + \DeclareUnicodeCharacter{00E7}{\cedilla{c}}% + \DeclareUnicodeCharacter{00E8}{\`e}% + \DeclareUnicodeCharacter{00E9}{\'e}% + \DeclareUnicodeCharacter{00EA}{\^e}% + \DeclareUnicodeCharacter{00EB}{\"e}% + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}% + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}% + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}% + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}% + % + \DeclareUnicodeCharacter{00F0}{\dh}% + \DeclareUnicodeCharacter{00F1}{\~n}% + \DeclareUnicodeCharacter{00F2}{\`o}% + \DeclareUnicodeCharacter{00F3}{\'o}% + \DeclareUnicodeCharacter{00F4}{\^o}% + \DeclareUnicodeCharacter{00F5}{\~o}% + \DeclareUnicodeCharacter{00F6}{\"o}% + \DeclareUnicodeCharacter{00F7}{\ensuremath\div}% + \DeclareUnicodeCharacter{00F8}{\o}% + \DeclareUnicodeCharacter{00F9}{\`u}% + \DeclareUnicodeCharacter{00FA}{\'u}% + \DeclareUnicodeCharacter{00FB}{\^u}% + \DeclareUnicodeCharacter{00FC}{\"u}% + \DeclareUnicodeCharacter{00FD}{\'y}% + \DeclareUnicodeCharacter{00FE}{\th}% + \DeclareUnicodeCharacter{00FF}{\"y}% + % + \DeclareUnicodeCharacter{0100}{\=A}% + \DeclareUnicodeCharacter{0101}{\=a}% + \DeclareUnicodeCharacter{0102}{\u{A}}% + \DeclareUnicodeCharacter{0103}{\u{a}}% + \DeclareUnicodeCharacter{0104}{\ogonek{A}}% + \DeclareUnicodeCharacter{0105}{\ogonek{a}}% + \DeclareUnicodeCharacter{0106}{\'C}% + \DeclareUnicodeCharacter{0107}{\'c}% + \DeclareUnicodeCharacter{0108}{\^C}% + \DeclareUnicodeCharacter{0109}{\^c}% + \DeclareUnicodeCharacter{010A}{\dotaccent{C}}% + \DeclareUnicodeCharacter{010B}{\dotaccent{c}}% + \DeclareUnicodeCharacter{010C}{\v{C}}% + \DeclareUnicodeCharacter{010D}{\v{c}}% + \DeclareUnicodeCharacter{010E}{\v{D}}% + \DeclareUnicodeCharacter{010F}{d'}% + % + \DeclareUnicodeCharacter{0110}{\DH}% + \DeclareUnicodeCharacter{0111}{\dh}% + \DeclareUnicodeCharacter{0112}{\=E}% + \DeclareUnicodeCharacter{0113}{\=e}% + \DeclareUnicodeCharacter{0114}{\u{E}}% + \DeclareUnicodeCharacter{0115}{\u{e}}% + \DeclareUnicodeCharacter{0116}{\dotaccent{E}}% + \DeclareUnicodeCharacter{0117}{\dotaccent{e}}% + \DeclareUnicodeCharacter{0118}{\ogonek{E}}% + \DeclareUnicodeCharacter{0119}{\ogonek{e}}% + \DeclareUnicodeCharacter{011A}{\v{E}}% + \DeclareUnicodeCharacter{011B}{\v{e}}% + \DeclareUnicodeCharacter{011C}{\^G}% + \DeclareUnicodeCharacter{011D}{\^g}% + \DeclareUnicodeCharacter{011E}{\u{G}}% + \DeclareUnicodeCharacter{011F}{\u{g}}% + % + \DeclareUnicodeCharacter{0120}{\dotaccent{G}}% + \DeclareUnicodeCharacter{0121}{\dotaccent{g}}% + \DeclareUnicodeCharacter{0122}{\cedilla{G}}% + \DeclareUnicodeCharacter{0123}{\cedilla{g}}% + \DeclareUnicodeCharacter{0124}{\^H}% + \DeclareUnicodeCharacter{0125}{\^h}% + \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}% + \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}% + \DeclareUnicodeCharacter{0128}{\~I}% + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}% + \DeclareUnicodeCharacter{012A}{\=I}% + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}% + \DeclareUnicodeCharacter{012C}{\u{I}}% + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}% + \DeclareUnicodeCharacter{012E}{\ogonek{I}}% + \DeclareUnicodeCharacter{012F}{\ogonek{i}}% + % + \DeclareUnicodeCharacter{0130}{\dotaccent{I}}% + \DeclareUnicodeCharacter{0131}{\dotless{i}}% + \DeclareUnicodeCharacter{0132}{IJ}% + \DeclareUnicodeCharacter{0133}{ij}% + \DeclareUnicodeCharacter{0134}{\^J}% + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}% + \DeclareUnicodeCharacter{0136}{\cedilla{K}}% + \DeclareUnicodeCharacter{0137}{\cedilla{k}}% + \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}% + \DeclareUnicodeCharacter{0139}{\'L}% + \DeclareUnicodeCharacter{013A}{\'l}% + \DeclareUnicodeCharacter{013B}{\cedilla{L}}% + \DeclareUnicodeCharacter{013C}{\cedilla{l}}% + \DeclareUnicodeCharacter{013D}{L'}% should kern + \DeclareUnicodeCharacter{013E}{l'}% should kern + \DeclareUnicodeCharacter{013F}{L\U{00B7}}% + % + \DeclareUnicodeCharacter{0140}{l\U{00B7}}% + \DeclareUnicodeCharacter{0141}{\L}% + \DeclareUnicodeCharacter{0142}{\l}% + \DeclareUnicodeCharacter{0143}{\'N}% + \DeclareUnicodeCharacter{0144}{\'n}% + \DeclareUnicodeCharacter{0145}{\cedilla{N}}% + \DeclareUnicodeCharacter{0146}{\cedilla{n}}% + \DeclareUnicodeCharacter{0147}{\v{N}}% + \DeclareUnicodeCharacter{0148}{\v{n}}% + \DeclareUnicodeCharacter{0149}{'n}% + \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}% + \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}% + \DeclareUnicodeCharacter{014C}{\=O}% + \DeclareUnicodeCharacter{014D}{\=o}% + \DeclareUnicodeCharacter{014E}{\u{O}}% + \DeclareUnicodeCharacter{014F}{\u{o}}% + % + \DeclareUnicodeCharacter{0150}{\H{O}}% + \DeclareUnicodeCharacter{0151}{\H{o}}% + \DeclareUnicodeCharacter{0152}{\OE}% + \DeclareUnicodeCharacter{0153}{\oe}% + \DeclareUnicodeCharacter{0154}{\'R}% + \DeclareUnicodeCharacter{0155}{\'r}% + \DeclareUnicodeCharacter{0156}{\cedilla{R}}% + \DeclareUnicodeCharacter{0157}{\cedilla{r}}% + \DeclareUnicodeCharacter{0158}{\v{R}}% + \DeclareUnicodeCharacter{0159}{\v{r}}% + \DeclareUnicodeCharacter{015A}{\'S}% + \DeclareUnicodeCharacter{015B}{\'s}% + \DeclareUnicodeCharacter{015C}{\^S}% + \DeclareUnicodeCharacter{015D}{\^s}% + \DeclareUnicodeCharacter{015E}{\cedilla{S}}% + \DeclareUnicodeCharacter{015F}{\cedilla{s}}% + % + \DeclareUnicodeCharacter{0160}{\v{S}}% + \DeclareUnicodeCharacter{0161}{\v{s}}% + \DeclareUnicodeCharacter{0162}{\cedilla{T}}% + \DeclareUnicodeCharacter{0163}{\cedilla{t}}% + \DeclareUnicodeCharacter{0164}{\v{T}}% + \DeclareUnicodeCharacter{0165}{\v{t}}% + \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}% + \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}% + \DeclareUnicodeCharacter{0168}{\~U}% + \DeclareUnicodeCharacter{0169}{\~u}% + \DeclareUnicodeCharacter{016A}{\=U}% + \DeclareUnicodeCharacter{016B}{\=u}% + \DeclareUnicodeCharacter{016C}{\u{U}}% + \DeclareUnicodeCharacter{016D}{\u{u}}% + \DeclareUnicodeCharacter{016E}{\ringaccent{U}}% + \DeclareUnicodeCharacter{016F}{\ringaccent{u}}% + % + \DeclareUnicodeCharacter{0170}{\H{U}}% + \DeclareUnicodeCharacter{0171}{\H{u}}% + \DeclareUnicodeCharacter{0172}{\ogonek{U}}% + \DeclareUnicodeCharacter{0173}{\ogonek{u}}% + \DeclareUnicodeCharacter{0174}{\^W}% + \DeclareUnicodeCharacter{0175}{\^w}% + \DeclareUnicodeCharacter{0176}{\^Y}% + \DeclareUnicodeCharacter{0177}{\^y}% + \DeclareUnicodeCharacter{0178}{\"Y}% + \DeclareUnicodeCharacter{0179}{\'Z}% + \DeclareUnicodeCharacter{017A}{\'z}% + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}% + \DeclareUnicodeCharacter{017C}{\dotaccent{z}}% + \DeclareUnicodeCharacter{017D}{\v{Z}}% + \DeclareUnicodeCharacter{017E}{\v{z}}% + \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}% + % + \DeclareUnicodeCharacter{01C4}{D\v{Z}}% + \DeclareUnicodeCharacter{01C5}{D\v{z}}% + \DeclareUnicodeCharacter{01C6}{d\v{z}}% + \DeclareUnicodeCharacter{01C7}{LJ}% + \DeclareUnicodeCharacter{01C8}{Lj}% + \DeclareUnicodeCharacter{01C9}{lj}% + \DeclareUnicodeCharacter{01CA}{NJ}% + \DeclareUnicodeCharacter{01CB}{Nj}% + \DeclareUnicodeCharacter{01CC}{nj}% + \DeclareUnicodeCharacter{01CD}{\v{A}}% + \DeclareUnicodeCharacter{01CE}{\v{a}}% + \DeclareUnicodeCharacter{01CF}{\v{I}}% + % + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}% + \DeclareUnicodeCharacter{01D1}{\v{O}}% + \DeclareUnicodeCharacter{01D2}{\v{o}}% + \DeclareUnicodeCharacter{01D3}{\v{U}}% + \DeclareUnicodeCharacter{01D4}{\v{u}}% + % + \DeclareUnicodeCharacter{01E2}{\={\AE}}% + \DeclareUnicodeCharacter{01E3}{\={\ae}}% + \DeclareUnicodeCharacter{01E6}{\v{G}}% + \DeclareUnicodeCharacter{01E7}{\v{g}}% + \DeclareUnicodeCharacter{01E8}{\v{K}}% + \DeclareUnicodeCharacter{01E9}{\v{k}}% + % + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}% + \DeclareUnicodeCharacter{01F1}{DZ}% + \DeclareUnicodeCharacter{01F2}{Dz}% + \DeclareUnicodeCharacter{01F3}{dz}% + \DeclareUnicodeCharacter{01F4}{\'G}% + \DeclareUnicodeCharacter{01F5}{\'g}% + \DeclareUnicodeCharacter{01F8}{\`N}% + \DeclareUnicodeCharacter{01F9}{\`n}% + \DeclareUnicodeCharacter{01FC}{\'{\AE}}% + \DeclareUnicodeCharacter{01FD}{\'{\ae}}% + \DeclareUnicodeCharacter{01FE}{\'{\O}}% + \DeclareUnicodeCharacter{01FF}{\'{\o}}% + % + \DeclareUnicodeCharacter{021E}{\v{H}}% + \DeclareUnicodeCharacter{021F}{\v{h}}% + % + \DeclareUnicodeCharacter{0226}{\dotaccent{A}}% + \DeclareUnicodeCharacter{0227}{\dotaccent{a}}% + \DeclareUnicodeCharacter{0228}{\cedilla{E}}% + \DeclareUnicodeCharacter{0229}{\cedilla{e}}% + \DeclareUnicodeCharacter{022E}{\dotaccent{O}}% + \DeclareUnicodeCharacter{022F}{\dotaccent{o}}% + % + \DeclareUnicodeCharacter{0232}{\=Y}% + \DeclareUnicodeCharacter{0233}{\=y}% + \DeclareUnicodeCharacter{0237}{\dotless{j}}% + % + \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% + % + % Greek letters upper case + \DeclareUnicodeCharacter{0391}{{\it A}}% + \DeclareUnicodeCharacter{0392}{{\it B}}% + \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}% + \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}% + \DeclareUnicodeCharacter{0395}{{\it E}}% + \DeclareUnicodeCharacter{0396}{{\it Z}}% + \DeclareUnicodeCharacter{0397}{{\it H}}% + \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}% + \DeclareUnicodeCharacter{0399}{{\it I}}% + \DeclareUnicodeCharacter{039A}{{\it K}}% + \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}% + \DeclareUnicodeCharacter{039C}{{\it M}}% + \DeclareUnicodeCharacter{039D}{{\it N}}% + \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}% + \DeclareUnicodeCharacter{039F}{{\it O}}% + \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}% + \DeclareUnicodeCharacter{03A1}{{\it P}}% + %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma + \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}% + \DeclareUnicodeCharacter{03A4}{{\it T}}% + \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}% + \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}% + \DeclareUnicodeCharacter{03A7}{{\it X}}% + \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}% + \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}% + % + % Vowels with accents + \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}% + \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}% + \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}% + \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}% + \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}% + \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}% + % + % Standalone accent + \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}% + % + % Greek letters lower case + \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}% + \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}% + \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}% + \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}% + \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}% + \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}% + \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}% + \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}% + \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}% + \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}% + \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}% + \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}% + \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}% + \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}% + \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron + \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}% + \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}% + \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}% + \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}% + \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}% + \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}% + \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}% + \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}% + \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}% + \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}% + % + % More Greek vowels with accents + \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}% + \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}% + \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}% + \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}% + \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}% + % + % Variant Greek letters + \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}% + \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}% + \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}% + % + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}% + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}% + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}% + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}% + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}% + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}% + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}% + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}% + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}% + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}% + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}% + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}% + % + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}% + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}% + % + \DeclareUnicodeCharacter{1E20}{\=G}% + \DeclareUnicodeCharacter{1E21}{\=g}% + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}% + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}% + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}% + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}% + \DeclareUnicodeCharacter{1E26}{\"H}% + \DeclareUnicodeCharacter{1E27}{\"h}% + % + \DeclareUnicodeCharacter{1E30}{\'K}% + \DeclareUnicodeCharacter{1E31}{\'k}% + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}% + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}% + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}% + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}% + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}% + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}% + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}% + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}% + \DeclareUnicodeCharacter{1E3E}{\'M}% + \DeclareUnicodeCharacter{1E3F}{\'m}% + % + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}% + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}% + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}% + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}% + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}% + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}% + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}% + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}% + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}% + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}% + % + \DeclareUnicodeCharacter{1E54}{\'P}% + \DeclareUnicodeCharacter{1E55}{\'p}% + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}% + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}% + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}% + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}% + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}% + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}% + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}% + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}% + % + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}% + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}% + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}% + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}% + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}% + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}% + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}% + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}% + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}% + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}% + % + \DeclareUnicodeCharacter{1E7C}{\~V}% + \DeclareUnicodeCharacter{1E7D}{\~v}% + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}% + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}% + % + \DeclareUnicodeCharacter{1E80}{\`W}% + \DeclareUnicodeCharacter{1E81}{\`w}% + \DeclareUnicodeCharacter{1E82}{\'W}% + \DeclareUnicodeCharacter{1E83}{\'w}% + \DeclareUnicodeCharacter{1E84}{\"W}% + \DeclareUnicodeCharacter{1E85}{\"w}% + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}% + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}% + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}% + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}% + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}% + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}% + \DeclareUnicodeCharacter{1E8C}{\"X}% + \DeclareUnicodeCharacter{1E8D}{\"x}% + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}% + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}% + % + \DeclareUnicodeCharacter{1E90}{\^Z}% + \DeclareUnicodeCharacter{1E91}{\^z}% + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}% + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}% + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}% + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}% + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}% + \DeclareUnicodeCharacter{1E97}{\"t}% + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}% + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}% + % + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}% + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}% + % + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}% + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}% + \DeclareUnicodeCharacter{1EBC}{\~E}% + \DeclareUnicodeCharacter{1EBD}{\~e}% + % + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}% + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}% + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}% + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}% + % + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}% + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}% + % + \DeclareUnicodeCharacter{1EF2}{\`Y}% + \DeclareUnicodeCharacter{1EF3}{\`y}% + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}% + % + \DeclareUnicodeCharacter{1EF8}{\~Y}% + \DeclareUnicodeCharacter{1EF9}{\~y}% + % + % Punctuation + \DeclareUnicodeCharacter{2013}{--}% + \DeclareUnicodeCharacter{2014}{---}% + \DeclareUnicodeCharacter{2018}{\quoteleft{}}% + \DeclareUnicodeCharacter{2019}{\quoteright{}}% + \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% + \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% + \DeclareUnicodeCharacter{201D}{\quotedblright{}}% + \DeclareUnicodeCharacter{201E}{\quotedblbase{}}% + \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}% + \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}% + \DeclareUnicodeCharacter{2022}{\bullet{}}% + \DeclareUnicodeCharacter{202F}{\thinspace}% + \DeclareUnicodeCharacter{2026}{\dots{}}% + \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}% + \DeclareUnicodeCharacter{203A}{\guilsinglright{}}% + % + \DeclareUnicodeCharacter{20AC}{\euro{}}% + % + \DeclareUnicodeCharacter{2192}{\expansion{}}% + \DeclareUnicodeCharacter{21D2}{\result{}}% + % + % Mathematical symbols + \DeclareUnicodeCharacter{2200}{\ensuremath\forall}% + \DeclareUnicodeCharacter{2203}{\ensuremath\exists}% + \DeclareUnicodeCharacter{2208}{\ensuremath\in}% + \DeclareUnicodeCharacter{2212}{\minus{}}% + \DeclareUnicodeCharacter{2217}{\ast}% + \DeclareUnicodeCharacter{221E}{\ensuremath\infty}% + \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}% + \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}% + \DeclareUnicodeCharacter{2229}{\ensuremath\cap}% + \DeclareUnicodeCharacter{2261}{\equiv{}}% + \DeclareUnicodeCharacter{2264}{\ensuremath\leq}% + \DeclareUnicodeCharacter{2265}{\ensuremath\geq}% + \DeclareUnicodeCharacter{2282}{\ensuremath\subset}% + \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% + % + \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% + \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% + \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% + \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% + \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% + \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% + \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% + \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% + \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% + \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% + \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}% + \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}% + \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}% + \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}% + \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}% + \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}% + \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}% + \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}% + \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}% + \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% + \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% + \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% + \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% + \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% + \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% + \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}% + \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}% + \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% + \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% + \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% + \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% + \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% + \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% + \DeclareUnicodeCharacter{2209}{\ensuremath\notin}% + \DeclareUnicodeCharacter{220B}{\ensuremath\owns}% + \DeclareUnicodeCharacter{220F}{\ensuremath\prod}% + \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}% + \DeclareUnicodeCharacter{2211}{\ensuremath\sum}% + \DeclareUnicodeCharacter{2213}{\ensuremath\mp}% + \DeclareUnicodeCharacter{2218}{\ensuremath\circ}% + \DeclareUnicodeCharacter{221A}{\ensuremath\surd}% + \DeclareUnicodeCharacter{221D}{\ensuremath\propto}% + \DeclareUnicodeCharacter{2220}{\ensuremath\angle}% + \DeclareUnicodeCharacter{2223}{\ensuremath\mid}% + \DeclareUnicodeCharacter{2228}{\ensuremath\vee}% + \DeclareUnicodeCharacter{222A}{\ensuremath\cup}% + \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}% + \DeclareUnicodeCharacter{222E}{\ensuremath\oint}% + \DeclareUnicodeCharacter{223C}{\ensuremath\sim}% + \DeclareUnicodeCharacter{2240}{\ensuremath\wr}% + \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}% + \DeclareUnicodeCharacter{2245}{\ensuremath\cong}% + \DeclareUnicodeCharacter{2248}{\ensuremath\approx}% + \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}% + \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}% + \DeclareUnicodeCharacter{2260}{\ensuremath\neq}% + \DeclareUnicodeCharacter{226A}{\ensuremath\ll}% + \DeclareUnicodeCharacter{226B}{\ensuremath\gg}% + \DeclareUnicodeCharacter{227A}{\ensuremath\prec}% + \DeclareUnicodeCharacter{227B}{\ensuremath\succ}% + \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% + \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% + \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% + \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% + \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% + \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% + \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}% + \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}% + \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}% + \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}% + \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}% + \DeclareUnicodeCharacter{2299}{\ensuremath\odot}% + \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}% + \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}% + \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% + \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% + \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% + \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% + \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% + \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% + \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}% + \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}% + \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}% + \DeclareUnicodeCharacter{22C6}{\ensuremath\star}% + \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}% + \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}% + \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}% + \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}% + \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}% + \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% + \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% + % + \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% + \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% + \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% + \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% + \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}% + \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% + \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% + \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% + \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}% + \DeclareUnicodeCharacter{266D}{\ensuremath\flat}% + \DeclareUnicodeCharacter{266E}{\ensuremath\natural}% + \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}% + \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}% + \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}% + \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}% + \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}% + \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}% + \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}% + \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}% + \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}% + \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}% + \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}% + \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}% + \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% + \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% + \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% + \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% + \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% + \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% + % + \global\mathchardef\checkmark="1370% actually the square root sign + \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% +}% end of \unicodechardefs + +% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) +% It makes the setting that replace UTF-8 byte sequence. \def\utfeightchardefs{% - \DeclareUnicodeCharacter{00A0}{\tie} - \DeclareUnicodeCharacter{00A1}{\exclamdown} - \DeclareUnicodeCharacter{00A3}{\pounds} - \DeclareUnicodeCharacter{00A8}{\"{ }} - \DeclareUnicodeCharacter{00A9}{\copyright} - \DeclareUnicodeCharacter{00AA}{\ordf} - \DeclareUnicodeCharacter{00AB}{\guillemetleft} - \DeclareUnicodeCharacter{00AD}{\-} - \DeclareUnicodeCharacter{00AE}{\registeredsymbol} - \DeclareUnicodeCharacter{00AF}{\={ }} - - \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} - \DeclareUnicodeCharacter{00B4}{\'{ }} - \DeclareUnicodeCharacter{00B8}{\cedilla{ }} - \DeclareUnicodeCharacter{00BA}{\ordm} - \DeclareUnicodeCharacter{00BB}{\guillemetright} - \DeclareUnicodeCharacter{00BF}{\questiondown} - - \DeclareUnicodeCharacter{00C0}{\`A} - \DeclareUnicodeCharacter{00C1}{\'A} - \DeclareUnicodeCharacter{00C2}{\^A} - \DeclareUnicodeCharacter{00C3}{\~A} - \DeclareUnicodeCharacter{00C4}{\"A} - \DeclareUnicodeCharacter{00C5}{\AA} - \DeclareUnicodeCharacter{00C6}{\AE} - \DeclareUnicodeCharacter{00C7}{\cedilla{C}} - \DeclareUnicodeCharacter{00C8}{\`E} - \DeclareUnicodeCharacter{00C9}{\'E} - \DeclareUnicodeCharacter{00CA}{\^E} - \DeclareUnicodeCharacter{00CB}{\"E} - \DeclareUnicodeCharacter{00CC}{\`I} - \DeclareUnicodeCharacter{00CD}{\'I} - \DeclareUnicodeCharacter{00CE}{\^I} - \DeclareUnicodeCharacter{00CF}{\"I} - - \DeclareUnicodeCharacter{00D0}{\DH} - \DeclareUnicodeCharacter{00D1}{\~N} - \DeclareUnicodeCharacter{00D2}{\`O} - \DeclareUnicodeCharacter{00D3}{\'O} - \DeclareUnicodeCharacter{00D4}{\^O} - \DeclareUnicodeCharacter{00D5}{\~O} - \DeclareUnicodeCharacter{00D6}{\"O} - \DeclareUnicodeCharacter{00D8}{\O} - \DeclareUnicodeCharacter{00D9}{\`U} - \DeclareUnicodeCharacter{00DA}{\'U} - \DeclareUnicodeCharacter{00DB}{\^U} - \DeclareUnicodeCharacter{00DC}{\"U} - \DeclareUnicodeCharacter{00DD}{\'Y} - \DeclareUnicodeCharacter{00DE}{\TH} - \DeclareUnicodeCharacter{00DF}{\ss} - - \DeclareUnicodeCharacter{00E0}{\`a} - \DeclareUnicodeCharacter{00E1}{\'a} - \DeclareUnicodeCharacter{00E2}{\^a} - \DeclareUnicodeCharacter{00E3}{\~a} - \DeclareUnicodeCharacter{00E4}{\"a} - \DeclareUnicodeCharacter{00E5}{\aa} - \DeclareUnicodeCharacter{00E6}{\ae} - \DeclareUnicodeCharacter{00E7}{\cedilla{c}} - \DeclareUnicodeCharacter{00E8}{\`e} - \DeclareUnicodeCharacter{00E9}{\'e} - \DeclareUnicodeCharacter{00EA}{\^e} - \DeclareUnicodeCharacter{00EB}{\"e} - \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} - \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} - \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} - \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} - - \DeclareUnicodeCharacter{00F0}{\dh} - \DeclareUnicodeCharacter{00F1}{\~n} - \DeclareUnicodeCharacter{00F2}{\`o} - \DeclareUnicodeCharacter{00F3}{\'o} - \DeclareUnicodeCharacter{00F4}{\^o} - \DeclareUnicodeCharacter{00F5}{\~o} - \DeclareUnicodeCharacter{00F6}{\"o} - \DeclareUnicodeCharacter{00F8}{\o} - \DeclareUnicodeCharacter{00F9}{\`u} - \DeclareUnicodeCharacter{00FA}{\'u} - \DeclareUnicodeCharacter{00FB}{\^u} - \DeclareUnicodeCharacter{00FC}{\"u} - \DeclareUnicodeCharacter{00FD}{\'y} - \DeclareUnicodeCharacter{00FE}{\th} - \DeclareUnicodeCharacter{00FF}{\"y} - - \DeclareUnicodeCharacter{0100}{\=A} - \DeclareUnicodeCharacter{0101}{\=a} - \DeclareUnicodeCharacter{0102}{\u{A}} - \DeclareUnicodeCharacter{0103}{\u{a}} - \DeclareUnicodeCharacter{0104}{\ogonek{A}} - \DeclareUnicodeCharacter{0105}{\ogonek{a}} - \DeclareUnicodeCharacter{0106}{\'C} - \DeclareUnicodeCharacter{0107}{\'c} - \DeclareUnicodeCharacter{0108}{\^C} - \DeclareUnicodeCharacter{0109}{\^c} - \DeclareUnicodeCharacter{0118}{\ogonek{E}} - \DeclareUnicodeCharacter{0119}{\ogonek{e}} - \DeclareUnicodeCharacter{010A}{\dotaccent{C}} - \DeclareUnicodeCharacter{010B}{\dotaccent{c}} - \DeclareUnicodeCharacter{010C}{\v{C}} - \DeclareUnicodeCharacter{010D}{\v{c}} - \DeclareUnicodeCharacter{010E}{\v{D}} - - \DeclareUnicodeCharacter{0112}{\=E} - \DeclareUnicodeCharacter{0113}{\=e} - \DeclareUnicodeCharacter{0114}{\u{E}} - \DeclareUnicodeCharacter{0115}{\u{e}} - \DeclareUnicodeCharacter{0116}{\dotaccent{E}} - \DeclareUnicodeCharacter{0117}{\dotaccent{e}} - \DeclareUnicodeCharacter{011A}{\v{E}} - \DeclareUnicodeCharacter{011B}{\v{e}} - \DeclareUnicodeCharacter{011C}{\^G} - \DeclareUnicodeCharacter{011D}{\^g} - \DeclareUnicodeCharacter{011E}{\u{G}} - \DeclareUnicodeCharacter{011F}{\u{g}} - - \DeclareUnicodeCharacter{0120}{\dotaccent{G}} - \DeclareUnicodeCharacter{0121}{\dotaccent{g}} - \DeclareUnicodeCharacter{0124}{\^H} - \DeclareUnicodeCharacter{0125}{\^h} - \DeclareUnicodeCharacter{0128}{\~I} - \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} - \DeclareUnicodeCharacter{012A}{\=I} - \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} - \DeclareUnicodeCharacter{012C}{\u{I}} - \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} - - \DeclareUnicodeCharacter{0130}{\dotaccent{I}} - \DeclareUnicodeCharacter{0131}{\dotless{i}} - \DeclareUnicodeCharacter{0132}{IJ} - \DeclareUnicodeCharacter{0133}{ij} - \DeclareUnicodeCharacter{0134}{\^J} - \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} - \DeclareUnicodeCharacter{0139}{\'L} - \DeclareUnicodeCharacter{013A}{\'l} - - \DeclareUnicodeCharacter{0141}{\L} - \DeclareUnicodeCharacter{0142}{\l} - \DeclareUnicodeCharacter{0143}{\'N} - \DeclareUnicodeCharacter{0144}{\'n} - \DeclareUnicodeCharacter{0147}{\v{N}} - \DeclareUnicodeCharacter{0148}{\v{n}} - \DeclareUnicodeCharacter{014C}{\=O} - \DeclareUnicodeCharacter{014D}{\=o} - \DeclareUnicodeCharacter{014E}{\u{O}} - \DeclareUnicodeCharacter{014F}{\u{o}} - - \DeclareUnicodeCharacter{0150}{\H{O}} - \DeclareUnicodeCharacter{0151}{\H{o}} - \DeclareUnicodeCharacter{0152}{\OE} - \DeclareUnicodeCharacter{0153}{\oe} - \DeclareUnicodeCharacter{0154}{\'R} - \DeclareUnicodeCharacter{0155}{\'r} - \DeclareUnicodeCharacter{0158}{\v{R}} - \DeclareUnicodeCharacter{0159}{\v{r}} - \DeclareUnicodeCharacter{015A}{\'S} - \DeclareUnicodeCharacter{015B}{\'s} - \DeclareUnicodeCharacter{015C}{\^S} - \DeclareUnicodeCharacter{015D}{\^s} - \DeclareUnicodeCharacter{015E}{\cedilla{S}} - \DeclareUnicodeCharacter{015F}{\cedilla{s}} - - \DeclareUnicodeCharacter{0160}{\v{S}} - \DeclareUnicodeCharacter{0161}{\v{s}} - \DeclareUnicodeCharacter{0162}{\cedilla{t}} - \DeclareUnicodeCharacter{0163}{\cedilla{T}} - \DeclareUnicodeCharacter{0164}{\v{T}} - - \DeclareUnicodeCharacter{0168}{\~U} - \DeclareUnicodeCharacter{0169}{\~u} - \DeclareUnicodeCharacter{016A}{\=U} - \DeclareUnicodeCharacter{016B}{\=u} - \DeclareUnicodeCharacter{016C}{\u{U}} - \DeclareUnicodeCharacter{016D}{\u{u}} - \DeclareUnicodeCharacter{016E}{\ringaccent{U}} - \DeclareUnicodeCharacter{016F}{\ringaccent{u}} - - \DeclareUnicodeCharacter{0170}{\H{U}} - \DeclareUnicodeCharacter{0171}{\H{u}} - \DeclareUnicodeCharacter{0174}{\^W} - \DeclareUnicodeCharacter{0175}{\^w} - \DeclareUnicodeCharacter{0176}{\^Y} - \DeclareUnicodeCharacter{0177}{\^y} - \DeclareUnicodeCharacter{0178}{\"Y} - \DeclareUnicodeCharacter{0179}{\'Z} - \DeclareUnicodeCharacter{017A}{\'z} - \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} - \DeclareUnicodeCharacter{017C}{\dotaccent{z}} - \DeclareUnicodeCharacter{017D}{\v{Z}} - \DeclareUnicodeCharacter{017E}{\v{z}} - - \DeclareUnicodeCharacter{01C4}{D\v{Z}} - \DeclareUnicodeCharacter{01C5}{D\v{z}} - \DeclareUnicodeCharacter{01C6}{d\v{z}} - \DeclareUnicodeCharacter{01C7}{LJ} - \DeclareUnicodeCharacter{01C8}{Lj} - \DeclareUnicodeCharacter{01C9}{lj} - \DeclareUnicodeCharacter{01CA}{NJ} - \DeclareUnicodeCharacter{01CB}{Nj} - \DeclareUnicodeCharacter{01CC}{nj} - \DeclareUnicodeCharacter{01CD}{\v{A}} - \DeclareUnicodeCharacter{01CE}{\v{a}} - \DeclareUnicodeCharacter{01CF}{\v{I}} - - \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} - \DeclareUnicodeCharacter{01D1}{\v{O}} - \DeclareUnicodeCharacter{01D2}{\v{o}} - \DeclareUnicodeCharacter{01D3}{\v{U}} - \DeclareUnicodeCharacter{01D4}{\v{u}} - - \DeclareUnicodeCharacter{01E2}{\={\AE}} - \DeclareUnicodeCharacter{01E3}{\={\ae}} - \DeclareUnicodeCharacter{01E6}{\v{G}} - \DeclareUnicodeCharacter{01E7}{\v{g}} - \DeclareUnicodeCharacter{01E8}{\v{K}} - \DeclareUnicodeCharacter{01E9}{\v{k}} - - \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} - \DeclareUnicodeCharacter{01F1}{DZ} - \DeclareUnicodeCharacter{01F2}{Dz} - \DeclareUnicodeCharacter{01F3}{dz} - \DeclareUnicodeCharacter{01F4}{\'G} - \DeclareUnicodeCharacter{01F5}{\'g} - \DeclareUnicodeCharacter{01F8}{\`N} - \DeclareUnicodeCharacter{01F9}{\`n} - \DeclareUnicodeCharacter{01FC}{\'{\AE}} - \DeclareUnicodeCharacter{01FD}{\'{\ae}} - \DeclareUnicodeCharacter{01FE}{\'{\O}} - \DeclareUnicodeCharacter{01FF}{\'{\o}} - - \DeclareUnicodeCharacter{021E}{\v{H}} - \DeclareUnicodeCharacter{021F}{\v{h}} - - \DeclareUnicodeCharacter{0226}{\dotaccent{A}} - \DeclareUnicodeCharacter{0227}{\dotaccent{a}} - \DeclareUnicodeCharacter{0228}{\cedilla{E}} - \DeclareUnicodeCharacter{0229}{\cedilla{e}} - \DeclareUnicodeCharacter{022E}{\dotaccent{O}} - \DeclareUnicodeCharacter{022F}{\dotaccent{o}} - - \DeclareUnicodeCharacter{0232}{\=Y} - \DeclareUnicodeCharacter{0233}{\=y} - \DeclareUnicodeCharacter{0237}{\dotless{j}} - - \DeclareUnicodeCharacter{02DB}{\ogonek{ }} - - \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} - \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} - \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} - \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} - \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} - \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} - \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} - \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} - \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} - \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} - \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} - \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} - - \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} - \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} - - \DeclareUnicodeCharacter{1E20}{\=G} - \DeclareUnicodeCharacter{1E21}{\=g} - \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} - \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} - \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} - \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} - \DeclareUnicodeCharacter{1E26}{\"H} - \DeclareUnicodeCharacter{1E27}{\"h} - - \DeclareUnicodeCharacter{1E30}{\'K} - \DeclareUnicodeCharacter{1E31}{\'k} - \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} - \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} - \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} - \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} - \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} - \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} - \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} - \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} - \DeclareUnicodeCharacter{1E3E}{\'M} - \DeclareUnicodeCharacter{1E3F}{\'m} - - \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} - \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} - \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} - \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} - \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} - \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} - \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} - \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} - \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} - \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} - - \DeclareUnicodeCharacter{1E54}{\'P} - \DeclareUnicodeCharacter{1E55}{\'p} - \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} - \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} - \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} - \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} - \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} - \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} - \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} - \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} - - \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} - \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} - \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} - \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} - \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} - \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} - \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} - \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} - \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} - \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} - - \DeclareUnicodeCharacter{1E7C}{\~V} - \DeclareUnicodeCharacter{1E7D}{\~v} - \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} - \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} - - \DeclareUnicodeCharacter{1E80}{\`W} - \DeclareUnicodeCharacter{1E81}{\`w} - \DeclareUnicodeCharacter{1E82}{\'W} - \DeclareUnicodeCharacter{1E83}{\'w} - \DeclareUnicodeCharacter{1E84}{\"W} - \DeclareUnicodeCharacter{1E85}{\"w} - \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} - \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} - \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} - \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} - \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} - \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} - \DeclareUnicodeCharacter{1E8C}{\"X} - \DeclareUnicodeCharacter{1E8D}{\"x} - \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} - \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} - - \DeclareUnicodeCharacter{1E90}{\^Z} - \DeclareUnicodeCharacter{1E91}{\^z} - \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} - \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} - \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} - \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} - \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} - \DeclareUnicodeCharacter{1E97}{\"t} - \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} - \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} - - \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} - \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} - - \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} - \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} - \DeclareUnicodeCharacter{1EBC}{\~E} - \DeclareUnicodeCharacter{1EBD}{\~e} - - \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} - \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} - \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} - \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} - - \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} - \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} - - \DeclareUnicodeCharacter{1EF2}{\`Y} - \DeclareUnicodeCharacter{1EF3}{\`y} - \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} - - \DeclareUnicodeCharacter{1EF8}{\~Y} - \DeclareUnicodeCharacter{1EF9}{\~y} - - \DeclareUnicodeCharacter{2013}{--} - \DeclareUnicodeCharacter{2014}{---} - \DeclareUnicodeCharacter{2018}{\quoteleft} - \DeclareUnicodeCharacter{2019}{\quoteright} - \DeclareUnicodeCharacter{201A}{\quotesinglbase} - \DeclareUnicodeCharacter{201C}{\quotedblleft} - \DeclareUnicodeCharacter{201D}{\quotedblright} - \DeclareUnicodeCharacter{201E}{\quotedblbase} - \DeclareUnicodeCharacter{2022}{\bullet} - \DeclareUnicodeCharacter{2026}{\dots} - \DeclareUnicodeCharacter{2039}{\guilsinglleft} - \DeclareUnicodeCharacter{203A}{\guilsinglright} - \DeclareUnicodeCharacter{20AC}{\euro} - - \DeclareUnicodeCharacter{2192}{\expansion} - \DeclareUnicodeCharacter{21D2}{\result} - - \DeclareUnicodeCharacter{2212}{\minus} - \DeclareUnicodeCharacter{2217}{\point} - \DeclareUnicodeCharacter{2261}{\equiv} -}% end of \utfeightchardefs + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii + \unicodechardefs +} +% Whether the active definitions of non-ASCII characters expand to +% non-active tokens with the same character code. This is used to +% write characters literally, instead of using active definitions for +% printing the correct glyphs. +\newif\ifpassthroughchars +\passthroughcharsfalse + +% For native Unicode handling (XeTeX and LuaTeX), +% provide a definition macro to replace/pass-through a Unicode character +% +\def\DeclareUnicodeCharacterNative#1#2{% + \catcode"#1=\active + \def\dodeclareunicodecharacternative##1##2##3{% + \begingroup + \uccode`\~="##2\relax + \uppercase{\gdef~}{% + \ifpassthroughchars + ##1% + \else + ##3% + \fi + } + \endgroup + } + \begingroup + \uccode`\.="#1\relax + \uppercase{\def\UTFNativeTmp{.}}% + \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}% + \endgroup +} + +% Native Unicode handling (XeTeX and LuaTeX) character replacing definition. +% It activates the setting that replaces Unicode characters. +\def\nativeunicodechardefs{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative + \unicodechardefs +} + +% For native Unicode handling (XeTeX and LuaTeX), +% make the character token expand +% to the sequences given in \unicodechardefs for printing. +\def\DeclareUnicodeCharacterNativeAtU#1#2{% + \def\UTFAtUTmp{#2} + \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp +} + +% @U command definitions for native Unicode handling (XeTeX and LuaTeX). +\def\nativeunicodechardefsatu{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU + \unicodechardefs +} % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } +% define all Unicode characters we know about, for the sake of @U. +\iftxinativeunicodecapable + \nativeunicodechardefsatu +\else + \utfeightchardefs +\fi + + % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. @@ -9708,12 +11305,12 @@ directory should work if nowhere else does.} \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin - \pageheight = \vsize + \txipageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in - \pagewidth = \hsize + \txipagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax @@ -9725,6 +11322,14 @@ directory should work if nowhere else does.} % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in + \else + \ifx\XeTeXrevision\thisisundefined + \special{papersize=#8,#7}% + \else + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % XeTeX does not have \pdfhorigin and \pdfvorigin. + \fi \fi % \setleading{\textleading} @@ -9757,7 +11362,6 @@ directory should work if nowhere else does.} % \lispnarrowing = 0.3in \tolerance = 700 - \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} @@ -9775,7 +11379,6 @@ directory should work if nowhere else does.} % \lispnarrowing = 0.25in \tolerance = 700 - \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} @@ -9801,7 +11404,6 @@ directory should work if nowhere else does.} {297mm}{210mm}% % \tolerance = 700 - \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} @@ -9820,7 +11422,6 @@ directory should work if nowhere else does.} % \lispnarrowing = 0.2in \tolerance = 800 - \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm @@ -9862,9 +11463,11 @@ directory should work if nowhere else does.} % \dimen0 = #1\relax \advance\dimen0 by \voffset + \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page % \dimen2 = \hsize \advance\dimen2 by \normaloffset + \advance\dimen2 by 1in % reference point is 1 inch from left edge of page % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% @@ -9876,6 +11479,9 @@ directory should work if nowhere else does.} % \letterpaper +% Default value of \hfuzz, for suppressing warnings about overfull hboxes. +\hfuzz = 1pt + \message{and turning on texinfo input format.} @@ -9912,44 +11518,47 @@ directory should work if nowhere else does.} % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} -% Turn off all special characters except @ -% (and those which the user can use as if they were ordinary). +% Set catcodes for Texinfo file + +% Active characters for printing the wanted glyph. % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. - +% \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote -\catcode`\~=\active -\def~{{\tt\char126}} -\chardef\hat=`\^ -\catcode`\^=\active -\def^{{\tt \hat}} +\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde +\chardef\hatchar=`\^ +\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} -\let\realunder=_ -% Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } +\let\realunder=_ + +\catcode`\|=\active \def|{{\tt\char124}} -\catcode`\|=\active -\def|{{\tt\char124}} \chardef \less=`\< -\catcode`\<=\active -\def<{{\tt \less}} +\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless \chardef \gtr=`\> -\catcode`\>=\active -\def>{{\tt \gtr}} -\catcode`\+=\active -\def+{{\tt \char 43}} -\catcode`\$=\active -\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix +\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr +\catcode`\+=\active \def+{{\tt \char 43}} +\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix +\catcode`\-=\active \let-=\normaldash -% If a .fmt file is being used, characters that might appear in a file -% name cannot be active until we have parsed the command line. -% So turn them off again, and have \everyjob (or @setfilename) turn them on. -% \otherifyactive is called near the end of this file. -\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +% used for headline/footline in the output routine, in case the page +% breaks in the middle of an @tex block. +\def\texinfochars{% + \let< = \activeless + \let> = \activegtr + \let~ = \activetilde + \let^ = \activehat + \markupsetuplqdefault \markupsetuprqdefault + \let\b = \strong + \let\i = \smartitalic + % in principle, all other definitions in \tex have to be undone too. +} % Used sometimes to turn off (effectively) the active characters even after % parsing them. @@ -9969,23 +11578,22 @@ directory should work if nowhere else does.} % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} -% In texinfo, backslash is an active character; it prints the backslash +% In Texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. -% The story here is that in math mode, the \char of \backslashcurfont -% ends up printing the roman \ from the math symbol font (because \char -% in math mode uses the \mathcode, and plain.tex sets -% \mathcode`\\="026E). It seems better for @backslashchar{} to always -% print a typewriter backslash, hence we use an explicit \mathchar, +% Print a typewriter backslash. For math mode, we can't simply use +% \backslashcurfont: the story here is that in math mode, the \char +% of \backslashcurfont ends up printing the roman \ from the math symbol +% font (because \char in math mode uses the \mathcode, and plain.tex +% sets \mathcode`\\="026E). Hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. -@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} -@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. -% On startup, @fixbackslash assigns: -% @let \ = @normalbackslash +@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. + % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @@ -9993,51 +11601,93 @@ directory should work if nowhere else does.} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of -% the literal character `\'. Also revert - to its normal character, in -% case the active - from code has slipped in. +% the literal character `\'. % {@catcode`- = @active @gdef@normalturnoffactive{% + @passthroughcharstrue @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater - @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde + @let\=@ttbackslash @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } -% Make _ and + \other characters, temporarily. -% This is canceled by @fixbackslash. -@otherifyactive +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have @fixbackslash turn them back on. +@catcode`+=@other @catcode`@_=@other +% \enablebackslashhack - allow file to begin `\input texinfo' +% % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. -% -@gdef@eatinput input texinfo{@fixbackslash} -@global@let\ = @eatinput +% If the file did not have a `\input texinfo', then it is turned off after +% the first line; otherwise the first `\' in the file would cause an error. +% This is used on the very last line of this file, texinfo.tex. +% We also use @c to call @fixbackslash, in case ends of lines are hidden. +{ +@catcode`@^=7 +@catcode`@^^M=13@gdef@enablebackslashhack{% + @global@let\ = @eatinput% + @catcode`@^^M=13% + @def@c{@fixbackslash@c}% + % Definition for the newline at the end of this file. + @def ^^M{@let^^M@secondlinenl}% + % Definition for a newline in the main Texinfo file. + @gdef @secondlinenl{@fixbackslash}% + % In case the first line has a whole-line command on it + @let@originalparsearg@parsearg + @def@parsearg{@fixbackslash@originalparsearg} +}} + +{@catcode`@^=7 @catcode`@^^M=13% +@gdef@eatinput input texinfo#1^^M{@fixbackslash}} + +% Emergency active definition of newline, in case an active newline token +% appears by mistake. +{@catcode`@^=7 @catcode13=13% +@gdef@enableemergencynewline{% + @gdef^^M{% + @par% + %@par% +}}} + -% On the other hand, perhaps the file did not have a `\input texinfo'. Then -% the first `\' in the file would cause an error. This macro tries to fix -% that, assuming it is called before the first `\' could plausibly occur. -% Also turn back on active characters that might appear in the input -% file name, in case not using a pre-dumped format. -% @gdef@fixbackslash{% - @ifx\@eatinput @let\ = @normalbackslash @fi + @ifx\@eatinput @let\ = @ttbackslash @fi + @catcode13=5 % regular end of line + @enableemergencynewline + @let@c=@texinfoc + @let@parsearg@originalparsearg + % Also turn back on active characters that might appear in the input + % file name, in case not using a pre-dumped format. @catcode`+=@active @catcode`@_=@active + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets + % called at the beginning of every Texinfo file. Not opening texinfo.cnf + % directly in this file, texinfo.tex, makes it possible to make a format + % file for Texinfo. + % + @openin 1 texinfo.cnf + @ifeof 1 @else @input texinfo.cnf @fi + @closein 1 } + % Say @foo, not \foo, in error messages. @escapechar = `@@ @@ -10065,8 +11715,8 @@ directory should work if nowhere else does.} @markupsetuprqdefault @c Local variables: -@c eval: (add-hook 'write-file-hooks 'time-stamp) -@c page-delimiter: "^\\\\message" +@c eval: (add-hook 'before-save-hook 'time-stamp) +@c page-delimiter: "^\\\\message\\|emacs-page" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @@ -10074,6 +11724,4 @@ directory should work if nowhere else does.} @c vim:sw=2: -@ignore - arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 -@end ignore +@enablebackslashhack diff --git a/build-aux/update-b4-copyright b/build-aux/update-b4-copyright index 5ba7dd6..8946378 100755 --- a/build-aux/update-b4-copyright +++ b/build-aux/update-b4-copyright @@ -3,7 +3,7 @@ # Update b4_copyright invocations or b4_copyright_years definitions to # include the current year. -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/build-aux/update-copyright b/build-aux/update-copyright index c72d0e6..f2fc97e 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -1,11 +1,11 @@ -eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}' +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' & eval 'exec perl -wS -0777 -pi "$0" $argv:q' if 0; # Update an FSF copyright year list to include the current year. -my $VERSION = '2013-01-03.09:41'; # UTC +my $VERSION = '2018-03-07.03:47'; # UTC -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ my $VERSION = '2013-01-03.09:41'; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # Written by Jim Meyering and Joel E. Denny @@ -81,6 +81,7 @@ my $VERSION = '2013-01-03.09:41'; # UTC # B. (c) # C. @copyright{} # D. © +# E. © # # 4. The "Copyright" appears at the beginning of a line, except that it # may be prefixed by any sequence (e.g., a comment) of no more than @@ -124,7 +125,7 @@ use strict; use warnings; my $copyright_re = 'Copyright'; -my $circle_c_re = '(?:\([cC]\)|@copyright{}|©)'; +my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©|©)'; my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; $holder ||= 'Free Software Foundation, Inc.'; my $prefix_max = 5; @@ -263,12 +264,14 @@ else print STDERR "$ARGV: warning: copyright statement not found\n"; } +# Hey Emacs! # Local variables: +# coding: utf-8 # mode: perl # indent-tabs-mode: nil -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "my $VERSION = '" # time-stamp-format: "%:y-%02m-%02d.%02H:%02M" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "'; # UTC" # End: diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free index 663347a..2d4d13f 100755 --- a/build-aux/useless-if-before-free +++ b/build-aux/useless-if-before-free @@ -1,16 +1,16 @@ -eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}' +eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"' & eval 'exec perl -wST "$0" $argv:q' if 0; # Detect instances of "if (p) free (p);". # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. -my $VERSION = '2012-01-06 07:23'; # UTC +my $VERSION = '2018-03-07 03:47'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2008-2013 Free Software Foundation, Inc. +# Copyright (C) 2008-2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ my $VERSION = '2012-01-06 07:23'; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # Written by Jim Meyering @@ -33,7 +33,7 @@ use Getopt::Long; (my $ME = $0) =~ s|.*/||; -# use File::Coda; # http://meyering.net/code/Coda/ +# use File::Coda; # https://meyering.net/code/Coda/ END { defined fileno STDOUT or return; close STDOUT and return; @@ -129,6 +129,9 @@ sub is_NULL ($) $err = EXIT_ERROR, next; while (defined (my $line = )) { + # Skip non-matching lines early to save time + $line =~ /\bif\b/ + or next; while ($line =~ /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\) # 1 2 3 @@ -199,9 +202,9 @@ EOF ## Local Variables: ## mode: perl ## indent-tabs-mode: nil -## eval: (add-hook 'write-file-hooks 'time-stamp) +## eval: (add-hook 'before-save-hook 'time-stamp) ## time-stamp-start: "my $VERSION = '" ## time-stamp-format: "%:y-%02m-%02d %02H:%02M" -## time-stamp-time-zone: "UTC" +## time-stamp-time-zone: "UTC0" ## time-stamp-end: "'; # UTC" ## End: diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files index 7ec335f..12f191b 100755 --- a/build-aux/vc-list-files +++ b/build-aux/vc-list-files @@ -2,9 +2,9 @@ # List version-controlled file names. # Print a version string. -scriptversion=2011-05-16.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ scriptversion=2011-05-16.22; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # List the specified version-controlled files. @@ -49,7 +49,7 @@ EOF cat < +License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. EOF @@ -65,7 +65,7 @@ test $# = 0 && set . for dir do - if test -d .git; then + if test -d .git || test -f .git; then test "x$dir" = x. \ && dir= sed_esc= \ || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; } @@ -105,9 +105,9 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/ylwrap b/build-aux/ylwrap index 1c4d776..5943168 100755 --- a/build-aux/ylwrap +++ b/build-aux/ylwrap @@ -1,9 +1,9 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -scriptversion=2012-12-21.17; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # Written by Tom Tromey . # @@ -18,7 +18,7 @@ scriptversion=2012-12-21.17; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -40,7 +40,7 @@ get_dirname () # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. -guard() +guard () { printf '%s\n' "$1" \ | sed \ @@ -96,17 +96,17 @@ esac # The input. -input="$1" +input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` -case "$input" in +case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. - input="`pwd`/$input" + input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` @@ -132,8 +132,8 @@ sed_fix_filenames= # guard in its implementation file. sed_fix_header_guards= -while test "$#" -ne 0; do - if test "$1" = "--"; then +while test $# -ne 0; do + if test x"$1" = x"--"; then shift break fi @@ -153,16 +153,14 @@ while test "$#" -ne 0; do done # The program to run. -prog="$1" +prog=$1 shift # Make any relative path in $prog absolute. -case "$prog" in +case $prog in [\\/]* | ?:[\\/]*) ;; - *[\\/]*) prog="`pwd`/$prog" ;; + *[\\/]*) prog=`pwd`/$prog ;; esac -# FIXME: add hostname here for parallel makes that run commands on -# other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 @@ -188,7 +186,7 @@ if test $ret -eq 0; then # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; - *) target="../$to";; + *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless @@ -197,7 +195,7 @@ if test $ret -eq 0; then # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then - realtarget="$target" + realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi @@ -241,9 +239,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/cfg.mk b/cfg.mk index 3418ac3..63b1018 100644 --- a/cfg.mk +++ b/cfg.mk @@ -1,5 +1,5 @@ # Customize maint.mk -*- makefile -*- -# Copyright (C) 2008-2013 Free Software Foundation, Inc. +# Copyright (C) 2008-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,15 +37,9 @@ url_dir_list = \ ftp://$(gnu_rel_host)/gnu/bison # Tests not to run as part of "make distcheck". -# Exclude changelog-check here so that there's less churn in ChangeLog -# files -- otherwise, you'd need to have the upcoming version number -# at the top of the file for each `make distcheck' run. -local-checks-to-skip = \ - changelog-check \ +local-checks-to-skip = \ sc_immutable_NEWS \ - sc_prohibit_always_true_header_tests \ - sc_prohibit_atoi_atof \ - sc_prohibit_strcmp + sc_prohibit_atoi_atof # The local directory containing the checked-out copy of gnulib used in # this release. Used solely to get a date for the "announcement" target. @@ -61,6 +55,11 @@ update-copyright: update-b4-copyright update-package-copyright-year update-copyright-env = \ UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1 + +## -------------------- ## +## More syntax-checks. ## +## -------------------- ## + # At least for Mac OS X's grep, the order between . and [ in "[^.[]" # matters: # $ LC_ALL=fr_FR grep -nE '[^[.]' /dev/null @@ -73,21 +72,110 @@ sc_at_parser_check: halt='use AT_PARSER_CHECK for and only for generated parsers' \ $(_sc_search_regexp) +# Indent only with spaces. +# Taken from Coreutils. +sc_prohibit_tab_based_indentation: + @prohibit='^ * ' \ + halt='TAB in indentation; use only spaces' \ + $(_sc_search_regexp) + +# Prohibit the use of `...` in tests/. Use $(...) instead. +# Taken from Coreutils. +# Not ready for Bison yet. +#sc_prohibit_test_backticks: +# @prohibit='`' in_vc_files='^tests/' \ +# halt='use $$(...), not `...` in tests/' \ +# $(_sc_search_regexp) + +# Enforce recommended preprocessor indentation style. +# Taken from Coreutils. +sc_preprocessor_indentation: + @if cppi --version >/dev/null 2>&1; then \ + $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \ + || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \ + exit 1; }; \ + else \ + echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ + fi + +########################################################### +# Taken from Coreutils. +_p0 = \([^"'/]\|"\([^\"]\|[\].\)*"\|'\([^\']\|[\].\)*' +_pre = $(_p0)\|[/][^"'/*]\|[/]"\([^\"]\|[\].\)*"\|[/]'\([^\']\|[\].\)*'\)* +_pre_anchored = ^\($(_pre)\) +_comment_and_close = [^*]\|[*][^/*]\)*[*][*]*/ +# help font-lock mode: ' + +# A sed expression that removes ANSI C and ISO C99 comments. +# Derived from the one in GNU gettext's 'moopp' preprocessor. +_sed_remove_comments = \ +/[/][/*]/{ \ + ta; \ + :a; \ + s,$(_pre_anchored)//.*,\1,; \ + te; \ + s,$(_pre_anchored)/[*]\($(_comment_and_close),\1 ,; \ + ta; \ + /^$(_pre)[/][*]/{ \ + s,$(_pre_anchored)/[*].*,\1 ,; \ + tu; \ + :u; \ + n; \ + s,^\($(_comment_and_close),,; \ + tv; \ + s,^.*$$,,; \ + bu; \ + :v; \ + }; \ + :e; \ +} +# Quote all single quotes. +_sed_rm_comments_q = $(subst ','\'',$(_sed_remove_comments)) +# help font-lock mode: ' + +_space_before_paren_exempt =? \\n\\$$ +_space_before_paren_exempt = \ + (^ *\#|(LA)?LR\([01]\)|percent_(code|define)|b4_syncline|m4_(define|init)|symbol) +# Ensure that there is a space before each open parenthesis in C code. +sc_space_before_open_paren: + @if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \ + fail=0; \ + for c in $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$'); do \ + sed '$(_sed_rm_comments_q)' $$c 2>/dev/null \ + | grep -i '[[:alnum:]](' \ + | grep -vE '$(_space_before_paren_exempt)' \ + | grep . && { fail=1; echo "*** $$c"; }; \ + done; \ + test $$fail = 1 && \ + { echo '$(ME): the above files lack a space-before-open-paren' \ + 1>&2; exit 1; } || :; \ + else :; \ + fi + +## -------------------------- ## +## syntax-checks exceptions. ## +## -------------------------- ## + exclude = \ $(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a)))) -$(call exclude, \ - bindtextdomain=^lib/main.c$$ \ - program_name=^lib/main.c$$ \ - prohibit_always-defined_macros=^data/yacc.c$$|^djgpp/ \ - prohibit_always-defined_macros+=?|^lib/timevar.c$$ \ - prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \ - prohibit_always-defined_macros+=?|^tests/regression.at$$ \ - prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \ +$(call exclude, \ + bindtextdomain=^lib/main.c$$ \ + preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \ + program_name=^lib/main.c$$ \ + prohibit_always-defined_macros=^data/yacc.c$$|^djgpp/ \ + prohibit_always-defined_macros+=?|^lib/timevar.c$$ \ + prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \ + prohibit_always-defined_macros+=?|^tests/regression.at$$ \ + prohibit_always_true_header_tests=^djgpp/subpipe.h$$|^lib/timevar.c$$ \ + prohibit_always_true_header_tests+=?|^m4/timevar.m4$$ \ + prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \ prohibit_doubled_word=^tests/named-refs.at$$ \ - prohibit_magic_number_exit=^doc/bison.texi$$ \ - prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \ - require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \ - space_tab=^tests/(input|c\+\+)\.at$$ \ - trailing_blank=^src/parse-gram.[ch]$$ \ - unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \ + prohibit_magic_number_exit=^doc/bison.texi$$ \ + prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \ + prohibit_strcmp=^doc/bison\.texi|tests/local\.at$$ \ + prohibit_tab_based_indentation=\.(am|mk)$$|^djgpp/|^\.git \ + require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \ + space_before_open_paren=^(data/|djgpp/) \ + two_space_separator_in_usage=^(bootstrap) \ + unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \ ) diff --git a/configure b/configure index 0da9204..7b460a3 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU Bison 2.7.12-4996. +# Generated by GNU Autoconf 2.69 for GNU Bison 3.0.5. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GNU Bison' PACKAGE_TARNAME='bison' -PACKAGE_VERSION='2.7.12-4996' -PACKAGE_STRING='GNU Bison 2.7.12-4996' +PACKAGE_VERSION='3.0.5' +PACKAGE_STRING='GNU Bison 3.0.5' PACKAGE_BUGREPORT='bug-bison@gnu.org' PACKAGE_URL='http://www.gnu.org/software/bison/' @@ -625,8 +625,8 @@ gl_use_threads_default= ac_header_list= ac_func_list= gl_getopt_required=POSIX -gl_getopt_required=POSIX gt_needs= +ac_config_libobj_dir=lib ac_subst_vars='gltests_LTLIBOBJS gltests_LIBOBJS gl_LTLIBOBJS @@ -636,29 +636,31 @@ am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -HAVE_JIKES -HAVE_JAVAC -HAVE_GCJ_C -HAVE_JAVAC_ENVVAR -CONF_JAVAC -HAVE_JIKES_IN_PATH -HAVE_JAVAC_IN_PATH -HAVE_GCJ_IN_PATH HAVE_JVIEW HAVE_JRE HAVE_JAVA HAVE_GIJ HAVE_JAVA_ENVVAR -CLASSPATH_SEPARATOR -CLASSPATH CONF_JAVA HAVE_JVIEW_IN_PATH HAVE_JRE_IN_PATH HAVE_JAVA_IN_PATH HAVE_GIJ_IN_PATH +HAVE_JIKES +HAVE_JAVAC +HAVE_GCJ_C +HAVE_JAVAC_ENVVAR +CLASSPATH_SEPARATOR +CLASSPATH +CONF_JAVAC +HAVE_JIKES_IN_PATH +HAVE_JAVAC_IN_PATH +HAVE_GCJ_IN_PATH GCC AUTOM4TE -VALGRIND_PREBISON +CROSS_COMPILING_FALSE +CROSS_COMPILING_TRUE +VALGRIND_OPTS_SUPPRESSION VALGRIND aclocaldir BISON_LOCALEDIR @@ -680,6 +682,23 @@ USE_NLS LIBBISON_LTLIBDEPS LIBBISON_LIBDEPS gltests_WITNESS +REPLACE_TOWLOWER +REPLACE_ISWCNTRL +HAVE_WCTYPE_H +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H +NEXT_WCTYPE_H +HAVE_ISWCNTRL +REPLACE_ISWBLANK +HAVE_WCTRANS_T +HAVE_WCTYPE_T +HAVE_ISWBLANK +GNULIB_TOWCTRANS +GNULIB_WCTRANS +GNULIB_ISWCTYPE +GNULIB_WCTYPE +GNULIB_ISWBLANK +HAVE_CRTDEFS_H +HAVE_WINT_T NEXT_AS_FIRST_DIRECTIVE_WCHAR_H NEXT_WCHAR_H LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE @@ -689,27 +708,42 @@ LIBUNISTRING_UNITYPES_H HAVE_UNISTD_H NEXT_AS_FIRST_DIRECTIVE_UNISTD_H NEXT_UNISTD_H +UNISTD_H_DEFINES_STRUCT_TIMESPEC PTHREAD_H_DEFINES_STRUCT_TIMESPEC SYS_TIME_H_DEFINES_STRUCT_TIMESPEC TIME_H_DEFINES_STRUCT_TIMESPEC NEXT_AS_FIRST_DIRECTIVE_TIME_H NEXT_TIME_H +REPLACE_LOCALTIME +REPLACE_GMTIME +GNULIB_GETTIMEOFDAY +REPLACE_TZSET REPLACE_TIMEGM +REPLACE_STRFTIME REPLACE_NANOSLEEP REPLACE_MKTIME REPLACE_LOCALTIME_R +REPLACE_CTIME +HAVE_TIMEZONE_T +HAVE_TZSET HAVE_TIMEGM HAVE_STRPTIME HAVE_NANOSLEEP HAVE_DECL_LOCALTIME_R +GNULIB_TZSET +GNULIB_TIME_RZ GNULIB_TIME_R GNULIB_TIMEGM GNULIB_STRPTIME +GNULIB_STRFTIME GNULIB_NANOSLEEP +GNULIB_LOCALTIME GNULIB_MKTIME +GNULIB_CTIME NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H NEXT_SYS_WAIT_H GNULIB_WAITPID +WINDOWS_STAT_INODES WINDOWS_64_BIT_OFF_T NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H NEXT_SYS_TYPES_H @@ -725,6 +759,7 @@ GL_GENERATE_STDDEF_H_FALSE GL_GENERATE_STDDEF_H_TRUE STDDEF_H HAVE_WCHAR_T +HAVE_MAX_ALIGN_T REPLACE_NULL HAVE__BOOL GL_GENERATE_STDBOOL_H_FALSE @@ -759,6 +794,7 @@ GNULIB_SIGNAL_H_SIGPIPE GNULIB_RAISE GNULIB_PTHREAD_SIGMASK ASM_SYMBOL_PREFIX +LIB_POSIX_SPAWN REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE @@ -788,17 +824,17 @@ GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT GNULIB_POSIX_SPAWNP GNULIB_POSIX_SPAWN UNDEFINE_STRTOK_R -REPLACE_STRTOK_R REPLACE_STRSIGNAL -REPLACE_STRNLEN -REPLACE_STRNDUP -REPLACE_STRNCAT REPLACE_STRERROR_R REPLACE_STRERROR -REPLACE_STRCHRNUL +REPLACE_STRTOK_R REPLACE_STRCASESTR REPLACE_STRSTR +REPLACE_STRNLEN +REPLACE_STRNDUP +REPLACE_STRNCAT REPLACE_STRDUP +REPLACE_STRCHRNUL REPLACE_STPNCPY REPLACE_MEMMEM REPLACE_MEMCHR @@ -822,6 +858,7 @@ HAVE_DECL_MEMMEM HAVE_MEMCHR HAVE_FFSLL HAVE_FFSL +HAVE_EXPLICIT_BZERO HAVE_MBSLEN GNULIB_STRVERSCMP GNULIB_STRSIGNAL @@ -860,9 +897,11 @@ GNULIB_MEMMEM GNULIB_MEMCHR GNULIB_FFSLL GNULIB_FFSL +GNULIB_EXPLICIT_BZERO LOCALE_FR_UTF8 LOCALE_ZH_CN LOCALE_JA +REPLACE_WCSFTIME REPLACE_WCSWIDTH REPLACE_WCWIDTH REPLACE_WCSNRTOMBS @@ -878,6 +917,7 @@ REPLACE_BTOWC REPLACE_MBSTATE_T HAVE_DECL_WCWIDTH HAVE_DECL_WCTOB +HAVE_WCSFTIME HAVE_WCSWIDTH HAVE_WCSTOK HAVE_WCSSTR @@ -915,6 +955,7 @@ HAVE_MBRLEN HAVE_MBRTOWC HAVE_MBSINIT HAVE_BTOWC +GNULIB_WCSFTIME GNULIB_WCSWIDTH GNULIB_WCSTOK GNULIB_WCSSTR @@ -956,6 +997,7 @@ GNULIB_WCTOB GNULIB_BTOWC NEXT_AS_FIRST_DIRECTIVE_MATH_H NEXT_MATH_H +SED LTLIBMULTITHREAD LIBMULTITHREAD LTLIBTHREAD @@ -967,22 +1009,6 @@ LOCALCHARSET_TESTS_ENVIRONMENT GLIBC21 LDEXPL_LIBM LDEXP_LIBM -REPLACE_TOWLOWER -REPLACE_ISWCNTRL -HAVE_WCTYPE_H -NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H -NEXT_WCTYPE_H -HAVE_WINT_T -HAVE_ISWCNTRL -REPLACE_ISWBLANK -HAVE_WCTRANS_T -HAVE_WCTYPE_T -HAVE_ISWBLANK -GNULIB_TOWCTRANS -GNULIB_WCTRANS -GNULIB_ISWCTYPE -GNULIB_WCTYPE -GNULIB_ISWBLANK ISNAN_LIBM ISNANL_LIBM ISNAND_LIBM @@ -995,6 +1021,7 @@ PRIPTR_PREFIX PRI_MACROS_BROKEN INT64_MAX_EQ_LONG_MAX INT32_MAX_LT_INTMAX_MAX +REPLACE_STRTOUMAX REPLACE_STRTOIMAX HAVE_DECL_STRTOUMAX HAVE_DECL_STRTOIMAX @@ -1007,6 +1034,9 @@ GNULIB_IMAXABS GL_GENERATE_STDINT_H_FALSE GL_GENERATE_STDINT_H_TRUE STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_STDINT_H WINT_T_SUFFIX WCHAR_T_SUFFIX SIG_ATOMIC_T_SUFFIX @@ -1020,8 +1050,6 @@ BITSIZEOF_WCHAR_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_PTRDIFF_T -HAVE_SYS_BITYPES_H -HAVE_SYS_INTTYPES_H HAVE_STDINT_H NEXT_AS_FIRST_DIRECTIVE_STDINT_H NEXT_STDINT_H @@ -1030,14 +1058,24 @@ HAVE_INTTYPES_H HAVE_WCHAR_H HAVE_UNSIGNED_LONG_LONG_INT HAVE_LONG_LONG_INT +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H +HOST_CPU_C_ABI +HOST_CPU LTLIBINTL LIBINTL GNULIB_GL_UNISTD_H_GETOPT +GETOPT_CDEFS_H GETOPT_H +HAVE_SYS_CDEFS_H HAVE_GETOPT_H NEXT_AS_FIRST_DIRECTIVE_GETOPT_H NEXT_GETOPT_H WINDOWS_64_BIT_ST_SIZE +WINDOWS_STAT_TIMESPEC NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H NEXT_SYS_STAT_H REPLACE_UTIMENSAT @@ -1060,6 +1098,7 @@ HAVE_LCHMOD HAVE_FUTIMENS HAVE_FSTATAT HAVE_FCHMODAT +GNULIB_OVERRIDES_STRUCT_STAT GNULIB_UTIMENSAT GNULIB_STAT GNULIB_MKNODAT @@ -1076,7 +1115,12 @@ GNULIB_FCHMODAT REPLACE_TRUNCL REPLACE_TRUNCF REPLACE_TRUNC +REPLACE_TANHF +REPLACE_TANF REPLACE_SQRTL +REPLACE_SQRTF +REPLACE_SINHF +REPLACE_SINF REPLACE_SIGNBIT_USING_GCC REPLACE_SIGNBIT REPLACE_ROUNDL @@ -1108,6 +1152,7 @@ REPLACE_LDEXPL REPLACE_ISNAN REPLACE_ISINF REPLACE_ISFINITE +REPLACE_ILOGBL REPLACE_ILOGBF REPLACE_ILOGB REPLACE_HYPOTL @@ -1131,11 +1176,18 @@ REPLACE_EXP2L REPLACE_EXP2 REPLACE_EXPM1F REPLACE_EXPM1 +REPLACE_EXPF +REPLACE_COSHF +REPLACE_COSF REPLACE_CEILL REPLACE_CEILF REPLACE_CEIL REPLACE_CBRTL REPLACE_CBRTF +REPLACE_ATAN2F +REPLACE_ATANF +REPLACE_ASINF +REPLACE_ACOSF HAVE_DECL_TRUNCL HAVE_DECL_TRUNCF HAVE_DECL_TRUNC @@ -1328,6 +1380,7 @@ GNULIB_ASINF GNULIB_ACOSL GNULIB_ACOSF HAVE_FEATURES_H +GNULIB_OVERRIDES_WINT_T APPLE_UNIVERSAL_BUILD HAVE_SAME_LONG_DOUBLE_AS_DOUBLE REPLACE_VSPRINTF @@ -1464,6 +1517,7 @@ PRAGMA_SYSTEM_HEADER INCLUDE_NEXT_AS_FIRST_DIRECTIVE INCLUDE_NEXT pkglibexecdir +runstatedir lispdir HAVE_WINSOCK2_H HAVE_MSVC_INVALID_PARAMETER_HANDLER @@ -1474,9 +1528,12 @@ REPLACE_USLEEP REPLACE_UNLINKAT REPLACE_UNLINK REPLACE_TTYNAME_R +REPLACE_TRUNCATE +REPLACE_SYMLINKAT REPLACE_SYMLINK REPLACE_SLEEP REPLACE_RMDIR +REPLACE_READLINKAT REPLACE_READLINK REPLACE_READ REPLACE_PWRITE @@ -1489,10 +1546,12 @@ REPLACE_ISATTY REPLACE_GETPAGESIZE REPLACE_GETGROUPS REPLACE_GETLOGIN_R +REPLACE_GETDTABLESIZE REPLACE_GETDOMAINNAME REPLACE_GETCWD REPLACE_FTRUNCATE REPLACE_FCHOWNAT +REPLACE_FACCESSAT REPLACE_DUP2 REPLACE_DUP REPLACE_CLOSE @@ -1504,12 +1563,14 @@ HAVE_DECL_SETHOSTNAME HAVE_DECL_GETUSERSHELL HAVE_DECL_GETPAGESIZE HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETLOGIN HAVE_DECL_GETDOMAINNAME HAVE_DECL_FDATASYNC HAVE_DECL_FCHDIR HAVE_DECL_ENVIRON HAVE_USLEEP HAVE_UNLINKAT +HAVE_TRUNCATE HAVE_SYMLINKAT HAVE_SYMLINK HAVE_SLEEP @@ -1546,6 +1607,7 @@ GNULIB_UNLINK GNULIB_UNISTD_H_SIGPIPE GNULIB_UNISTD_H_NONBLOCKING GNULIB_TTYNAME_R +GNULIB_TRUNCATE GNULIB_SYMLINKAT GNULIB_SYMLINK GNULIB_SLEEP @@ -1594,6 +1656,7 @@ REPLACE_SETENV REPLACE_REALPATH REPLACE_REALLOC REPLACE_RANDOM_R +REPLACE_QSORT_R REPLACE_PUTENV REPLACE_PTSNAME_R REPLACE_PTSNAME @@ -1609,14 +1672,17 @@ HAVE_STRUCT_RANDOM_DATA HAVE_STRTOULL HAVE_STRTOLL HAVE_STRTOD +HAVE_DECL_SETSTATE HAVE_DECL_SETENV HAVE_SETENV HAVE_SECURE_GETENV HAVE_RPMATCH HAVE_REALPATH +HAVE_REALLOCARRAY HAVE_RANDOM_R HAVE_RANDOM_H HAVE_RANDOM +HAVE_QSORT_R HAVE_PTSNAME_R HAVE_PTSNAME HAVE_POSIX_OPENPT @@ -1625,6 +1691,7 @@ HAVE_MKSTEMP HAVE_MKOSTEMPS HAVE_MKOSTEMP HAVE_MKDTEMP +HAVE_DECL_INITSTATE HAVE_GRANTPT HAVE_GETSUBOPT HAVE_DECL_GETLOADAVG @@ -1643,8 +1710,10 @@ GNULIB_SECURE_GETENV GNULIB_RPMATCH GNULIB_REALPATH GNULIB_REALLOC_POSIX +GNULIB_REALLOCARRAY GNULIB_RANDOM_R GNULIB_RANDOM +GNULIB_QSORT_R GNULIB_PUTENV GNULIB_PTSNAME_R GNULIB_PTSNAME @@ -1677,27 +1746,30 @@ M4_GNU M4 YFLAGS YACC +FLEX_CXX_WORKS_FALSE +FLEX_CXX_WORKS_TRUE LEXLIB LEX_OUTPUT_ROOT LEX_IS_FLEX LEX DOT -YACC_LIBRARY -YACC_SCRIPT +ENABLE_YACC_FALSE +ENABLE_YACC_TRUE CXX_COMPILER_POSIXLY_CORRECT BISON_CXX_WORKS_FALSE BISON_CXX_WORKS_TRUE BISON_CXX_WORKS C_COMPILER_POSIXLY_CORRECT BISON_C_WORKS -NO_STRICT_ALIAS_CXXFLAGS -WARN_NO_NULL_CONVERSION_CXXFLAGS +FLEX_SCANNER_CXXFLAGS WARN_CXXFLAGS_TEST WERROR_CXXFLAGS WARN_CXXFLAGS WARN_CFLAGS_TEST WERROR_CFLAGS WARN_CFLAGS +ENABLE_GCC_WARNINGS_FALSE +ENABLE_GCC_WARNINGS_TRUE host_os host_vendor host_cpu @@ -1725,7 +1797,6 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -1800,7 +1871,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -2374,7 +2446,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Bison 2.7.12-4996 to adapt to many kinds of systems. +\`configure' configures GNU Bison 3.0.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2444,7 +2516,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Bison 2.7.12-4996:";; + short | recursive ) echo "Configuration of GNU Bison 3.0.5:";; esac cat <<\_ACEOF @@ -2462,7 +2534,9 @@ Optional Features: --enable-threads={posix|solaris|pth|windows} specify multithreading API --disable-threads build without multithread safety - --enable-gcc-warnings turn on lots of GCC warnings (not recommended) + --enable-gcc-warnings turn on lots of GCC warnings (not recommended). + Also, issue synclines from the examples/ to + the corresponding source in the Texinfo doc. --disable-yacc do not build a yacc command or an -ly library --disable-assert turn off assertions --disable-rpath do not hardcode runtime library paths @@ -2569,7 +2643,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU Bison configure 2.7.12-4996 +GNU Bison configure 3.0.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3362,7 +3436,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Bison $as_me 2.7.12-4996, which was +It was created by GNU Bison $as_me 3.0.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3649,22 +3723,22 @@ as_fn_append ac_header_list " unistd.h" as_fn_append ac_func_list " fcntl" as_fn_append ac_func_list " symlink" as_fn_append ac_header_list " stdio_ext.h" -as_fn_append ac_func_list " __fpending" as_fn_append ac_func_list " vasnprintf" as_fn_append ac_header_list " features.h" as_fn_append ac_func_list " snprintf" as_fn_append ac_func_list " __fseterr" as_fn_append ac_header_list " sys/stat.h" -as_fn_append ac_func_list " getdelim" as_fn_append ac_func_list " getdtablesize" gl_getopt_required=GNU as_fn_append ac_header_list " getopt.h" +as_fn_append ac_header_list " sys/cdefs.h" +as_fn_append ac_func_list " getprogname" +as_fn_append ac_func_list " getexecname" +as_fn_append ac_header_list " limits.h" as_fn_append ac_header_list " wchar.h" as_fn_append ac_header_list " stdint.h" as_fn_append ac_header_list " inttypes.h" -as_fn_append ac_func_list " iswcntrl" -as_fn_append ac_header_list " wctype.h" -as_fn_append ac_func_list " iswblank" +as_fn_append ac_func_list " lstat" as_fn_append ac_header_list " math.h" as_fn_append ac_func_list " mbsinit" as_fn_append ac_func_list " mbrtowc" @@ -3672,24 +3746,24 @@ as_fn_append ac_func_list " isascii" as_fn_append ac_header_list " sys/mman.h" as_fn_append ac_func_list " mprotect" as_fn_append ac_func_list " obstack_printf" -as_fn_append ac_func_list " lstat" as_fn_append ac_header_list " sys/param.h" as_fn_append ac_func_list " strerror_r" as_fn_append ac_func_list " __xpg_strerror_r" as_fn_append ac_func_list " pipe2" -as_fn_append ac_func_list " posix_spawn" gl_printf_safe=yes -as_fn_append ac_header_list " sched.h" as_fn_append ac_func_list " sigaction" as_fn_append ac_func_list " sigaltstack" as_fn_append ac_func_list " siginterrupt" as_fn_append ac_header_list " spawn.h" +as_fn_append ac_header_list " sys/time.h" as_fn_append ac_func_list " strdup" as_fn_append ac_func_list " catgets" as_fn_append ac_func_list " strndup" as_fn_append ac_header_list " sys/wait.h" -as_fn_append ac_header_list " sys/time.h" as_fn_append ac_func_list " pipe" +as_fn_append ac_header_list " crtdefs.h" +as_fn_append ac_func_list " iswcntrl" +as_fn_append ac_header_list " wctype.h" as_fn_append ac_func_list " wcwidth" as_fn_append ac_func_list " setlocale" gt_needs="$gt_needs need-ngettext" @@ -3761,7 +3835,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -PACKAGE_COPYRIGHT_YEAR=2013 +PACKAGE_COPYRIGHT_YEAR=2018 cat >>confdefs.h <<_ACEOF @@ -3800,11 +3874,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here: -# -# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131 -# -# To avoid 1.11, we make 1.11.1 the minimum version. +# We use Automake 1.14's %D% and %C%. # # We want gnits strictness only when rolling a stable release. For # release candidates, we use version strings like 2.4.3_rc1, but gnits @@ -3812,7 +3882,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # releases, we want to be able run make dist without being required to # add a bogus NEWS entry. In that case, the version string # automatically contains a dash, which we also let disable gnits. -am__api_version='1.13' +am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3984,8 +4054,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -4004,7 +4074,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -4298,7 +4368,7 @@ fi # Define the identity of the package. PACKAGE='bison' - VERSION='2.7.12-4996' + VERSION='3.0.5' cat >>confdefs.h <<_ACEOF @@ -4328,22 +4398,69 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; @@ -4391,45 +4508,45 @@ DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -5239,6 +5356,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -6315,6 +6491,276 @@ $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + +$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h + + $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if ${ac_cv_should_define__xopen_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_should_define__xopen_source=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +$as_echo "$ac_cv_should_define__xopen_source" >&6; } + test $ac_cv_should_define__xopen_source = yes && + $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 @@ -6343,14 +6789,19 @@ rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 $as_echo "$gl_cv_c_amsterdam_compiler" >&6; } - if test -z "$AR"; then - if test $gl_cv_c_amsterdam_compiler = yes; then + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then AR='cc -c.a' - if test -z "$ARFLAGS"; then - ARFLAGS='-o' - fi - else - if test -n "$ac_tool_prefix"; then + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + : + fi + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -6442,17 +6893,12 @@ else AR="$ac_cv_prog_AR" fi - if test -z "$ARFLAGS"; then - ARFLAGS='cru' - fi - fi - else - if test -z "$ARFLAGS"; then - ARFLAGS='cru' - fi + if test -z "$ARFLAGS"; then + ARFLAGS='cr' fi + if test -z "$RANLIB"; then if test $gl_cv_c_amsterdam_compiler = yes; then RANLIB=':' @@ -6553,380 +6999,6 @@ fi fi -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - - -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - - -$as_echo "#define _MINIX 1" >>confdefs.h - - -$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes -else - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 -$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } -if ${ac_cv_should_define__xopen_source+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_should_define__xopen_source=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - mbstate_t x; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #define _XOPEN_SOURCE 500 - #include - mbstate_t x; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_should_define__xopen_source=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 -$as_echo "$ac_cv_should_define__xopen_source" >&6; } - test $ac_cv_should_define__xopen_source = yes && - $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h - - - - - - - # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || @@ -7009,7 +7081,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac alpha*) # On Alpha systems, a compiler option provides the behaviour. # See the ieee(3) manual page, also available at - # + # if test -n "$GCC"; then # GCC has the option -mieee. # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. @@ -7280,7 +7352,13 @@ fi + # Pre-early section. + + + + # Code from module absolute-header: + # Code from module alignof: # Code from module alloca-opt: # Code from module announce-gen: # Code from module argmatch: @@ -7295,6 +7373,7 @@ fi # Code from module close: # Code from module close-stream: # Code from module closeout: + # Code from module concat-filename: # Code from module config-h: # Code from module configmake: # Code from module dirname: @@ -7308,7 +7387,6 @@ fi # Code from module error: # Code from module exitfail: # Code from module extensions: - # Code from module extern-inline: # Code from module fatal-signal: # Code from module fcntl: @@ -7316,6 +7394,7 @@ fi # Code from module fd-hook: # Code from module fd-safer-flag: # Code from module fdl: + # Code from module filename: # Code from module float: # Code from module fopen: # Code from module fopen-safer: @@ -7329,11 +7408,10 @@ fi # Code from module fseterr: # Code from module fstat: # Code from module gendocs: - # Code from module getdelim: # Code from module getdtablesize: - # Code from module getline: # Code from module getopt-gnu: # Code from module getopt-posix: + # Code from module getprogname: # Code from module gettext: # Code from module gettext-h: # Code from module git-version-gen: @@ -7342,8 +7420,10 @@ fi # Code from module gnumakefile: # Code from module gnupload: # Code from module gpl-3.0: + # Code from module hard-locale: # Code from module hash: # Code from module havelib: + # Code from module host-cpu-c-abi: # Code from module include_next: # Code from module intprops: # Code from module inttypes: @@ -7355,31 +7435,31 @@ fi # Code from module isnanf-nolibm: # Code from module isnanl: # Code from module isnanl-nolibm: - # Code from module iswblank: # Code from module javacomp-script: # Code from module javaexec-script: # Code from module largefile: # Code from module ldexp: # Code from module ldexpl: + # Code from module limits-h: # Code from module localcharset: # Code from module lock: + # Code from module lstat: # Code from module maintainer-makefile: # Code from module malloc-gnu: # Code from module malloc-posix: + # Code from module malloca: # Code from module math: - # Code from module mbchar: # Code from module mbrtowc: - # Code from module mbschr: # Code from module mbsinit: - # Code from module mbsrchr: # Code from module mbswidth: - # Code from module mbuiter: # Code from module memchr: + # Code from module minmax: # Code from module msvc-inval: # Code from module msvc-nothrow: # Code from module multiarch: # Code from module nocrash: + # Code from module non-recursive-gnulib-prefix-hack: # Code from module obstack: # Code from module obstack-printf: # Code from module open: @@ -7427,6 +7507,7 @@ fi # Code from module sprintf-posix: # Code from module ssize_t: # Code from module stat: + # Code from module stat-time: # Code from module stdbool: # Code from module stddef: # Code from module stdint: @@ -7442,8 +7523,6 @@ fi # Code from module string: # Code from module strndup: # Code from module strnlen: - # Code from module strnlen1: - # Code from module strtoul: # Code from module strverscmp: # Code from module sys_stat: # Code from module sys_types: @@ -7458,6 +7537,7 @@ fi # Code from module unitypes: # Code from module uniwidth/base: # Code from module uniwidth/width: + # Code from module unlink: # Code from module unlocked-io: # Code from module unsetenv: # Code from module update-copyright: @@ -7478,6 +7558,7 @@ fi # Code from module xalloc: # Code from module xalloc-die: # Code from module xalloc-oversized: + # Code from module xconcat-filename: # Code from module xmemdup0: # Code from module xsize: # Code from module xstrndup: @@ -7528,9 +7609,17 @@ else enable_gcc_warnings=no fi + if test "$enable_gcc_warnings" = yes; then + ENABLE_GCC_WARNINGS_TRUE= + ENABLE_GCC_WARNINGS_FALSE='#' +else + ENABLE_GCC_WARNINGS_TRUE='#' + ENABLE_GCC_WARNINGS_FALSE= +fi + if test "$enable_gcc_warnings" = yes; then - warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align - -Wformat -Wpointer-arith -Wwrite-strings' + warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align -Wdocumentation + -Wformat -Wnull-dereference -Wpointer-arith -Wwrite-strings' warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes' warn_cxx='-Wnoexcept' # Warnings for the test suite only. @@ -7538,7 +7627,12 @@ if test "$enable_gcc_warnings" = yes; then # -fno-color-diagnostics: Clang's use of colors in the error # messages is confusing the tests looking at the compiler's output # (e.g., synclines.at). - warn_tests='-Wundef -pedantic -fno-color-diagnostics' + # + # -Wno-keyword-macro: We use the "#define private public" dirty + # trick in the test suite to check some private implementation + # details for lalr1.cc. + warn_tests='-Wundef -pedantic -Wdeprecated -Wsign-compare -fno-color-diagnostics + -Wno-keyword-macro' ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -7557,14 +7651,68 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # meanwhile, turn warnings about unknown options into errors in # CFLAGS, and restore CFLAGS after the tests. save_CFLAGS=$CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror=unknown-warning-option" >&5 + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_c__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_c__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_c__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror=unknown-warning-option" >&5 $as_echo_n "checking whether C compiler handles -Werror=unknown-warning-option... " >&6; } if ${gl_cv_warn_c__Werror_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " -Werror=unknown-warning-option" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror=unknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7576,12 +7724,13 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : gl_cv_warn_c__Werror_unknown_warning_option=yes else gl_cv_warn_c__Werror_unknown_warning_option=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi @@ -7594,7 +7743,13 @@ fi for i in $warn_common $warn_c; do - as_gl_Warn=`$as_echo "gl_cv_warn_c_$i" | $as_tr_sh` + + +as_gl_Warn=`$as_echo "gl_cv_warn_c_$i" | $as_tr_sh` +gl_positive="$i" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $i" >&5 $as_echo_n "checking whether C compiler handles $i... " >&6; } if eval \${$as_gl_Warn+:} false; then : @@ -7602,7 +7757,7 @@ if eval \${$as_gl_Warn+:} false; then : else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $i" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7614,12 +7769,13 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : eval "$as_gl_Warn=yes" else eval "$as_gl_Warn=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi @@ -7632,14 +7788,16 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5 $as_echo_n "checking whether C compiler handles -Werror... " >&6; } if ${gl_cv_warn_c__Werror+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " -Werror" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7651,12 +7809,13 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : gl_cv_warn_c__Werror=yes else gl_cv_warn_c__Werror=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi @@ -7670,14 +7829,16 @@ fi # Warnings for the test suite, and maybe for bison if GCC is modern # enough. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wmissing-declarations" >&5 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wmissing-declarations" >&5 $as_echo_n "checking whether C compiler handles -Wmissing-declarations... " >&6; } if ${gl_cv_warn_c__Wmissing_declarations+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " -Wmissing-declarations" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-declarations" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7689,12 +7850,13 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : gl_cv_warn_c__Wmissing_declarations=yes else gl_cv_warn_c__Wmissing_declarations=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi @@ -7705,14 +7867,16 @@ if test "x$gl_cv_warn_c__Wmissing_declarations" = xyes; then : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wmissing-prototypes" >&5 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wmissing-prototypes" >&5 $as_echo_n "checking whether C compiler handles -Wmissing-prototypes... " >&6; } if ${gl_cv_warn_c__Wmissing_prototypes+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " -Wmissing-prototypes" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-prototypes" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7724,12 +7888,13 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : gl_cv_warn_c__Wmissing_prototypes=yes else gl_cv_warn_c__Wmissing_prototypes=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi @@ -7746,7 +7911,13 @@ fi # Warnings for the test suite only. for i in $warn_tests; do - as_gl_Warn=`$as_echo "gl_cv_warn_c_$i" | $as_tr_sh` + + +as_gl_Warn=`$as_echo "gl_cv_warn_c_$i" | $as_tr_sh` +gl_positive="$i" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $i" >&5 $as_echo_n "checking whether C compiler handles $i... " >&6; } if eval \${$as_gl_Warn+:} false; then : @@ -7754,7 +7925,7 @@ if eval \${$as_gl_Warn+:} false; then : else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $i" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7766,12 +7937,13 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : eval "$as_gl_Warn=yes" else eval "$as_gl_Warn=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi @@ -7800,6 +7972,60 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu save_CXXFLAGS=$CXXFLAGS + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether C++ compiler handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_cxx__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_cxx__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_cxx__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_cxx__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Werror=unknown-warning-option" >&5 $as_echo_n "checking whether C++ compiler handles -Werror=unknown-warning-option... " >&6; } if ${gl_cv_warn_cxx__Werror_unknown_warning_option+:} false; then : @@ -7807,7 +8033,7 @@ if ${gl_cv_warn_cxx__Werror_unknown_warning_option+:} false; then : else gl_save_compiler_FLAGS="$CXXFLAGS" - as_fn_append CXXFLAGS " -Werror=unknown-warning-option" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Werror=unknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7819,12 +8045,13 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : gl_cv_warn_cxx__Werror_unknown_warning_option=yes else gl_cv_warn_cxx__Werror_unknown_warning_option=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CXXFLAGS="$gl_save_compiler_FLAGS" fi @@ -7837,7 +8064,13 @@ fi for i in $warn_common $warn_cxx; do - as_gl_Warn=`$as_echo "gl_cv_warn_cxx_$i" | $as_tr_sh` + + +as_gl_Warn=`$as_echo "gl_cv_warn_cxx_$i" | $as_tr_sh` +gl_positive="$i" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles $i" >&5 $as_echo_n "checking whether C++ compiler handles $i... " >&6; } if eval \${$as_gl_Warn+:} false; then : @@ -7845,7 +8078,7 @@ if eval \${$as_gl_Warn+:} false; then : else gl_save_compiler_FLAGS="$CXXFLAGS" - as_fn_append CXXFLAGS " $i" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors $gl_positive" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7857,12 +8090,13 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : eval "$as_gl_Warn=yes" else eval "$as_gl_Warn=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CXXFLAGS="$gl_save_compiler_FLAGS" fi @@ -7875,14 +8109,16 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wzero-as-null-pointer-constant" >&5 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wzero-as-null-pointer-constant" >&5 $as_echo_n "checking whether C++ compiler handles -Wzero-as-null-pointer-constant... " >&6; } if ${gl_cv_warn_cxx__Wzero_as_null_pointer_constant+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CXXFLAGS" - as_fn_append CXXFLAGS " -Wzero-as-null-pointer-constant" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wzero-as-null-pointer-constant" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7894,12 +8130,13 @@ nullptr return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : gl_cv_warn_cxx__Wzero_as_null_pointer_constant=yes else gl_cv_warn_cxx__Wzero_as_null_pointer_constant=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CXXFLAGS="$gl_save_compiler_FLAGS" fi @@ -7910,14 +8147,16 @@ if test "x$gl_cv_warn_cxx__Wzero_as_null_pointer_constant" = xyes; then : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Werror" >&5 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Werror" >&5 $as_echo_n "checking whether C++ compiler handles -Werror... " >&6; } if ${gl_cv_warn_cxx__Werror+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CXXFLAGS" - as_fn_append CXXFLAGS " -Werror" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7929,12 +8168,13 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : gl_cv_warn_cxx__Werror=yes else gl_cv_warn_cxx__Werror=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CXXFLAGS="$gl_save_compiler_FLAGS" fi @@ -7948,7 +8188,13 @@ fi # Warnings for the test suite only. for i in $warn_tests; do - as_gl_Warn=`$as_echo "gl_cv_warn_cxx_$i" | $as_tr_sh` + + +as_gl_Warn=`$as_echo "gl_cv_warn_cxx_$i" | $as_tr_sh` +gl_positive="$i" +case $gl_positive in + -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles $i" >&5 $as_echo_n "checking whether C++ compiler handles $i... " >&6; } if eval \${$as_gl_Warn+:} false; then : @@ -7956,7 +8202,7 @@ if eval \${$as_gl_Warn+:} false; then : else gl_save_compiler_FLAGS="$CXXFLAGS" - as_fn_append CXXFLAGS " $i" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors $gl_positive" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7968,12 +8214,13 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : eval "$as_gl_Warn=yes" else eval "$as_gl_Warn=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CXXFLAGS="$gl_save_compiler_FLAGS" fi @@ -7987,14 +8234,16 @@ fi done # Clang++ 3.2+ reject C code generated by Flex. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wno-null-conversion" >&5 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wno-null-conversion" >&5 $as_echo_n "checking whether C++ compiler handles -Wno-null-conversion... " >&6; } if ${gl_cv_warn_cxx__Wno_null_conversion+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CXXFLAGS" - as_fn_append CXXFLAGS " -Wno-null-conversion" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wnull-conversion" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8006,31 +8255,34 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : gl_cv_warn_cxx__Wno_null_conversion=yes else gl_cv_warn_cxx__Wno_null_conversion=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CXXFLAGS="$gl_save_compiler_FLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Wno_null_conversion" >&5 $as_echo "$gl_cv_warn_cxx__Wno_null_conversion" >&6; } if test "x$gl_cv_warn_cxx__Wno_null_conversion" = xyes; then : - as_fn_append WARN_NO_NULL_CONVERSION_CXXFLAGS " -Wno-null-conversion" + as_fn_append FLEX_SCANNER_CXXFLAGS " -Wno-null-conversion" fi - # Variants break strict aliasing analysis. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -fno-strict-aliasing" >&5 -$as_echo_n "checking whether C++ compiler handles -fno-strict-aliasing... " >&6; } -if ${gl_cv_warn_cxx__fno_strict_aliasing+:} false; then : + # So does G++ 4.8... + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wno-sign-compare" >&5 +$as_echo_n "checking whether C++ compiler handles -Wno-sign-compare... " >&6; } +if ${gl_cv_warn_cxx__Wno_sign_compare+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CXXFLAGS" - as_fn_append CXXFLAGS " -fno-strict-aliasing" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wsign-compare" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8042,19 +8294,59 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - gl_cv_warn_cxx__fno_strict_aliasing=yes +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Wno_sign_compare=yes else - gl_cv_warn_cxx__fno_strict_aliasing=no + gl_cv_warn_cxx__Wno_sign_compare=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CXXFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Wno_sign_compare" >&5 +$as_echo "$gl_cv_warn_cxx__Wno_sign_compare" >&6; } +if test "x$gl_cv_warn_cxx__Wno_sign_compare" = xyes; then : + as_fn_append FLEX_SCANNER_CXXFLAGS " -Wno-sign-compare" +fi + + + # ... possiby in std=c++11 mode. + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wno-zero-as-null-pointer-constant" >&5 +$as_echo_n "checking whether C++ compiler handles -Wno-zero-as-null-pointer-constant... " >&6; } +if ${gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CXXFLAGS" + as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wzero-as-null-pointer-constant" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant=yes +else + gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CXXFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__fno_strict_aliasing" >&5 -$as_echo "$gl_cv_warn_cxx__fno_strict_aliasing" >&6; } -if test "x$gl_cv_warn_cxx__fno_strict_aliasing" = xyes; then : - as_fn_append NO_STRICT_ALIAS_CXXFLAGS " -fno-strict-aliasing" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant" >&5 +$as_echo "$gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant" >&6; } +if test "x$gl_cv_warn_cxx__Wno_zero_as_null_pointer_constant" = xyes; then : + as_fn_append FLEX_SCANNER_CXXFLAGS " -Wno-zero-as-null-pointer-constant" fi @@ -8071,7 +8363,7 @@ fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - int test_array[CHAR_BIT]; + int test_array[CHAR_BIT]; int main () { @@ -8168,22 +8460,22 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #include - #include - #include - using namespace std; + #include + #include + #include + using namespace std; int main () { std::cerr << ""; cout << ""; - typedef std::pair uipair; - std::map m; - std::map::iterator i; - m.insert (uipair (4, -4)); - for (i = m.begin (); i != m.end (); ++i) - if (i->first != 4) - return 1; + typedef std::pair uipair; + std::map m; + std::map::iterator i; + m.insert (uipair (4, -4)); + for (i = m.begin (); i != m.end (); ++i) + if (i->first != 4) + return 1; ; return 0; } @@ -8306,15 +8598,13 @@ else enable_yacc=yes fi -case $enable_yacc in -yes) - YACC_SCRIPT=yacc - YACC_LIBRARY=liby.a;; -*) - YACC_SCRIPT= - YACC_LIBRARY=;; -esac - + if test "$enable_yacc" = yes; then + ENABLE_YACC_TRUE= + ENABLE_YACC_FALSE='#' +else + ENABLE_YACC_TRUE='#' + ENABLE_YACC_FALSE= +fi # Checks for programs. @@ -8512,7 +8802,19 @@ fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi -$LEX_IS_FLEX || as_fn_error $? "Flex is required" "$LINENO" 5 +$LEX_IS_FLEX || test "X$LEX" = X: || { + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: bypassing lex because flex is required" >&5 +$as_echo "$as_me: WARNING: bypassing lex because flex is required" >&2;} + LEX=: +} + if $LEX_IS_FLEX && test $bison_cv_cxx_works = yes; then + FLEX_CXX_WORKS_TRUE= + FLEX_CXX_WORKS_FALSE='#' +else + FLEX_CXX_WORKS_TRUE='#' + FLEX_CXX_WORKS_FALSE= +fi + for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -9137,8 +9439,10 @@ fi GNULIB_PTSNAME=0; GNULIB_PTSNAME_R=0; GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; GNULIB_RANDOM=0; GNULIB_RANDOM_R=0; + GNULIB_REALLOCARRAY=0; GNULIB_REALLOC_POSIX=0; GNULIB_REALPATH=0; GNULIB_RPMATCH=0; @@ -9157,6 +9461,7 @@ fi HAVE_DECL_GETLOADAVG=1; HAVE_GETSUBOPT=1; HAVE_GRANTPT=1; + HAVE_DECL_INITSTATE=1; HAVE_MKDTEMP=1; HAVE_MKOSTEMP=1; HAVE_MKOSTEMPS=1; @@ -9165,14 +9470,17 @@ fi HAVE_POSIX_OPENPT=1; HAVE_PTSNAME=1; HAVE_PTSNAME_R=1; + HAVE_QSORT_R=1; HAVE_RANDOM=1; HAVE_RANDOM_H=1; HAVE_RANDOM_R=1; + HAVE_REALLOCARRAY=1; HAVE_REALPATH=1; HAVE_RPMATCH=1; HAVE_SECURE_GETENV=1; HAVE_SETENV=1; HAVE_DECL_SETENV=1; + HAVE_DECL_SETSTATE=1; HAVE_STRTOD=1; HAVE_STRTOLL=1; HAVE_STRTOULL=1; @@ -9188,6 +9496,7 @@ fi REPLACE_PTSNAME=0; REPLACE_PTSNAME_R=0; REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; REPLACE_RANDOM_R=0; REPLACE_REALLOC=0; REPLACE_REALPATH=0; @@ -9209,7 +9518,7 @@ else int main () { -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ choke me #endif @@ -9270,6 +9579,7 @@ $as_echo "$gl_cv_func_malloc_posix" >&6; } GNULIB_SLEEP=0; GNULIB_SYMLINK=0; GNULIB_SYMLINKAT=0; + GNULIB_TRUNCATE=0; GNULIB_TTYNAME_R=0; GNULIB_UNISTD_H_NONBLOCKING=0; GNULIB_UNISTD_H_SIGPIPE=0; @@ -9306,12 +9616,14 @@ $as_echo "$gl_cv_func_malloc_posix" >&6; } HAVE_SLEEP=1; HAVE_SYMLINK=1; HAVE_SYMLINKAT=1; + HAVE_TRUNCATE=1; HAVE_UNLINKAT=1; HAVE_USLEEP=1; HAVE_DECL_ENVIRON=1; HAVE_DECL_FCHDIR=1; HAVE_DECL_FDATASYNC=1; HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN=1; HAVE_DECL_GETLOGIN_R=1; HAVE_DECL_GETPAGESIZE=1; HAVE_DECL_GETUSERSHELL=1; @@ -9323,10 +9635,12 @@ $as_echo "$gl_cv_func_malloc_posix" >&6; } REPLACE_CLOSE=0; REPLACE_DUP=0; REPLACE_DUP2=0; + REPLACE_FACCESSAT=0; REPLACE_FCHOWNAT=0; REPLACE_FTRUNCATE=0; REPLACE_GETCWD=0; REPLACE_GETDOMAINNAME=0; + REPLACE_GETDTABLESIZE=0; REPLACE_GETLOGIN_R=0; REPLACE_GETGROUPS=0; REPLACE_GETPAGESIZE=0; @@ -9339,9 +9653,12 @@ $as_echo "$gl_cv_func_malloc_posix" >&6; } REPLACE_PWRITE=0; REPLACE_READ=0; REPLACE_READLINK=0; + REPLACE_READLINKAT=0; REPLACE_RMDIR=0; REPLACE_SLEEP=0; REPLACE_SYMLINK=0; + REPLACE_SYMLINKAT=0; + REPLACE_TRUNCATE=0; REPLACE_TTYNAME_R=0; REPLACE_UNLINK=0; REPLACE_UNLINKAT=0; @@ -9689,36 +10006,40 @@ if ${gl_cv_next_errno_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'errno.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` - gl_header_literal_regex=`echo 'errno.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_header=$gl_cv_absolute_errno_h + gl_cv_next_errno_h='"'$gl_header'"' fi @@ -10105,7 +10426,12 @@ if ${gl_cv_header_working_fcntl_h+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - gl_cv_header_working_fcntl_h=cross-compiling + case "$host_os" in + # Guess 'no' on native Windows. + mingw*) gl_cv_header_working_fcntl_h='no' ;; + *) gl_cv_header_working_fcntl_h=cross-compiling ;; + esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10216,6 +10542,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 $as_echo "$gl_cv_header_working_fcntl_h" >&6; } @@ -10368,8 +10695,6 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 $as_echo_n "checking for stdint.h... " >&6; } if ${gl_cv_header_stdint_h+:} false; then : @@ -10455,9 +10780,9 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; @@ -10473,6 +10798,24 @@ else netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_printf_sizes_c99="guessing no";; netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on MSVC, no on mingw. + mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_printf_sizes_c99="guessing yes" +else + gl_cv_func_printf_sizes_c99="guessing no" +fi +rm -f conftest* + + ;; # If we don't know, assume the worst. *) gl_cv_func_printf_sizes_c99="guessing no";; esac @@ -10500,6 +10843,8 @@ int main () if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) result |= 1; +#else + result |= 1; #endif buf[0] = '\0'; if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 @@ -10539,11 +10884,27 @@ if ${gl_cv_func_printf_long_double+:} false; then : else if test "$cross_compiling" = yes; then : + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + # Guess yes on MSVC, no on mingw. + mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - case "$host_os" in - beos*) gl_cv_func_printf_long_double="guessing no";; - mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; - *) gl_cv_func_printf_long_double="guessing yes";; +#ifdef _MSC_VER + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_printf_long_double="guessing yes" +else + gl_cv_func_printf_long_double="guessing no" +fi +rm -f conftest* + + ;; + *) gl_cv_func_printf_long_double="guessing yes";; esac else @@ -10597,9 +10958,9 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_infinite="guessing yes";; + *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";; + freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; @@ -10613,6 +10974,24 @@ else netbsd*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on MSVC, no on mingw. + mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_printf_infinite="guessing yes" +else + gl_cv_func_printf_infinite="guessing no" +fi +rm -f conftest* + + ;; # If we don't know, assume the worst. *) gl_cv_func_printf_infinite="guessing no";; esac @@ -10989,20 +11368,37 @@ if ${gl_cv_func_printf_infinite_long_double+:} false; then : else if test "$cross_compiling" = yes; then : - - case "$host_cpu" in + case "$host_cpu" in # Guess no on ia64, x86_64, i386. ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; *) case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess yes on HP-UX >= 11. hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on MSVC, no on mingw. + mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_printf_infinite_long_double="guessing yes" +else + gl_cv_func_printf_infinite_long_double="guessing no" +fi +rm -f conftest* + + ;; # If we don't know, assume the worst. *) gl_cv_func_printf_infinite_long_double="guessing no";; esac @@ -11077,7 +11473,7 @@ nocrash_init (void) } } } -#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#elif defined _WIN32 && ! defined __CYGWIN__ /* Avoid a crash on native Windows. */ #define WIN32_LEAN_AND_MEAN #include @@ -11108,11 +11504,12 @@ nocrash_init (void) #else /* Avoid a crash on POSIX systems. */ #include +#include /* A POSIX signal handler. */ static void exception_handler (int sig) { - exit (1); + _exit (1); } static void nocrash_init (void) @@ -11186,7 +11583,7 @@ int main () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else @@ -11223,66 +11620,51 @@ int main () { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lf", x.value) <= 0) result |= 4; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Le", x.value) <= 0) result |= 4; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lg", x.value) <= 0) result |= 4; } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lf", x.value) <= 0) result |= 8; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Le", x.value) <= 0) result |= 8; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lg", x.value) <= 0) result |= 8; } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lf", x.value) <= 0) result |= 16; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Le", x.value) <= 0) result |= 16; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lg", x.value) <= 0) result |= 16; } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lf", x.value) <= 0) result |= 32; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Le", x.value) <= 0) result |= 32; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lg", x.value) <= 0) result |= 32; } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; - if (sprintf (buf, "%Lf", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lf", x.value) <= 0) result |= 64; - if (sprintf (buf, "%Le", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Le", x.value) <= 0) result |= 64; - if (sprintf (buf, "%Lg", x.value) < 0 - || !strisnan (buf, 0, strlen (buf))) + if (sprintf (buf, "%Lg", x.value) <= 0) result |= 64; } #endif @@ -11320,7 +11702,7 @@ else case "$host_os" in # Guess yes on glibc >= 2.5 systems. - *-gnu*) + *-gnu* | gnu*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11341,6 +11723,8 @@ fi rm -f conftest* ;; + # Guess no on native Windows. + mingw*) gl_cv_func_printf_directive_a="guessing no";; # If we don't know, assume the worst. *) gl_cv_func_printf_directive_a="guessing no";; esac @@ -11375,8 +11759,15 @@ int main () && strcmp (buf, "0x6.0ap-2 33") != 0 && strcmp (buf, "0xc.14p-3 33") != 0)) result |= 4; + /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */ + if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x2p+0 33") != 0 + && strcmp (buf, "0x3p-1 33") != 0 + && strcmp (buf, "0x6p-2 33") != 0 + && strcmp (buf, "0xcp-3 33") != 0)) + result |= 4; /* This catches a FreeBSD 6.1 bug. See - */ + */ if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 || buf[0] == '0') result |= 8; @@ -11388,7 +11779,7 @@ int main () && strcmp (buf, "0x8.0p-2") != 0)) result |= 16; /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a - glibc 2.4 bug . */ + glibc 2.4 bug . */ if (sprintf (buf, "%.1La", 1.999L) < 0 || (strcmp (buf, "0x1.0p+1") != 0 && strcmp (buf, "0x2.0p+0") != 0 @@ -11424,16 +11815,34 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; + *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";; + freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; darwin*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on Solaris >= 2.10. - solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; - solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";; + solaris*) gl_cv_func_printf_directive_f="guessing no";; + # Guess yes on MSVC, no on mingw. + mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_printf_directive_f="guessing yes" +else + gl_cv_func_printf_directive_f="guessing no" +fi +rm -f conftest* + + ;; # If we don't know, assume the worst. *) gl_cv_func_printf_directive_f="guessing no";; esac @@ -11485,8 +11894,8 @@ if ${gl_cv_func_printf_directive_n+:} false; then : else if test "$cross_compiling" = yes; then : - - case "$host_os" in + case "$host_os" in + # Guess no on native Windows. mingw*) gl_cv_func_printf_directive_n="guessing no";; *) gl_cv_func_printf_directive_n="guessing yes";; esac @@ -11553,12 +11962,14 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - openbsd*) gl_cv_func_printf_directive_ls="guessing no";; - irix*) gl_cv_func_printf_directive_ls="guessing no";; - solaris*) gl_cv_func_printf_directive_ls="guessing no";; - cygwin*) gl_cv_func_printf_directive_ls="guessing no";; - beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; - *) gl_cv_func_printf_directive_ls="guessing yes";; + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + # Guess yes on native Windows. + mingw*) gl_cv_func_printf_directive_ls="guessing yes";; + *) gl_cv_func_printf_directive_ls="guessing yes";; esac else @@ -11643,6 +12054,7 @@ else netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) gl_cv_func_printf_positions="guessing no";; beos*) gl_cv_func_printf_positions="guessing no";; + # Guess no on native Windows. mingw* | pw*) gl_cv_func_printf_positions="guessing no";; *) gl_cv_func_printf_positions="guessing yes";; esac @@ -11690,6 +12102,7 @@ else case "$host_os" in cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + # Guess no on native Windows. mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; *) gl_cv_func_printf_flag_grouping="guessing yes";; esac @@ -11738,6 +12151,8 @@ else hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; # Guess no on HP-UX 10 and older. hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; + # Guess yes on native Windows. + mingw*) gl_cv_func_printf_flag_leftadjust="guessing yes";; # Guess yes otherwise. *) gl_cv_func_printf_flag_leftadjust="guessing yes";; esac @@ -11783,12 +12198,14 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_flag_zero="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_flag_zero="guessing no";; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess no on native Windows. + mingw*) gl_cv_func_printf_flag_zero="guessing no";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; esac else @@ -12002,7 +12419,7 @@ nocrash_init (void) } } } -#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#elif defined _WIN32 && ! defined __CYGWIN__ /* Avoid a crash on native Windows. */ #define WIN32_LEAN_AND_MEAN #include @@ -12033,11 +12450,12 @@ nocrash_init (void) #else /* Avoid a crash on POSIX systems. */ #include +#include /* A POSIX signal handler. */ static void exception_handler (int sig) { - exit (1); + _exit (1); } static void nocrash_init (void) @@ -12123,28 +12541,28 @@ _ACEOF fi if test "$gl_cv_func_printf_enomem" = "guessing no"; then case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on Solaris. - solaris*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on AIX. - aix*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on HP-UX/hppa. - hpux*) case "$host_cpu" in - hppa*) gl_cv_func_printf_enomem="guessing yes";; - *) gl_cv_func_printf_enomem="guessing no";; - esac - ;; - # Guess yes on IRIX. - irix*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on OSF/1. - osf*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_enomem="guessing yes";; - # Guess yes on Haiku. - haiku*) gl_cv_func_printf_enomem="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_enomem="guessing no";; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Solaris. + solaris*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on AIX. + aix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on HP-UX/hppa. + hpux*) case "$host_cpu" in + hppa*) gl_cv_func_printf_enomem="guessing yes";; + *) gl_cv_func_printf_enomem="guessing no";; + esac + ;; + # Guess yes on IRIX. + irix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on OSF/1. + osf*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_enomem="guessing no";; esac fi @@ -12355,12 +12773,58 @@ $as_echo "$gt_cv_c_wint_t" >&6; } $as_echo "#define HAVE_WINT_T 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +$as_echo_n "checking whether wint_t is too small... " >&6; } +if ${gl_cv_type_wint_t_too_small+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_wint_t_too_small=no +else + gl_cv_type_wint_t_too_small=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +$as_echo "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 fi + if test $ac_cv_header_features_h = yes; then HAVE_FEATURES_H=1 else @@ -12782,12 +13246,11 @@ if ${gl_cv_func_snprintf_retval_c99+:} false; then : else if test "$cross_compiling" = yes; then : - - case "$host_os" in + case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; @@ -12808,6 +13271,24 @@ else netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on MSVC, no on mingw. + mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_snprintf_retval_c99="guessing yes" +else + gl_cv_func_snprintf_retval_c99="guessing no" +fi +rm -f conftest* + + ;; # If we don't know, assume the worst. *) gl_cv_func_snprintf_retval_c99="guessing no";; esac @@ -13090,11 +13571,18 @@ $as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h HAVE_DECL_TRUNC=1; HAVE_DECL_TRUNCF=1; HAVE_DECL_TRUNCL=1; + REPLACE_ACOSF=0; + REPLACE_ASINF=0; + REPLACE_ATANF=0; + REPLACE_ATAN2F=0; REPLACE_CBRTF=0; REPLACE_CBRTL=0; REPLACE_CEIL=0; REPLACE_CEILF=0; REPLACE_CEILL=0; + REPLACE_COSF=0; + REPLACE_COSHF=0; + REPLACE_EXPF=0; REPLACE_EXPM1=0; REPLACE_EXPM1F=0; REPLACE_EXP2=0; @@ -13118,6 +13606,7 @@ $as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h REPLACE_HYPOTL=0; REPLACE_ILOGB=0; REPLACE_ILOGBF=0; + REPLACE_ILOGBL=0; REPLACE_ISFINITE=0; REPLACE_ISINF=0; REPLACE_ISNAN=0; @@ -13149,7 +13638,12 @@ $as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h REPLACE_ROUNDL=0; REPLACE_SIGNBIT=0; REPLACE_SIGNBIT_USING_GCC=0; + REPLACE_SINF=0; + REPLACE_SINHF=0; + REPLACE_SQRTF=0; REPLACE_SQRTL=0; + REPLACE_TANF=0; + REPLACE_TANHF=0; REPLACE_TRUNC=0; REPLACE_TRUNCF=0; REPLACE_TRUNCL=0; @@ -13212,6 +13706,7 @@ _ACEOF GNULIB_MKNODAT=0; GNULIB_STAT=0; GNULIB_UTIMENSAT=0; + GNULIB_OVERRIDES_STRUCT_STAT=0; HAVE_FCHMODAT=1; HAVE_FSTATAT=1; HAVE_FUTIMENS=1; @@ -13314,7 +13809,40 @@ $as_echo "$gl_cv_type_off_t_64" >&6; } else WINDOWS_64_BIT_OFF_T=0 fi - WINDOWS_64_BIT_ST_SIZE=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 +$as_echo_n "checking for 64-bit st_size... " >&6; } +if ${gl_cv_member_st_size_64+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + struct stat buf; + int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_member_st_size_64=yes +else + gl_cv_member_st_size_64=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 +$as_echo "$gl_cv_member_st_size_64" >&6; } + if test $gl_cv_member_st_size_64 = no; then + WINDOWS_64_BIT_ST_SIZE=1 + else + WINDOWS_64_BIT_ST_SIZE=0 + fi ;; *) WINDOWS_64_BIT_OFF_T=0 @@ -13348,36 +13876,40 @@ else if test $ac_cv_header_sys_stat_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'sys/stat.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' else gl_cv_next_sys_stat_h='<'sys/stat.h'>' fi @@ -13405,14 +13937,14 @@ $as_echo "$gl_cv_next_sys_stat_h" >&6; } + WINDOWS_STAT_TIMESPEC=0 + + - if test $WINDOWS_64_BIT_ST_SIZE = 1; then -$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h - fi ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include #include @@ -13467,30 +13999,17 @@ fi done -ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" "$ac_includes_default" -if test "x$ac_cv_have_decl_getdelim" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETDELIM $ac_have_decl -_ACEOF - - - -ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" "$ac_includes_default" -if test "x$ac_cv_have_decl_getline" = xyes; then : +ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" +if test "x$ac_cv_have_decl_getdtablesize" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETLINE $ac_have_decl +#define HAVE_DECL_GETDTABLESIZE $ac_have_decl _ACEOF @@ -13520,36 +14039,40 @@ else if test $ac_cv_header_getopt_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'getopt.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'getopt.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_getopt_h + gl_cv_next_getopt_h='"'$gl_header'"' else gl_cv_next_getopt_h='<'getopt.h'>' fi @@ -13877,7 +14400,7 @@ nocrash_init (void) } } } -#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#elif defined _WIN32 && ! defined __CYGWIN__ /* Avoid a crash on native Windows. */ #define WIN32_LEAN_AND_MEAN #include @@ -13908,11 +14431,12 @@ nocrash_init (void) #else /* Avoid a crash on POSIX systems. */ #include +#include /* A POSIX signal handler. */ static void exception_handler (int sig) { - exit (1); + _exit (1); } static void nocrash_init (void) @@ -14097,31 +14621,544 @@ $as_echo "$gl_cv_func_getopt_long_gnu" >&6; } - REPLACE_GETOPT=0 - if test -n "$gl_replace_getopt"; then - REPLACE_GETOPT=1 - fi - if test $REPLACE_GETOPT = 1; then - GETOPT_H=getopt.h + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h +#ifdef _MSC_VER +MicrosoftCompiler +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "MicrosoftCompiler" >/dev/null 2>&1; then : + gl_asmext='asm' + gl_c_asm_opt='-c -Fa' +else + gl_asmext='s' + gl_c_asm_opt='-S' - fi +fi +rm -f conftest* -ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default" -if test "x$ac_cv_have_decl_getenv" = xyes; then : - ac_have_decl=1 + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking host CPU and C ABI" >&5 +$as_echo_n "checking host CPU and C ABI... " >&6; } +if ${gl_cv_host_cpu_c_abi+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 + case "$host_cpu" in + + i[4567]86 ) + gl_cv_host_cpu_c_abi=i386 + ;; + + x86_64 ) + # On x86_64 systems, the C compiler may be generating code in one of + # these ABIs: + # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. + # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 + # with native Windows (mingw, MSVC). + # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if (defined __x86_64__ || defined __amd64__ \ + || defined _M_X64 || defined _M_AMD64) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __ILP32__ || defined _ILP32 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=x86_64-x32 +else + gl_cv_host_cpu_c_abi=x86_64 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + gl_cv_host_cpu_c_abi=i386 fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) + gl_cv_host_cpu_c_abi=alpha + ;; + + arm* | aarch64 ) + # Assume arm with EABI. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __aarch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __ILP32__ || defined _ILP32 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=arm64-ilp32 +else + gl_cv_host_cpu_c_abi=arm64 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + # Don't distinguish little-endian and big-endian arm, since they + # don't require different machine code for simple operations and + # since the user can distinguish them through the preprocessor + # defines __ARMEL__ vs. __ARMEB__. + # But distinguish arm which passes floating-point arguments and + # return values in integer registers (r0, r1, ...) - this is + # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which + # passes them in float registers (s0, s1, ...) and double registers + # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer + # sets the preprocessor defines __ARM_PCS (for the first case) and + # __ARM_PCS_VFP (for the second case), but older GCC does not. + echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c + # Look for a reference to the register d0 in the .s file. + { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } >/dev/null 2>&1 + if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then + gl_cv_host_cpu_c_abi=armhf + else + gl_cv_host_cpu_c_abi=arm + fi + rm -f conftest* + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) + # On hppa, the C compiler may be generating 32-bit code or 64-bit + # code. In the latter case, it defines _LP64 and __LP64__. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=hppa64 +else + gl_cv_host_cpu_c_abi=hppa +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + ia64* ) + # On ia64 on HP-UX, the C compiler may be generating 64-bit code or + # 32-bit code. In the latter case, it defines _ILP32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef _ILP32 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=ia64-ilp32 +else + gl_cv_host_cpu_c_abi=ia64 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + mips* ) + # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this + # at 32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=mips64 +else + # In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but + # may later get defined by ), and _MIPS_SIM == _ABIN32. + # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but + # may later get defined by ), and _MIPS_SIM == _ABIO32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if (_MIPS_SIM == _ABIN32) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=mipsn32 +else + gl_cv_host_cpu_c_abi=mips +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + powerpc* ) + # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. + # No need to distinguish them here; the caller may distinguish + # them based on the OS. + # On powerpc64 systems, the C compiler may still be generating + # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may + # be generating 64-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # On powerpc64, there are two ABIs on Linux: The AIX compatible + # one and the ELFv2 one. The latter defines _CALL_ELF=2. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _CALL_ELF && _CALL_ELF == 2 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=powerpc64-elfv2 +else + gl_cv_host_cpu_c_abi=powerpc64 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + gl_cv_host_cpu_c_abi=powerpc +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + rs6000 ) + gl_cv_host_cpu_c_abi=powerpc + ;; + + riscv32 | riscv64 ) + # There are 2 architectures (with variants): rv32* and rv64*. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if __riscv_xlen == 64 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cpu=riscv64 +else + cpu=riscv32 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. + # Size of 'long' and 'void *': + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + main_abi=lp64 +else + main_abi=ilp32 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # Float ABIs: + # __riscv_float_abi_double: + # 'float' and 'double' are passed in floating-point registers. + # __riscv_float_abi_single: + # 'float' are passed in floating-point registers. + # __riscv_float_abi_soft: + # No values are passed in floating-point registers. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __riscv_float_abi_double + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + float_abi=d +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __riscv_float_abi_single + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + float_abi=f +else + float_abi='' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}" + ;; + + s390* ) + # On s390x, the C compiler may be generating 64-bit (= s390x) code + # or 31-bit (= s390) code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __s390x__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=s390x +else + gl_cv_host_cpu_c_abi=s390 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + sparc | sparc64 ) + # UltraSPARCs running Linux have `uname -m` = "sparc64", but the + # C compiler still generates 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV $ac_have_decl _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi=sparc64 +else + gl_cv_host_cpu_c_abi=sparc +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + *) + gl_cv_host_cpu_c_abi="$host_cpu" + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi" >&5 +$as_echo "$gl_cv_host_cpu_c_abi" >&6; } + + HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` + HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" + + + + # This was + # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) + # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) + # earlier, but KAI C++ 3.2d doesn't like this. + sed -e 's/-/_/g' >> confdefs.h <' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_limits_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'limits.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +$as_echo "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +$as_echo_n "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if ${gl_cv_header_limits_width+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + int ullw = ULLONG_WIDTH; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_limits_width=yes +else + gl_cv_header_limits_width=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +$as_echo "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + @@ -14187,36 +15224,40 @@ else if test $ac_cv_header_stdint_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'stdint.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdint.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdint_h + gl_cv_next_stdint_h='"'$gl_header'"' else gl_cv_next_stdint_h='<'stdint.h'>' fi @@ -14259,6 +15300,8 @@ else #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) @@ -14349,6 +15392,15 @@ uintptr_t h = UINTPTR_MAX; intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) @@ -14419,7 +15471,12 @@ main () _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if test "$cross_compiling" = yes; then : - gl_cv_header_working_stdint_h=yes + case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; + # In general, assume it works. + *) gl_cv_header_working_stdint_h="guessing yes" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14427,6 +15484,8 @@ else #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include @@ -14512,10 +15571,115 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 $as_echo "$gl_cv_header_working_stdint_h" >&6; } fi - if test "$gl_cv_header_working_stdint_h" = yes; then - STDINT_H= - else - for ac_header in sys/inttypes.h sys/bitypes.h + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h + case "$gl_cv_header_working_stdint_h" in + *yes) + HAVE_C99_STDINT_H=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +$as_echo_n "checking whether stdint.h predates C++11... " >&6; } +if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_stdint_predates_cxx11_h=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if ${gl_cv_header_stdint_width+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int iw = UINTMAX_WIDTH; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +$as_echo "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi + ;; + *) + for ac_header in sys/inttypes.h sys/bitypes.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -14528,19 +15692,12 @@ fi done - if test $ac_cv_header_sys_inttypes_h = yes; then - HAVE_SYS_INTTYPES_H=1 - else - HAVE_SYS_INTTYPES_H=0 - fi - - if test $ac_cv_header_sys_bitypes_h = yes; then - HAVE_SYS_BITYPES_H=1 - else - HAVE_SYS_BITYPES_H=0 - fi - - + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + fi + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + fi if test $APPLE_UNIVERSAL_BUILD = 0; then @@ -14836,12 +15993,26 @@ _ACEOF - if test $BITSIZEOF_WINT_T -lt 32; then + if test $GNULIB_OVERRIDES_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi - STDINT_H=stdint.h - fi + ;; + esac + + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + if test -n "$STDINT_H"; then GL_GENERATE_STDINT_H_TRUE= @@ -14864,6 +16035,7 @@ fi HAVE_DECL_STRTOIMAX=1; HAVE_DECL_STRTOUMAX=1; REPLACE_STRTOIMAX=0; + REPLACE_STRTOUMAX=0; INT32_MAX_LT_INTMAX_MAX=1; INT64_MAX_EQ_LONG_MAX='defined _LP64'; PRI_MACROS_BROKEN=0; @@ -14897,36 +16069,40 @@ else if test $ac_cv_header_inttypes_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'inttypes.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_inttypes_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'inttypes.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_inttypes_h + gl_cv_next_inttypes_h='"'$gl_header'"' else gl_cv_next_inttypes_h='<'inttypes.h'>' fi @@ -15264,8 +16440,26 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; - *) gl_cv_func_isnanf_works="guessing yes";; + irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;; + mingw*) # Guess yes on mingw, no on MSVC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MINGW32__ + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_isnanf_works="guessing yes" +else + gl_cv_func_isnanf_works="guessing no" +fi +rm -f conftest* + + ;; + *) gl_cv_func_isnanf_works="guessing yes" ;; esac else @@ -15549,15 +16743,26 @@ if ${gl_cv_func_isnanl_works+:} false; then : else if test "$cross_compiling" = yes; then : - case "$host_cpu" in - # Guess no on ia64, x86_64, i386. - ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; - *) - case "$host_os" in - netbsd*) gl_cv_func_isnanl_works="guessing no";; - *) gl_cv_func_isnanl_works="guessing yes";; - esac + case "$host_os" in + mingw*) # Guess yes on mingw, no on MSVC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MINGW32__ + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_isnanl_works="guessing yes" +else + gl_cv_func_isnanl_works="guessing no" +fi +rm -f conftest* + ;; + *) gl_cv_func_isnanl_works="guessing yes" ;; esac else @@ -15618,7 +16823,7 @@ int main () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else @@ -15638,41 +16843,35 @@ int main () if (!isnanl (x.value)) result |= 2; } - /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, - Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in - Intel IA-64 Architecture Software Developer's Manual, Volume 1: - Application Architecture. - Table 5-2 "Floating-Point Register Encodings" - Figure 5-6 "Memory to Floating-Point Register Data Translation" - */ + /* isnanl should return something even for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 4; } { /* Pseudo-Infinity. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 8; } { /* Pseudo-Zero. */ static memory_long_double x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 16; } { /* Unnormalized number. */ static memory_long_double x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 32; } { /* Pseudo-Denormal. */ static memory_long_double x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 64; } #endif @@ -15708,380 +16907,6 @@ $as_echo "$gl_cv_func_isnanl_works" >&6; } - GNULIB_ISWBLANK=0; - GNULIB_WCTYPE=0; - GNULIB_ISWCTYPE=0; - GNULIB_WCTRANS=0; - GNULIB_TOWCTRANS=0; - HAVE_ISWBLANK=1; - HAVE_WCTYPE_T=1; - HAVE_WCTRANS_T=1; - REPLACE_ISWBLANK=0; - - - - - - - - - - - if test $ac_cv_func_iswcntrl = yes; then - HAVE_ISWCNTRL=1 - else - HAVE_ISWCNTRL=0 - fi - - - - if test $gt_cv_c_wint_t = yes; then - HAVE_WINT_T=1 - else - HAVE_WINT_T=0 - fi - - - - - - - - - - - - if test $gl_cv_have_include_next = yes; then - gl_cv_next_wctype_h='<'wctype.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_wctype_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test $ac_cv_header_wctype_h = yes; then - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'wctype.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' - else - gl_cv_next_wctype_h='<'wctype.h'>' - fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 -$as_echo "$gl_cv_next_wctype_h" >&6; } - fi - NEXT_WCTYPE_H=$gl_cv_next_wctype_h - - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'wctype.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_wctype_h - fi - NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive - - - - - if test $ac_cv_header_wctype_h = yes; then - if test $ac_cv_func_iswcntrl = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 -$as_echo_n "checking whether iswcntrl works... " >&6; } -if ${gl_cv_func_iswcntrl_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #if __GNU_LIBRARY__ == 1 - Linux libc5 i18n is broken. - #endif -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_func_iswcntrl_works="guessing yes" -else - gl_cv_func_iswcntrl_works="guessing no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - /* Tru64 with Desktop Toolkit C has a bug: must be - included before . - BSD/OS 4.0.1 has a bug: , and - must be included before . */ - #include - #include - #include - #include - #include - int main () { return iswprint ('x') == 0; } - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_iswcntrl_works=yes -else - gl_cv_func_iswcntrl_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 -$as_echo "$gl_cv_func_iswcntrl_works" >&6; } - fi - HAVE_WCTYPE_H=1 - else - HAVE_WCTYPE_H=0 - fi - - - case "$gl_cv_func_iswcntrl_works" in - *yes) REPLACE_ISWCNTRL=0 ;; - *) REPLACE_ISWCNTRL=1 ;; - esac - - - if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then - : - fi - - if test $REPLACE_ISWCNTRL = 1; then - REPLACE_TOWLOWER=1 - else - for ac_func in towlower -do : - ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" -if test "x$ac_cv_func_towlower" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_TOWLOWER 1 -_ACEOF - -fi -done - - if test $ac_cv_func_towlower = yes; then - REPLACE_TOWLOWER=0 - else - ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be - included before . - BSD/OS 4.0.1 has a bug: , and - must be included before . */ - #include - #include - #include - #include - #if HAVE_WCTYPE_H - # include - #endif - -" -if test "x$ac_cv_have_decl_towlower" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TOWLOWER $ac_have_decl -_ACEOF - - if test $ac_cv_have_decl_towlower = yes; then - REPLACE_TOWLOWER=1 - else - REPLACE_TOWLOWER=0 - fi - fi - fi - - - if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then - : - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 -$as_echo_n "checking for wctype_t... " >&6; } -if ${gl_cv_type_wctype_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Tru64 with Desktop Toolkit C has a bug: must be - included before . - BSD/OS 4.0.1 has a bug: , and - must be included before . */ - #include - #include - #include - #include - #if HAVE_WCTYPE_H - # include - #endif - wctype_t a; - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_type_wctype_t=yes -else - gl_cv_type_wctype_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 -$as_echo "$gl_cv_type_wctype_t" >&6; } - if test $gl_cv_type_wctype_t = no; then - HAVE_WCTYPE_T=0 - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 -$as_echo_n "checking for wctrans_t... " >&6; } -if ${gl_cv_type_wctrans_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Tru64 with Desktop Toolkit C has a bug: must be - included before . - BSD/OS 4.0.1 has a bug: , and - must be included before . */ - #include - #include - #include - #include - #include - wctrans_t a; - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_type_wctrans_t=yes -else - gl_cv_type_wctrans_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 -$as_echo "$gl_cv_type_wctrans_t" >&6; } - if test $gl_cv_type_wctrans_t = no; then - HAVE_WCTRANS_T=0 - fi - - - for gl_func in wctype iswctype wctrans towctrans ; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include -# include -# include -# include -#endif -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - - eval ac_cv_have_decl_$gl_func=yes -fi - done - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used without linking with libm" >&5 $as_echo_n "checking whether ldexp() can be used without linking with libm... " >&6; } if ${gl_cv_func_ldexp_no_libm+:} false; then : @@ -16236,38 +17061,12 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +$as_echo_n "checking for ld... " >&6; } +elif test "$GCC" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` - while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } @@ -16275,44 +17074,129 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${acl_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$acl_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 &6 +else + + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; esac fi - done - IFS="$acl_save_ifs" + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + sparc64-*-netbsd*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + else - acl_cv_path_LD="$LD" # Let the user override the test with a path. + # The compiler produces 32-bit code. Add option '-m elf32_sparc' + # so that the linker groks 32-bit object files. + case "$acl_cv_path_LD " in + *" -m elf32_sparc "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;; + esac + fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + esac + fi -LD="$acl_cv_path_LD" + LD="$acl_cv_path_LD" +fi if test -n "$LD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : @@ -16369,66 +17253,91 @@ fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; } +if ${acl_cv_libdirstems+:} false; then : + $as_echo_n "(cached) " >&6 +else acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 + acl_libdirstem2= + case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef _LP64 -sixtyfour bits -#endif + int ok; + #else + error fail + #endif _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sixtyfour bits" >/dev/null 2>&1; then : +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } - if test $gl_cv_solaris_64bit = yes; then - acl_libdirstem=lib/64 - case "$host_cpu" in - sparc*) acl_libdirstem2=lib/sparcv9 ;; - i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; - esac - fi - ;; - *) - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; - esac - test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + case "$gl_cv_host_cpu_c_abi" in + i386 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | s390 | sparc) + ;; + *) # x86_64 | arm64 | hppa64 | ia64 | mips64 | powerpc64* | s390x | sparc64 | ... + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +$as_echo "$acl_cv_libdirstems" >&6; } + # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2. + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'` @@ -16500,6 +17409,9 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi + case " $LDFLAGS " in + *" -static "*) gl_cv_have_weak=no ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 @@ -16523,26 +17435,42 @@ fi # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # in libc. IRIX 6.5 has the first one in both libc and libpthread, but # the second one only in libpthread, and lock.c needs it. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # + # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 + # needs -pthread for some reason. See: + # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html + save_LIBS=$LIBS + for gl_pthread in '' '-pthread'; do + LIBS="$LIBS $gl_pthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include + pthread_mutex_t m; + pthread_mutexattr_t ma; + int main () { -pthread_mutex_lock((pthread_mutex_t*)0); - pthread_mutexattr_init((pthread_mutexattr_t*)0); +pthread_mutex_lock (&m); + pthread_mutexattr_init (&ma); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gl_have_pthread=yes + LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread + LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + LIBS=$save_LIBS + test -n "$gl_have_pthread" && break + done + # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) - if test -n "$gl_have_pthread"; then + if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 @@ -16587,8 +17515,10 @@ if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : # Therefore pthread_in_use() needs to actually try to create a # thread: pthread_create from libc will fail, whereas # pthread_create will actually create a thread. + # On Solaris 10 or newer, this test is no longer needed, because + # libc contains the fully functional pthread functions. case "$host_os" in - solaris* | hpux*) + solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h @@ -16596,7 +17526,7 @@ $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h fi - else + elif test -z "$gl_have_pthread"; then # Some library is needed. Try libpthread and libc_r. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } @@ -16804,7 +17734,7 @@ if test "${with_libpth_prefix+set}" = set; then : additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then + && test ! -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi @@ -17338,6 +18268,216 @@ $as_echo "$gl_threads_api" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file + echo >conftest.file + if test "$cross_compiling" = yes; then : + case "$host_os" in + *-gnu* | gnu*) + # Guess yes on glibc systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + mingw*) + # Guess no on native Windows. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + *) + # If we don't know, assume the worst. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + if (symlink ("conftest.file", "conftest.sym") != 0) + return 1; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_lstat_dereferences_slashed_symlink=yes +else + gl_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + + for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \ + | hpux* | solaris* | cygwin* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H + # include + #else + char *malloc (); + #endif + +int +main () +{ +char *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } + if test $ac_cv_func_malloc_0_nonnull = yes; then : + gl_cv_func_malloc_0_nonnull=1 +else + gl_cv_func_malloc_0_nonnull=0 +fi + + +cat >>confdefs.h <<_ACEOF +#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull +_ACEOF + + + + + GNULIB_BTOWC=0; GNULIB_WCTOB=0; GNULIB_MBSINIT=0; @@ -17377,6 +18517,7 @@ $as_echo "$gl_threads_api" >&6; } GNULIB_WCSSTR=0; GNULIB_WCSTOK=0; GNULIB_WCSWIDTH=0; + GNULIB_WCSFTIME=0; HAVE_BTOWC=1; HAVE_MBSINIT=1; HAVE_MBRTOWC=1; @@ -17414,6 +18555,7 @@ $as_echo "$gl_threads_api" >&6; } HAVE_WCSSTR=1; HAVE_WCSTOK=1; HAVE_WCSWIDTH=1; + HAVE_WCSFTIME=1; HAVE_DECL_WCTOB=1; HAVE_DECL_WCWIDTH=1; REPLACE_MBSTATE_T=0; @@ -17429,6 +18571,7 @@ $as_echo "$gl_threads_api" >&6; } REPLACE_WCSNRTOMBS=0; REPLACE_WCWIDTH=0; REPLACE_WCSWIDTH=0; + REPLACE_WCSFTIME=0; @@ -17502,9 +18645,14 @@ struct tm t; char buf[16]; int main () { - const char *p; + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if defined __BEOS__ || defined __HAIKU__ + return 1; +#else /* Check whether the given locale name is recognized by the system. */ -#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -17512,9 +18660,9 @@ int main () if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; -#else +# else if (setlocale (LC_ALL, "") == NULL) return 1; -#endif +# endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. @@ -17523,32 +18671,36 @@ int main () some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ -#if HAVE_LANGINFO_CODESET +# if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } -#endif -#ifdef __CYGWIN__ +# endif +# ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -#endif +# endif /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales on Cygwin 1.5.x. */ if (MB_CUR_MAX == 1) return 1; /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. This excludes the UTF-8 encoding (except on MirBSD). */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; - for (p = buf; *p != '\0'; p++) - if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) - return 1; + { + const char *p; + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + } return 0; +#endif } _ACEOF @@ -17642,9 +18794,14 @@ struct tm t; char buf[16]; int main () { - const char *p; + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if defined __BEOS__ || defined __HAIKU__ + return 1; +#else /* Check whether the given locale name is recognized by the system. */ -#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -17652,9 +18809,9 @@ int main () if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; -#else +# else if (setlocale (LC_ALL, "") == NULL) return 1; -#endif +# endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. @@ -17663,32 +18820,36 @@ int main () some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ -#if HAVE_LANGINFO_CODESET +# if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } -#endif -#ifdef __CYGWIN__ +# endif +# ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -#endif +# endif /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. This excludes the UTF-8 encoding (except on MirBSD). */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; - for (p = buf; *p != '\0'; p++) - if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) - return 1; + { + const char *p; + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + } /* Check whether a typical GB18030 multibyte sequence is recognized as a single wide character. This excludes the GB2312 and GBK encodings. */ if (mblen ("\203\062\332\066", 5) != 4) return 1; return 0; +#endif } _ACEOF @@ -17777,7 +18938,7 @@ int main () { variables, and all locales use the UTF-8 encoding. */ #if !(defined __BEOS__ || defined __HAIKU__) /* Check whether the given locale name is recognized by the system. */ -# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -17880,6 +19041,13 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; } + + + + + + + GNULIB_EXPLICIT_BZERO=0; GNULIB_FFSL=0; GNULIB_FFSLL=0; GNULIB_MEMCHR=0; @@ -17918,7 +19086,8 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; } GNULIB_STRSIGNAL=0; GNULIB_STRVERSCMP=0; HAVE_MBSLEN=0; - HAVE_FFSL=1; + HAVE_EXPLICIT_BZERO=1; + HAVE_FFSL=1; HAVE_FFSLL=1; HAVE_MEMCHR=1; HAVE_DECL_MEMMEM=1; @@ -17941,17 +19110,17 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; } REPLACE_MEMCHR=0; REPLACE_MEMMEM=0; REPLACE_STPNCPY=0; + REPLACE_STRCHRNUL=0; REPLACE_STRDUP=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; REPLACE_STRSTR=0; REPLACE_STRCASESTR=0; - REPLACE_STRCHRNUL=0; + REPLACE_STRTOK_R=0; REPLACE_STRERROR=0; REPLACE_STRERROR_R=0; - REPLACE_STRNCAT=0; - REPLACE_STRNDUP=0; - REPLACE_STRNLEN=0; REPLACE_STRSIGNAL=0; - REPLACE_STRTOK_R=0; UNDEFINE_STRTOK_R=0; @@ -17959,11 +19128,6 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; } - - - - - # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is # irrelevant for anonymous mappings. @@ -18032,10 +19196,10 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h if test $HAVE_MEMCHR = 1; then # Detect platform-specific bugs in some versions of glibc: # memchr should not dereference anything with length 0 - # http://bugzilla.redhat.com/499689 + # https://bugzilla.redhat.com/show_bug.cgi?id=499689 # memchr should not dereference overestimated length after a match - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 - # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 # Assume that memchr works on platforms that lack mprotect. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 $as_echo_n "checking whether memchr works... " >&6; } @@ -18043,7 +19207,13 @@ if ${gl_cv_func_memchr_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - gl_cv_func_memchr_works="guessing no" + case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_func_memchr_works="guessing yes" ;; + # Be pessimistic for now. + *) gl_cv_func_memchr_works="guessing no" ;; + esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18109,16 +19279,97 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 $as_echo "$gl_cv_func_memchr_works" >&6; } - if test "$gl_cv_func_memchr_works" != yes; then - REPLACE_MEMCHR=1 - fi + case "$gl_cv_func_memchr_works" in + *yes) ;; + *) REPLACE_MEMCHR=1 ;; + esac + fi + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +$as_echo_n "checking whether defines MIN and MAX... " >&6; } +if ${gl_cv_minmax_in_limits_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_minmax_in_limits_h=yes +else + gl_cv_minmax_in_limits_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 +$as_echo "$gl_cv_minmax_in_limits_h" >&6; } + if test $gl_cv_minmax_in_limits_h = yes; then + +$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +$as_echo_n "checking whether defines MIN and MAX... " >&6; } +if ${gl_cv_minmax_in_sys_param_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_minmax_in_sys_param_h=yes +else + gl_cv_minmax_in_sys_param_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 +$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; } + if test $gl_cv_minmax_in_sys_param_h = yes; then + +$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h + + fi + + + + + + + + + ac_fn_c_check_decl "$LINENO" "obstack_printf" "ac_cv_have_decl_obstack_printf" "$ac_includes_default" if test "x$ac_cv_have_decl_obstack_printf" = xyes; then : ac_have_decl=1 @@ -18131,6 +19382,35 @@ cat >>confdefs.h <<_ACEOF _ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5 +$as_echo_n "checking for O_CLOEXEC... " >&6; } +if ${gl_cv_macro_O_CLOEXEC+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #ifndef O_CLOEXEC + choke me; + #endif + +int +main () +{ +return O_CLOEXEC; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_macro_O_CLOEXEC=yes +else + gl_cv_macro_O_CLOEXEC=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5 +$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; } @@ -18178,10 +19458,12 @@ if ${gl_cv_func_strerror_0_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_strerror_0_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; esac else @@ -18473,8 +19755,78 @@ _ACEOF + LIB_POSIX_SPAWN= + gl_saved_libs=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing posix_spawn" >&5 +$as_echo_n "checking for library containing posix_spawn... " >&6; } +if ${ac_cv_search_posix_spawn+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char posix_spawn (); +int +main () +{ +return posix_spawn (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_posix_spawn=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_posix_spawn+:} false; then : + break +fi +done +if ${ac_cv_search_posix_spawn+:} false; then : + +else + ac_cv_search_posix_spawn=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_posix_spawn" >&5 +$as_echo "$ac_cv_search_posix_spawn" >&6; } +ac_res=$ac_cv_search_posix_spawn +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_posix_spawn" = "none required" || + LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn +fi + + for ac_func in posix_spawn +do : + ac_fn_c_check_func "$LINENO" "posix_spawn" "ac_cv_func_posix_spawn" +if test "x$ac_cv_func_posix_spawn" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POSIX_SPAWN 1 +_ACEOF + +fi +done + + LIBS=$gl_saved_libs if test $ac_cv_func_posix_spawn != yes; then HAVE_POSIX_SPAWN=0 @@ -18630,7 +19982,7 @@ if ac_fn_c_try_link "$LINENO"; then : if test -s conftest$ac_exeext \ && ./conftest$ac_exeext > conftest.out \ && echo 'This should be seen only once.' > conftest.ok \ - && cmp conftest.out conftest.ok > /dev/null; then + && cmp conftest.out conftest.ok >/dev/null 2>&1; then gl_cv_func_posix_spawn_works=yes else gl_cv_func_posix_spawn_works=no @@ -19204,27 +20556,6 @@ $as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef _MSC_VER -MicrosoftCompiler -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "MicrosoftCompiler" >/dev/null 2>&1; then : - gl_asmext='asm' - gl_c_asm_opt='-c -Fa' - -else - gl_asmext='s' - gl_c_asm_opt='-S' - -fi -rm -f conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C symbols are prefixed with underscore at the linker level" >&5 @@ -19245,7 +20576,7 @@ EOF ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } >/dev/null 2>&1 - if grep _foo conftest.$gl_asmext >/dev/null ; then + if LC_ALL=C $EGREP '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/dev/null; then gl_cv_prog_as_underscore=yes else gl_cv_prog_as_underscore=no @@ -19312,8 +20643,6 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 $as_echo_n "checking for C/C++ restrict keyword... " >&6; } if ${ac_cv_c_restrict+:} false; then : @@ -19324,17 +20653,19 @@ else for ac_kw in __restrict __restrict__ _Restrict restrict; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; - } +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + int main () { int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t) + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ; return 0; } @@ -19407,6 +20738,8 @@ _ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : @@ -19416,59 +20749,67 @@ else /* end confdefs.h. */ #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif #endif + #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif - struct s { _Bool s: 1; _Bool t; } s; + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; + char f[(Bool) 0.0 == false ? 1 : -1]; char g[true]; - char h[sizeof (_Bool)]; + char h[sizeof (Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; + Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html */ - _Bool q = true; - _Bool *pq = &q; + Bool q = true; + Bool *pq = &q; + bool *qq = &q; int main () { bool e = &s; - *pq |= q; - *pq |= ! q; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); + + !m + !n + !o + !p + !q + !pq + !qq); ; return 0; @@ -19496,6 +20837,7 @@ fi REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; HAVE_WCHAR_T=1; @@ -19533,36 +20875,40 @@ if ${gl_cv_next_string_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'string.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' - gl_header_literal_regex=`echo 'string.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_string_h + gl_cv_next_string_h='"'$gl_header'"' fi @@ -19659,6 +21005,10 @@ _ACEOF +$as_echo "#define _USE_STD_STAT 1" >>confdefs.h + + + @@ -19676,36 +21026,40 @@ if ${gl_cv_next_sys_types_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` - gl_header_literal_regex=`echo 'sys/types.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_sys_types_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_header=$gl_cv_absolute_sys_types_h + gl_cv_next_sys_types_h='"'$gl_header'"' fi @@ -19734,26 +21088,43 @@ $as_echo "$gl_cv_next_sys_types_h" >&6; } + WINDOWS_STAT_INODES=0 + + + + GNULIB_WAITPID=0; + GNULIB_CTIME=0; GNULIB_MKTIME=0; + GNULIB_LOCALTIME=0; GNULIB_NANOSLEEP=0; + GNULIB_STRFTIME=0; GNULIB_STRPTIME=0; GNULIB_TIMEGM=0; GNULIB_TIME_R=0; + GNULIB_TIME_RZ=0; + GNULIB_TZSET=0; HAVE_DECL_LOCALTIME_R=1; HAVE_NANOSLEEP=1; HAVE_STRPTIME=1; HAVE_TIMEGM=1; - REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; + HAVE_TZSET=1; + HAVE_TIMEZONE_T=0; + REPLACE_CTIME=GNULIB_PORTCHECK; + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; REPLACE_MKTIME=GNULIB_PORTCHECK; REPLACE_NANOSLEEP=GNULIB_PORTCHECK; + REPLACE_STRFTIME=GNULIB_PORTCHECK; REPLACE_TIMEGM=GNULIB_PORTCHECK; + REPLACE_TZSET=GNULIB_PORTCHECK; - + : ${GNULIB_GETTIMEOFDAY=0}; + REPLACE_GMTIME=0; + REPLACE_LOCALTIME=0; @@ -19787,6 +21158,7 @@ $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; } TIME_H_DEFINES_STRUCT_TIMESPEC=0 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then TIME_H_DEFINES_STRUCT_TIMESPEC=1 else @@ -19847,6 +21219,36 @@ fi $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +$as_echo_n "checking for struct timespec in ... " >&6; } +if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_sys_struct_timespec_in_unistd_h=yes +else + gl_cv_sys_struct_timespec_in_unistd_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 +$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } + if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then + UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 + fi fi fi fi @@ -19865,6 +21267,7 @@ $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $gl_cv_have_include_next = yes; then gl_cv_next_time_h='<'time.h'>' else @@ -19874,36 +21277,40 @@ if ${gl_cv_next_time_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'time.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' - gl_header_literal_regex=`echo 'time.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_time_h + gl_cv_next_time_h='"'$gl_header'"' fi @@ -20134,12 +21541,13 @@ extern int zero (void); int main () { return zero(); } _ACEOF + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - mv conftest.$ac_objext conftest1.$ac_objext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20155,12 +21563,12 @@ _ACEOF int zero (void) { return 0; } _ACEOF + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - mv conftest.$ac_objext conftest2.$ac_objext if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then : else @@ -20168,6 +21576,7 @@ _ACEOF fi fi fi + ac_compile="$save_ac_compile" rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext fi @@ -20179,7 +21588,7 @@ This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in C99 mode. You have four options: - Add the flag -fgnu89-inline to CC and reconfigure, or - Fix your include files, using parts of - , or + , or - Use a gcc version older than 4.3, or - Don't use the flags -std=c99 or -std=gnu99. Configuration aborted." "$LINENO" 5 @@ -20188,6 +21597,32 @@ Configuration aborted." "$LINENO" 5 + + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + + + + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; + + + + + + + + if false; then GL_COND_LIBTOOL_TRUE= GL_COND_LIBTOOL_FALSE='#' @@ -20332,9 +21767,11 @@ $as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - REPLACE_CLOSE=1 - fi + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + @@ -20443,6 +21880,10 @@ _ACEOF localedir='${datarootdir}/locale' fi + if test "x$runstatedir" = x; then + runstatedir='${localstatedir}/run' + + fi pkglibexecdir='${libexecdir}/${PACKAGE}' @@ -20520,47 +21961,78 @@ else gl_cv_func_dup2_works="guessing no" ;; cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 gl_cv_func_dup2_works="guessing no" ;; - linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a - # closed fd may yield -EBADF instead of -1 / errno=EBADF. - gl_cv_func_dup2_works="guessing no" ;; - freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF. + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. gl_cv_func_dup2_works="guessing no" ;; haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; *) gl_cv_func_dup2_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include -#include -#include + #include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + int main () { int result = 0; -#ifdef FD_CLOEXEC - if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) - result |= 1; -#endif - if (dup2 (1, 1) == 0) - result |= 2; -#ifdef FD_CLOEXEC - if (fcntl (1, F_GETFD) != FD_CLOEXEC) - result |= 4; -#endif - close (0); - if (dup2 (0, 0) != -1) - result |= 8; - /* Many gnulib modules require POSIX conformance of EBADF. */ - if (dup2 (2, 1000000) == -1 && errno != EBADF) - result |= 16; - /* Flush out a cygwin core dump. */ - if (dup2 (2, -1) != -1 || errno != EBADF) - result |= 32; - return result; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + close (fd); + } + return result; ; return 0; } @@ -20583,6 +22055,17 @@ $as_echo "$gl_cv_func_dup2_works" >&6; } *yes) ;; *) REPLACE_DUP2=1 + for ac_func in setdtablesize +do : + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SETDTABLESIZE 1 +_ACEOF + +fi +done + ;; esac fi @@ -20713,26 +22196,54 @@ if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - # Guess that it works on glibc systems - case $host_os in #(( - *-gnu*) gl_cv_func_fcntl_f_dupfd_works="guessing yes";; - *) gl_cv_func_fcntl_f_dupfd_works="guessing no";; + case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include #include + #include + #include + #include + #include + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif int main () { int result = 0; - if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; - if (errno != EINVAL) result |= 2; - return result; - + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result; ; return 0; } @@ -20878,36 +22389,40 @@ if ${gl_cv_next_fcntl_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'fcntl.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` - gl_header_literal_regex=`echo 'fcntl.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_header=$gl_cv_absolute_fcntl_h + gl_cv_next_fcntl_h='"'$gl_header'"' fi @@ -20990,7 +22505,7 @@ _ACEOF aix* | beos* | openbsd* | mirbsd* | irix*) FLOAT_H=float.h ;; - freebsd*) + freebsd* | dragonfly*) case "$host_cpu" in i[34567]86 ) FLOAT_H=float.h @@ -21001,17 +22516,18 @@ _ACEOF cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __LP64__ || defined __x86_64__ || defined __amd64__ - yes - #endif + int ok; + #else + error fail + #endif + _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : +if ac_fn_c_try_compile "$LINENO"; then : else FLOAT_H=float.h fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; esac ;; @@ -21024,7 +22540,7 @@ rm -f conftest* ;; esac case "$host_os" in - aix* | freebsd* | linux*) + aix* | freebsd* | dragonfly* | linux*) if test -n "$FLOAT_H"; then REPLACE_FLOAT_LDBL=1 fi @@ -21044,19 +22560,22 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __LP64__ || defined __arch64__ - yes - #endif + int ok; + #else + error fail + #endif + _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : +if ac_fn_c_try_compile "$LINENO"; then : gl_cv_func_itold_works="guessing no" else gl_cv_func_itold_works="guessing yes" fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; - *) gl_cv_func_itold_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_itold_works="guessing yes" ;; + *) gl_cv_func_itold_works="guessing yes" ;; esac else @@ -21111,36 +22630,40 @@ if ${gl_cv_next_float_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'float.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` - gl_header_literal_regex=`echo 'float.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_header=$gl_cv_absolute_float_h + gl_cv_next_float_h='"'$gl_header'"' fi @@ -21229,7 +22752,11 @@ else #include int main () { - return fopen ("conftest.sl/", "w") != NULL; + FILE *fp = fopen ("conftest.sl/", "w"); + int result = (fp != NULL); + if (fp != NULL) + fclose (fp); + return result; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -21294,14 +22821,42 @@ _ACEOF - fp_headers=' -# include -# if HAVE_STDIO_EXT_H -# include -# endif -' - ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers + #include + #if HAVE_STDIO_EXT_H + # include + #endif + ' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpending" >&5 +$as_echo_n "checking for __fpending... " >&6; } +if ${gl_cv_func___fpending+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$fp_headers +int +main () +{ +return ! __fpending (stdin); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func___fpending=yes +else + gl_cv_func___fpending=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func___fpending" >&5 +$as_echo "$gl_cv_func___fpending" >&6; } + if test $gl_cv_func___fpending = yes; then + ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers " if test "x$ac_cv_have_decl___fpending" = xyes; then : ac_have_decl=1 @@ -21313,8 +22868,9 @@ cat >>confdefs.h <<_ACEOF #define HAVE_DECL___FPENDING $ac_have_decl _ACEOF + fi - if test $ac_cv_func___fpending = no; then + if test $gl_cv_func___fpending = no; then @@ -21325,86 +22881,6 @@ _ACEOF gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5 -$as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; } -if ${ac_cv_sys_pending_output_n_bytes+:} false; then : - $as_echo_n "(cached) " >&6 -else - - for ac_expr in \ - \ - '# glibc2' \ - 'fp->_IO_write_ptr - fp->_IO_write_base' \ - \ - '# traditional Unix' \ - 'fp->_ptr - fp->_base' \ - \ - '# BSD' \ - 'fp->_p - fp->_bf._base' \ - \ - '# SCO, Unixware' \ - '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ - \ - '# QNX' \ - '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ - \ - '# old glibc?' \ - 'fp->__bufp - fp->__buffer' \ - \ - '# old glibc iostream?' \ - 'fp->_pptr - fp->_pbase' \ - \ - '# emx+gcc' \ - 'fp->_ptr - fp->_buffer' \ - \ - '# Minix' \ - 'fp->_ptr - fp->_buf' \ - \ - '# Plan9' \ - 'fp->wp - fp->buf' \ - \ - '# VMS' \ - '(*fp)->_ptr - (*fp)->_base' \ - \ - '# e.g., DGUX R4.11; the info is not available' \ - 1 \ - ; do - - # Skip each embedded comment. - case "$ac_expr" in '#'*) continue;; esac - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *fp = stdin; (void) ($ac_expr); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - fp_done=yes - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$fp_done" = yes && break - done - - ac_cv_sys_pending_output_n_bytes=$ac_expr - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_pending_output_n_bytes" >&5 -$as_echo "$ac_cv_sys_pending_output_n_bytes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define PENDING_OUTPUT_N_BYTES $ac_cv_sys_pending_output_n_bytes -_ACEOF - - fi @@ -21755,8 +23231,26 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; - *) gl_cv_func_frexp_works="guessing yes";; + netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;; + mingw*) # Guess yes with MSVC, no with mingw. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Good +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Good" >/dev/null 2>&1; then : + gl_cv_func_frexp_works="guessing yes" +else + gl_cv_func_frexp_works="guessing no" +fi +rm -f conftest* + + ;; + *) gl_cv_func_frexp_works="guessing yes" ;; esac else @@ -21953,7 +23447,7 @@ else # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif -#if defined __i386__ && defined __FreeBSD__ +#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__) # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif @@ -22114,14 +23608,11 @@ $as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - REPLACE_FSTAT=1 - fi - - - if test $WINDOWS_64_BIT_ST_SIZE = 1; then - REPLACE_FSTAT=1 - fi + case "$host_os" in + mingw* | solaris*) + REPLACE_FSTAT=1 + ;; + esac @@ -22136,178 +23627,104 @@ $as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" - : - fi + case "$host_os" in + mingw*) - GNULIB_FSTAT=1 + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + ;; + esac -$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h + : + fi + GNULIB_FSTAT=1 + + + + + +$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h - if test $ac_cv_func_getdelim = yes; then - HAVE_GETDELIM=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getdelim function" >&5 -$as_echo_n "checking for working getdelim function... " >&6; } -if ${gl_cv_func_working_getdelim+:} false; then : - $as_echo_n "(cached) " >&6 -else - echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ >= 2) && !defined __UCLIBC__ - Lucky GNU user - #endif -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky GNU user" >/dev/null 2>&1; then : - gl_cv_func_working_getdelim="guessing yes" -else - gl_cv_func_working_getdelim="guessing no" -fi -rm -f conftest* + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +$as_echo_n "checking whether getdtablesize works... " >&6; } +if ${gl_cv_func_getdtablesize_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$host_os" in + vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;; + *) + if test "$cross_compiling" = yes; then : + case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -# include -# include -# include - int main () - { - FILE *in = fopen ("./conftest.data", "r"); - if (!in) - return 1; - { - /* Test result for a NULL buffer and a zero size. - Based on a test program from Karl Heuer. */ - char *line = NULL; - size_t siz = 0; - int len = getdelim (&line, &siz, '\n', in); - if (!(len == 4 && line && strcmp (line, "foo\n") == 0)) - return 2; - } - { - /* Test result for a NULL buffer and a non-zero size. - This crashes on FreeBSD 8.0. */ - char *line = NULL; - size_t siz = (size_t)(~0) / 4; - if (getdelim (&line, &siz, '\n', in) == -1) - return 3; - } - return 0; - } + #include +int +main () +{ +int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + ; + return 0; +} _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_working_getdelim=yes + gl_cv_func_getdtablesize_works=yes else - gl_cv_func_working_getdelim=no + gl_cv_func_getdtablesize_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + ;; + esac + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_getdelim" >&5 -$as_echo "$gl_cv_func_working_getdelim" >&6; } - case "$gl_cv_func_working_getdelim" in - *no) - REPLACE_GETDELIM=1 - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +$as_echo "$gl_cv_func_getdtablesize_works" >&6; } + case "$gl_cv_func_getdtablesize_works" in + *yes | "no (limitation)") ;; + *) REPLACE_GETDTABLESIZE=1 ;; esac else - HAVE_GETDELIM=0 - fi - - if test $ac_cv_have_decl_getdelim = no; then - HAVE_DECL_GETDELIM=0 - fi - - if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS getdelim.$ac_objext" - - - for ac_func in flockfile funlockfile -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl -_ACEOF - - - fi - - - - - - GNULIB_GETDELIM=1 - - - - - -$as_echo "#define GNULIB_TEST_GETDELIM 1" >>confdefs.h - - - - - - - if test $ac_cv_func_getdtablesize != yes; then HAVE_GETDTABLESIZE=0 fi - if test $HAVE_GETDTABLESIZE = 0; then + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then @@ -22342,134 +23759,33 @@ $as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h - gl_getline_needs_run_time_check=no - ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline" -if test "x$ac_cv_func_getline" = xyes; then : - gl_getline_needs_run_time_check=yes -else - am_cv_func_working_getline=no -fi - - if test $gl_getline_needs_run_time_check = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getline function" >&5 -$as_echo_n "checking for working getline function... " >&6; } -if ${am_cv_func_working_getline+:} false; then : - $as_echo_n "(cached) " >&6 -else - echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data - if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ >= 2) && !defined __UCLIBC__ - Lucky GNU user - #endif -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky GNU user" >/dev/null 2>&1; then : - am_cv_func_working_getline="guessing yes" -else - am_cv_func_working_getline="guessing no" -fi -rm -f conftest* + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 + fi -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include -# include -# include - int main () - { - FILE *in = fopen ("./conftest.data", "r"); - if (!in) - return 1; - { - /* Test result for a NULL buffer and a zero size. - Based on a test program from Karl Heuer. */ - char *line = NULL; - size_t siz = 0; - int len = getline (&line, &siz, in); - if (!(len == 4 && line && strcmp (line, "foo\n") == 0)) - return 2; - } - { - /* Test result for a NULL buffer and a non-zero size. - This crashes on FreeBSD 8.0. */ - char *line = NULL; - size_t siz = (size_t)(~0) / 4; - if (getline (&line, &siz, in) == -1) - return 3; - } - return 0; - } - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - am_cv_func_working_getline=yes -else - am_cv_func_working_getline=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + if test $REPLACE_GETOPT = 1; then -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_working_getline" >&5 -$as_echo "$am_cv_func_working_getline" >&6; } - fi - if test $ac_cv_have_decl_getline = no; then - HAVE_DECL_GETLINE=0 + if test $ac_cv_header_sys_cdefs_h = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 fi - case "$am_cv_func_working_getline" in - *no) - REPLACE_GETLINE=1 - ;; - esac - - if test $REPLACE_GETLINE = 1; then - - - - - +$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h - gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext" + GETOPT_H=getopt.h + GETOPT_CDEFS_H=getopt-cdefs.h - : fi - - - - - GNULIB_GETLINE=1 - - - - - -$as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h - - - - - - - - if test $REPLACE_GETOPT = 1; then @@ -22491,62 +23807,98 @@ $as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" - - - GNULIB_GL_UNISTD_H_GETOPT=1 fi -$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h - - - - - - - - REPLACE_GETOPT=0 - if test -n "$gl_replace_getopt"; then - REPLACE_GETOPT=1 - fi - - if test $REPLACE_GETOPT = 1; then - - GETOPT_H=getopt.h - -$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h - - - - fi - - if test $REPLACE_GETOPT = 1; then - - - - - - + ac_found=0 + ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi - gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + ac_found=1 +fi + ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + ac_found=1 +fi + ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include +" +if test "x$ac_cv_have_decl___argv" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL___ARGV $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + ac_found=1 +fi + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 +$as_echo_n "checking whether __progname is defined in default libraries... " >&6; } +if ${gl_cv_var___progname+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_var___progname= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char *__progname; +int +main () +{ +return *__progname; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_var___progname=yes - gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 +$as_echo "$gl_cv_var___progname" >&6; } + if test "$gl_cv_var___progname" = yes; then +$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h - GNULIB_GL_UNISTD_H_GETOPT=1 + fi fi @@ -22561,6 +23913,10 @@ $as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + : + + + @@ -23156,8 +24512,26 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; - *) gl_cv_func_isnanf_works="guessing yes";; + irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;; + mingw*) # Guess yes on mingw, no on MSVC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MINGW32__ + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_isnanf_works="guessing yes" +else + gl_cv_func_isnanf_works="guessing no" +fi +rm -f conftest* + + ;; + *) gl_cv_func_isnanf_works="guessing yes" ;; esac else @@ -23435,8 +24809,26 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - irix* | solaris*) gl_cv_func_isnanf_works="guessing no";; - *) gl_cv_func_isnanf_works="guessing yes";; + irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;; + mingw*) # Guess yes on mingw, no on MSVC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MINGW32__ + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_isnanf_works="guessing yes" +else + gl_cv_func_isnanf_works="guessing no" +fi +rm -f conftest* + + ;; + *) gl_cv_func_isnanf_works="guessing yes" ;; esac else @@ -23749,15 +25141,26 @@ if ${gl_cv_func_isnanl_works+:} false; then : else if test "$cross_compiling" = yes; then : - case "$host_cpu" in - # Guess no on ia64, x86_64, i386. - ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; - *) - case "$host_os" in - netbsd*) gl_cv_func_isnanl_works="guessing no";; - *) gl_cv_func_isnanl_works="guessing yes";; - esac + case "$host_os" in + mingw*) # Guess yes on mingw, no on MSVC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MINGW32__ + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_isnanl_works="guessing yes" +else + gl_cv_func_isnanl_works="guessing no" +fi +rm -f conftest* + ;; + *) gl_cv_func_isnanl_works="guessing yes" ;; esac else @@ -23818,7 +25221,7 @@ int main () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else @@ -23838,41 +25241,35 @@ int main () if (!isnanl (x.value)) result |= 2; } - /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, - Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in - Intel IA-64 Architecture Software Developer's Manual, Volume 1: - Application Architecture. - Table 5-2 "Floating-Point Register Encodings" - Figure 5-6 "Memory to Floating-Point Register Data Translation" - */ + /* isnanl should return something even for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 4; } { /* Pseudo-Infinity. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 8; } { /* Pseudo-Zero. */ static memory_long_double x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 16; } { /* Unnormalized number. */ static memory_long_double x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 32; } { /* Pseudo-Denormal. */ static memory_long_double x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 64; } #endif @@ -23924,7 +25321,7 @@ $as_echo "$gl_cv_func_isnanl_works" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 $as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } if ${gl_cv_cc_long_double_expbit0+:} false; then : $as_echo_n "(cached) " >&6 @@ -23933,6 +25330,39 @@ else if test "$cross_compiling" = yes; then : gl_cv_cc_long_double_expbit0="unknown" + case "$host_os" in + mingw*) # On native Windows (little-endian), we know the result + # in two cases: mingw, MSVC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MINGW32__ + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_cc_long_double_expbit0="word 2 bit 0" +fi +rm -f conftest* + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_cc_long_double_expbit0="word 1 bit 20" +fi +rm -f conftest* + + ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24105,15 +25535,26 @@ if ${gl_cv_func_isnanl_works+:} false; then : else if test "$cross_compiling" = yes; then : - case "$host_cpu" in - # Guess no on ia64, x86_64, i386. - ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";; - *) - case "$host_os" in - netbsd*) gl_cv_func_isnanl_works="guessing no";; - *) gl_cv_func_isnanl_works="guessing yes";; - esac + case "$host_os" in + mingw*) # Guess yes on mingw, no on MSVC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MINGW32__ + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_isnanl_works="guessing yes" +else + gl_cv_func_isnanl_works="guessing no" +fi +rm -f conftest* + ;; + *) gl_cv_func_isnanl_works="guessing yes" ;; esac else @@ -24174,7 +25615,7 @@ int main () # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ - ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else @@ -24194,41 +25635,35 @@ int main () if (!isnanl (x.value)) result |= 2; } - /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, - Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in - Intel IA-64 Architecture Software Developer's Manual, Volume 1: - Application Architecture. - Table 5-2 "Floating-Point Register Encodings" - Figure 5-6 "Memory to Floating-Point Register Data Translation" - */ + /* isnanl should return something even for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 4; } { /* Pseudo-Infinity. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 8; } { /* Pseudo-Zero. */ static memory_long_double x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 16; } { /* Unnormalized number. */ static memory_long_double x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 32; } { /* Pseudo-Denormal. */ static memory_long_double x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; - if (!isnanl (x.value)) + if (isnanl (x.value) && !isnanl (x.value)) result |= 64; } #endif @@ -24275,7 +25710,7 @@ $as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 $as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } if ${gl_cv_cc_long_double_expbit0+:} false; then : $as_echo_n "(cached) " >&6 @@ -24284,6 +25719,39 @@ else if test "$cross_compiling" = yes; then : gl_cv_cc_long_double_expbit0="unknown" + case "$host_os" in + mingw*) # On native Windows (little-endian), we know the result + # in two cases: mingw, MSVC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __MINGW32__ + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_cc_long_double_expbit0="word 2 bit 0" +fi +rm -f conftest* + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Known +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_cc_long_double_expbit0="word 1 bit 20" +fi +rm -f conftest* + + ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24389,79 +25857,6 @@ _ACEOF fi - - - - - - ac_fn_c_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" " -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be included - before . */ -#include -#include -#include -#include -#include - -" -if test "x$ac_cv_have_decl_iswblank" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISWBLANK $ac_have_decl -_ACEOF - - if test $ac_cv_func_iswblank = no; then - HAVE_ISWBLANK=0 - if test $ac_cv_have_decl_iswblank = yes; then - REPLACE_ISWBLANK=1 - fi - fi - if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then - : - else - if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then - : - fi - fi - - - if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then - : - else - if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext" - - fi - fi - - - - - - GNULIB_ISWBLANK=1 - - - - - -$as_echo "#define GNULIB_TEST_ISWBLANK 1" >>confdefs.h - - - # You need to invoke gt_JAVACOMP yourself, possibly with arguments. ac_config_files="$ac_config_files javacomp.sh:build-aux/javacomp.sh.in" @@ -24615,8 +26010,10 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; - *) gl_cv_func_ldexpl_works="guessing yes";; + aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_ldexpl_works="guessing yes" ;; + *) gl_cv_func_ldexpl_works="guessing yes" ;; esac else @@ -24720,6 +26117,7 @@ $as_echo "#define GNULIB_TEST_LDEXPL 1" >>confdefs.h + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" @@ -24727,14 +26125,167 @@ $as_echo "#define GNULIB_TEST_LDEXPL 1" >>confdefs.h if test "$gl_threads_api" = posix; then # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. + has_rwlock=false ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include " if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then : + has_rwlock=true $as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h fi + if $has_rwlock; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5 +$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; } +if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LIBS="$LIBS" + LIBS="$LIBS $LIBMULTITHREAD" + if test "$cross_compiling" = yes; then : + gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include + +#define SUCCEED() exit (0) +#define FAILURE() exit (1) +#define UNEXPECTED(n) (exit (10 + (n))) + +/* The main thread creates the waiting writer and the requesting reader threads + in the default way; this guarantees that they have the same priority. + We can reuse the main thread as first reader thread. */ + +static pthread_rwlock_t lock; +static pthread_t reader1; +static pthread_t writer; +static pthread_t reader2; +static pthread_t timer; +/* Used to pass control from writer to reader2 and from reader2 to timer, + as in a relay race. + Passing control from one running thread to another running thread + is most likely faster than to create the second thread. */ +static pthread_mutex_t baton; + +static void * +timer_func (void *ignored) +{ + /* Step 13 (can be before or after step 12): + The timer thread takes the baton, then waits a moment to make sure + it can tell whether the second reader thread is blocked at step 12. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (13); + usleep (100000); + /* By the time we get here, it's clear that the second reader thread is + blocked at step 12. This is the desired behaviour. */ + SUCCEED (); +} + +static void * +reader2_func (void *ignored) +{ + int err; + + /* Step 8 (can be before or after step 7): + The second reader thread takes the baton, then waits a moment to make sure + the writer thread has reached step 7. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (8); + usleep (100000); + /* Step 9: The second reader thread requests the lock. */ + err = pthread_rwlock_tryrdlock (&lock); + if (err == 0) + FAILURE (); + else if (err != EBUSY) + UNEXPECTED (9); + /* Step 10: Launch a timer, to test whether the next call blocks. */ + if (pthread_create (&timer, NULL, timer_func, NULL)) + UNEXPECTED (10); + /* Step 11: Release the baton. */ + if (pthread_mutex_unlock (&baton)) + UNEXPECTED (11); + /* Step 12: The second reader thread requests the lock. */ + err = pthread_rwlock_rdlock (&lock); + if (err == 0) + FAILURE (); + else + UNEXPECTED (12); +} + +static void * +writer_func (void *ignored) +{ + /* Step 4: Take the baton, so that the second reader thread does not go ahead + too early. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (4); + /* Step 5: Create the second reader thread. */ + if (pthread_create (&reader2, NULL, reader2_func, NULL)) + UNEXPECTED (5); + /* Step 6: Release the baton. */ + if (pthread_mutex_unlock (&baton)) + UNEXPECTED (6); + /* Step 7: The writer thread requests the lock. */ + if (pthread_rwlock_wrlock (&lock)) + UNEXPECTED (7); + return NULL; +} + +int +main () +{ + reader1 = pthread_self (); + + /* Step 1: The main thread initializes the lock and the baton. */ + if (pthread_rwlock_init (&lock, NULL)) + UNEXPECTED (1); + if (pthread_mutex_init (&baton, NULL)) + UNEXPECTED (1); + /* Step 2: The main thread acquires the lock as a reader. */ + if (pthread_rwlock_rdlock (&lock)) + UNEXPECTED (2); + /* Step 3: Create the writer thread. */ + if (pthread_create (&writer, NULL, writer_func, NULL)) + UNEXPECTED (3); + /* Job done. Go to sleep. */ + for (;;) + { + sleep (1); + } +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_pthread_rwlock_rdlock_prefer_writer=yes +else + gl_cv_pthread_rwlock_rdlock_prefer_writer=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5 +$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; } + case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in + *yes) + +$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h + + ;; + esac + + fi # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -24746,6 +26297,9 @@ main () #if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." +#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) +error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; @@ -24766,6 +26320,57 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +cat >>confdefs.h <<_ACEOF +#define GNULIB_LOCK 1 +_ACEOF + + + + + + + if test $ac_cv_func_lstat = yes; then + + case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in + solaris* | *no) + REPLACE_LSTAT=1 + ;; + esac + else + HAVE_LSTAT=0 + fi + + if test $REPLACE_LSTAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + + : + fi + + + + + + GNULIB_LSTAT=1 + + + + + +$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h + + + + + + for ac_header in stdlib.h @@ -24788,7 +26393,7 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* \ + *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \ | hpux* | solaris* | cygwin* | mingw*) ac_cv_func_malloc_0_nonnull=yes ;; # If we don't know, assume the worst. @@ -24807,7 +26412,10 @@ else int main () { -return ! malloc (0); +char *p = malloc (0); + int result = !p; + free (p); + return result; ; return 0; } @@ -24906,6 +26514,10 @@ $as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h + + + + if test $gl_cv_have_include_next = yes; then gl_cv_next_math_h='<'math.h'>' else @@ -24918,36 +26530,40 @@ else if test $ac_cv_header_math_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'math.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_math_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'math.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_math_h + gl_cv_next_math_h='"'$gl_header'"' else gl_cv_next_math_h='<'math.h'>' fi @@ -25088,9 +26704,6 @@ fi - - - if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then @@ -25135,7 +26748,7 @@ int main () memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) - return 1; + return 2; } return 0; } @@ -25202,7 +26815,7 @@ int main () memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) - return 1; + return 2; } return 0; } @@ -25389,7 +27002,7 @@ int main () mbrtowc (&wc, NULL, 5, &state); /* Check that wc was not modified. */ if (wc != (wchar_t) 0xBADFACE) - return 1; + return 2; } return 0; } @@ -25589,7 +27202,7 @@ int main () memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "", 1, &state) != 0) - return 1; + return 2; } return 0; } @@ -25609,6 +27222,109 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 $as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 +$as_echo_n "checking whether mbrtowc works on empty input... " >&6; } +if ${gl_cv_func_mbrtowc_empty_input+:} false; then : + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and glibc systems. + aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + static wchar_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; + } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbrtowc_empty_input=yes +else + gl_cv_func_mbrtowc_empty_input=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 +$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; } + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; } +if ${gl_cv_C_locale_sans_EILSEQ+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_C_locale_sans_EILSEQ="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +int +main () +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_C_locale_sans_EILSEQ=yes +else + gl_cv_C_locale_sans_EILSEQ=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +$as_echo "$gl_cv_C_locale_sans_EILSEQ" >&6; } + case "$gl_cv_func_mbrtowc_null_arg1" in *yes) ;; *) @@ -25641,6 +27357,22 @@ $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h REPLACE_MBRTOWC=1 ;; esac + case "$gl_cv_func_mbrtowc_empty_input" in + *yes) ;; + *) +$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +$as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac fi fi @@ -25679,21 +27411,6 @@ $as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h - GNULIB_MBSCHR=1 - - - - - -$as_echo "#define GNULIB_TEST_MBSCHR 1" >>confdefs.h - - - - - - - - @@ -25744,7 +27461,7 @@ int main () memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) - return 1; + return 2; } return 0; } @@ -25811,7 +27528,7 @@ int main () memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) - return 1; + return 2; } return 0; } @@ -25916,21 +27633,6 @@ $as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h - - GNULIB_MBSRCHR=1 - - - - - -$as_echo "#define GNULIB_TEST_MBSRCHR 1" >>confdefs.h - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbswidth is declared in " >&5 $as_echo_n "checking whether mbswidth is declared in ... " >&6; } if ${ac_cv_have_decl_mbswidth+:} false; then : @@ -26026,10 +27728,6 @@ $as_echo "#define mbstate_t int" >>confdefs.h - - : - - if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then @@ -26073,14 +27771,6 @@ $as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h - if test $ac_cv_func__set_invalid_parameter_handler = yes; then - HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 - -$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h - - else - HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 - fi if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then @@ -26096,8 +27786,6 @@ $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h fi - - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then @@ -26112,6 +27800,14 @@ $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h fi +cat >>confdefs.h <<_ACEOF +#define GNULIB_MSVC_NOTHROW 1 +_ACEOF + + + + + @@ -26123,23 +27819,26 @@ $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for obstacks" >&5 -$as_echo_n "checking for obstacks... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for obstacks that work with any size object" >&5 +$as_echo_n "checking for obstacks that work with any size object... " >&6; } if ${ac_cv_func_obstack+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default - #include "obstack.h" +#include "obstack.h" + void *obstack_chunk_alloc (size_t n) { return 0; } + void obstack_chunk_free (void *p) { } + /* Check that an internal function returns size_t, not int. */ + size_t _obstack_memory_used (struct obstack *); + int main () { struct obstack mem; - #define obstack_chunk_alloc malloc - #define obstack_chunk_free free - obstack_init (&mem); - obstack_free (&mem, 0); + obstack_init (&mem); + obstack_free (&mem, 0); + ; return 0; } @@ -26154,11 +27853,11 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_obstack" >&5 $as_echo "$ac_cv_func_obstack" >&6; } -if test $ac_cv_func_obstack = yes; then + if test "$ac_cv_func_obstack" = yes; then $as_echo "#define HAVE_OBSTACK 1" >>confdefs.h -else + else @@ -26169,7 +27868,7 @@ else gl_LIBOBJS="$gl_LIBOBJS obstack.$ac_objext" -fi + fi @@ -26221,12 +27920,16 @@ $as_echo "#define GNULIB_TEST_OBSTACK_PRINTF 1" >>confdefs.h + case "$host_os" in mingw* | pw*) REPLACE_OPEN=1 ;; *) + if test "$gl_cv_macro_O_CLOEXEC" != yes; then + REPLACE_OPEN=1 + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 $as_echo_n "checking whether open recognizes a trailing slash... " >&6; } if ${gl_cv_func_open_slash+:} false; then : @@ -26332,7 +28035,7 @@ $as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h - if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then + if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then REPLACE_PERROR=1 fi case ${gl_cv_func_strerror_r_works-unset} in @@ -26343,7 +28046,12 @@ if ${gl_cv_func_perror_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - gl_cv_func_perror_works="guessing no" + case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_func_perror_works="guessing yes" ;; + # Otherwise guess no. + *) gl_cv_func_perror_works="guessing no" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26387,9 +28095,10 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5 $as_echo "$gl_cv_func_perror_works" >&6; } - if test "$gl_cv_func_perror_works" != yes; then - REPLACE_PERROR=1 - fi + case "$gl_cv_func_perror_works" in + *yes) ;; + *) REPLACE_PERROR=1 ;; + esac ;; *) REPLACE_PERROR=1 @@ -26472,8 +28181,10 @@ else if test "$cross_compiling" = yes; then : # Guess no on Solaris, yes otherwise. case "$host_os" in - solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no";; - *) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes";; + solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; + *) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes" ;; esac else @@ -26555,6 +28266,8 @@ else # Guess no on Solaris, yes otherwise. case "$host_os" in solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";; + # Guess no on native Windows. + mingw*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no" ;; *) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing yes";; esac @@ -26637,6 +28350,8 @@ else # Guess no on Solaris, yes otherwise. case "$host_os" in solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";; + # Guess no on native Windows. + mingw*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no" ;; *) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing yes";; esac @@ -26963,8 +28678,26 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; - *) gl_cv_func_frexp_works="guessing yes";; + netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;; + mingw*) # Guess yes with MSVC, no with mingw. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _MSC_VER + Good +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Good" >/dev/null 2>&1; then : + gl_cv_func_frexp_works="guessing yes" +else + gl_cv_func_frexp_works="guessing no" +fi +rm -f conftest* + + ;; + *) gl_cv_func_frexp_works="guessing yes" ;; esac else @@ -27157,7 +28890,7 @@ else # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif -#if defined __i386__ && defined __FreeBSD__ +#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__) # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif @@ -27322,8 +29055,10 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; - *) gl_cv_func_ldexpl_works="guessing yes";; + aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_ldexpl_works="guessing yes" ;; + *) gl_cv_func_ldexpl_works="guessing yes" ;; esac else @@ -27458,7 +29193,6 @@ _ACEOF - for ac_func in raise do : ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise" @@ -27473,9 +29207,12 @@ done if test $ac_cv_func_raise = no; then HAVE_RAISE=0 else - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - REPLACE_RAISE=1 - fi + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_RAISE=1 + fi + @@ -27611,6 +29348,8 @@ $as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27631,7 +29370,21 @@ if ac_fn_c_try_compile "$LINENO"; then : SCHED_H='' else SCHED_H='sched.h' + for ac_header in sched.h +do : + ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "#if HAVE_SYS_CDEFS_H + #include + #endif + +" +if test "x$ac_cv_header_sched_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SCHED_H 1 +_ACEOF + +fi +done @@ -27650,42 +29403,40 @@ if ${gl_cv_next_sched_h+:} false; then : $as_echo_n "(cached) " >&6 else - if test $ac_cv_header_sched_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'sched.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_sched_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' - else - gl_cv_next_sched_h='<'sched.h'>' - fi + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sched.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sched_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sched_h + gl_cv_next_sched_h='"'$gl_header'"' fi @@ -27707,14 +29458,19 @@ $as_echo "$gl_cv_next_sched_h" >&6; } - if test $ac_cv_header_sched_h = yes; then + if test "$ac_cv_header_sched_h" = yes; then HAVE_SCHED_H=1 else HAVE_SCHED_H=0 fi - ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include + if test "$HAVE_SCHED_H" = 1; then + ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#if HAVE_SYS_CDEFS_H + #include + #endif + #include + " if test "x$ac_cv_type_struct_sched_param" = xyes; then : HAVE_STRUCT_SCHED_PARAM=1 @@ -27722,6 +29478,34 @@ else HAVE_STRUCT_SCHED_PARAM=0 fi + else + HAVE_STRUCT_SCHED_PARAM=0 + case "$host_os" in + os2*) + ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include +" +if test "x$ac_cv_type_struct_sched_param" = xyes; then : + HAVE_STRUCT_SCHED_PARAM=1 +fi + + ;; + vms) + ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include +" +if test "x$ac_cv_type_struct_sched_param" = xyes; then : + HAVE_STRUCT_SCHED_PARAM=1 +fi + + ;; + esac + fi + + + if test "$ac_cv_header_sys_cdefs_h" = yes; then + HAVE_SYS_CDEFS_H=1 + else + HAVE_SYS_CDEFS_H=0 + fi @@ -27830,36 +29614,40 @@ if ${gl_cv_next_signal_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'signal.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' - gl_header_literal_regex=`echo 'signal.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_signal_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_signal_h + gl_cv_next_signal_h='"'$gl_header'"' fi @@ -27961,10 +29749,12 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_signbit="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_signbit="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_signbit="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_signbit="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_signbit="guessing no" ;; esac else @@ -28079,10 +29869,17 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_signbit_gcc="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_signbit_gcc="guessing yes" ;; + # Guess yes on mingw, no on MSVC. + mingw*) if test -n "$GCC"; then + gl_cv_func_signbit_gcc="guessing yes" + else + gl_cv_func_signbit_gcc="guessing no" + fi + ;; + # If we don't know, assume the worst. + *) gl_cv_func_signbit_gcc="guessing no" ;; esac else @@ -28235,6 +30032,7 @@ int main () { /* More than one bit difference. */ fprintf (fp, "unknown"); + fclose (fp); return 2; } if (x) @@ -28247,6 +30045,7 @@ int main () { /* No difference. */ fprintf (fp, "unknown"); + fclose (fp); return 3; } /* Now m = plus.word[k] ^ ~minus.word[k]. */ @@ -28255,6 +30054,7 @@ int main () /* Oh? The sign bit is set in the positive and cleared in the negative numbers? */ fprintf (fp, "unknown"); + fclose (fp); return 4; } for (i = 0; ; i++) @@ -28339,6 +30139,7 @@ int main () { /* More than one bit difference. */ fprintf (fp, "unknown"); + fclose (fp); return 2; } if (x) @@ -28351,6 +30152,7 @@ int main () { /* No difference. */ fprintf (fp, "unknown"); + fclose (fp); return 3; } /* Now m = plus.word[k] ^ ~minus.word[k]. */ @@ -28359,6 +30161,7 @@ int main () /* Oh? The sign bit is set in the positive and cleared in the negative numbers? */ fprintf (fp, "unknown"); + fclose (fp); return 4; } for (i = 0; ; i++) @@ -28443,6 +30246,7 @@ int main () { /* More than one bit difference. */ fprintf (fp, "unknown"); + fclose (fp); return 2; } if (x) @@ -28455,6 +30259,7 @@ int main () { /* No difference. */ fprintf (fp, "unknown"); + fclose (fp); return 3; } /* Now m = plus.word[k] ^ ~minus.word[k]. */ @@ -28463,6 +30268,7 @@ int main () /* Oh? The sign bit is set in the positive and cleared in the negative numbers? */ fprintf (fp, "unknown"); + fclose (fp); return 4; } for (i = 0; ; i++) @@ -28871,7 +30677,12 @@ if ${gl_cv_func_snprintf_size1+:} false; then : else if test "$cross_compiling" = yes; then : - gl_cv_func_snprintf_size1="guessing yes" + case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_func_snprintf_size1="guessing yes" ;; + *) gl_cv_func_snprintf_size1="guessing yes" ;; + esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28931,6 +30742,7 @@ else netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) gl_cv_func_printf_positions="guessing no";; beos*) gl_cv_func_printf_positions="guessing no";; + # Guess no on native Windows. mingw* | pw*) gl_cv_func_printf_positions="guessing no";; *) gl_cv_func_printf_positions="guessing yes";; esac @@ -28990,6 +30802,11 @@ $as_echo "$gl_cv_func_printf_positions" >&6; } if test $ac_cv_func_snprintf = yes; then REPLACE_SNPRINTF=1 + else + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi fi : @@ -29062,9 +30879,9 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; @@ -29094,6 +30911,8 @@ else netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess no on native Windows. + mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";; # If we don't know, assume the worst. *) gl_cv_func_snprintf_truncation_c99="guessing no";; esac @@ -29156,9 +30975,9 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; + *-gnu* | gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; @@ -29181,6 +31000,8 @@ else netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess no on native Windows. + mingw*) gl_cv_func_snprintf_directive_n="guessing no";; # If we don't know, assume the worst. *) gl_cv_func_snprintf_directive_n="guessing no";; esac @@ -29244,7 +31065,12 @@ if ${gl_cv_func_snprintf_size1+:} false; then : else if test "$cross_compiling" = yes; then : - gl_cv_func_snprintf_size1="guessing yes" + case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_func_snprintf_size1="guessing yes" ;; + *) gl_cv_func_snprintf_size1="guessing yes" ;; + esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -29297,9 +31123,9 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; @@ -29321,7 +31147,7 @@ else netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on mingw. + # Guess yes on native Windows. mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; @@ -29681,6 +31507,11 @@ fi if test $ac_cv_func_snprintf = yes; then REPLACE_SNPRINTF=1 + else + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi fi : @@ -29710,36 +31541,40 @@ else if test $ac_cv_header_spawn_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'spawn.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_spawn_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'spawn.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_spawn_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_spawn_h + gl_cv_next_spawn_h='"'$gl_header'"' else gl_cv_next_spawn_h='<'spawn.h'>' fi @@ -30222,58 +32057,29 @@ $as_echo "#define ssize_t int" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5 -$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; } -if ${gl_cv_func_stat_dir_slash+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - case $host_os in - mingw*) gl_cv_func_stat_dir_slash="guessing no";; - *) gl_cv_func_stat_dir_slash="guessing yes";; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -struct stat st; return stat (".", &st) != stat ("./", &st); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_stat_dir_slash=yes -else - gl_cv_func_stat_dir_slash=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5 -$as_echo "$gl_cv_func_stat_dir_slash" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 + case "$host_os" in + mingw*) + REPLACE_STAT=1 + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 $as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } if ${gl_cv_func_stat_file_slash+:} false; then : $as_echo_n "(cached) " >&6 else touch conftest.tmp - # Assume that if we have lstat, we can also check symlinks. - if test $ac_cv_func_lstat = yes; then - ln -s conftest.tmp conftest.lnk - fi - if test "$cross_compiling" = yes; then : + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_stat_file_slash="guessing no" ;; - esac + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30284,14 +32090,14 @@ int main () { int result = 0; - struct stat st; - if (!stat ("conftest.tmp/", &st)) - result |= 1; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; #if HAVE_LSTAT - if (!stat ("conftest.lnk/", &st)) - result |= 2; + if (!stat ("conftest.lnk/", &st)) + result |= 2; #endif - return result; + return result; ; return 0; @@ -30306,21 +32112,22 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - rm -f conftest.tmp conftest.lnk + rm -f conftest.tmp conftest.lnk fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 $as_echo "$gl_cv_func_stat_file_slash" >&6; } - case $gl_cv_func_stat_dir_slash in - *no) REPLACE_STAT=1 - -$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h -;; - esac - case $gl_cv_func_stat_file_slash in - *no) REPLACE_STAT=1 + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 $as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h ;; + esac + case $host_os in + solaris*) + REPLACE_FSTAT=1 ;; + esac + ;; esac if test $REPLACE_STAT = 1; then @@ -30334,7 +32141,24 @@ $as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" - : + case "$host_os" in + mingw*) + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + ;; + esac + + + : + fi @@ -30354,6 +32178,144 @@ $as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h + + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 +$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; } +if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_SYS_TIME_H + # include + #endif + #include + struct timespec ts; + struct stat st; + +int +main () +{ + + st.st_atim = ts; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes +else + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 +$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + +$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h + + fi +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 +_ACEOF + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 +_ACEOF + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1 +_ACEOF + + +fi + +fi + +fi + +fi + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1 +_ACEOF + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1 +_ACEOF + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1 +_ACEOF + + +fi + +fi + +fi + + + + + # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then @@ -30382,6 +32344,15 @@ fi STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include + +" +if test "x$ac_cv_type_max_align_t" = xyes; then : + +else + HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h +fi + if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h @@ -30444,36 +32415,40 @@ if ${gl_cv_next_stddef_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` - gl_header_literal_regex=`echo 'stddef.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' fi @@ -30499,6 +32474,9 @@ $as_echo "$gl_cv_next_stddef_h" >&6; } + $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h + + @@ -30516,36 +32494,40 @@ if ${gl_cv_next_stdio_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdio.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' - gl_header_literal_regex=`echo 'stdio.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_stdio_h + gl_cv_next_stdio_h='"'$gl_header'"' fi @@ -30567,6 +32549,48 @@ $as_echo "$gl_cv_next_stdio_h" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 +$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; } +if ${gl_cv_func_printf_attribute_flavor+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define __STDC_FORMAT_MACROS 1 + #include + #include + /* For non-mingw systems, compilation will trivially succeed. + For mingw, compilation will succeed for older mingw (system + printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ + #if (defined _WIN32 && ! defined __CYGWIN__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_printf_attribute_flavor=system +else + gl_cv_func_printf_attribute_flavor=gnu +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 +$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; } + if test "$gl_cv_func_printf_attribute_flavor" = gnu; then + +$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h + + fi + GNULIB_FSCANF=1 @@ -30663,36 +32687,40 @@ if ${gl_cv_next_stdlib_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stdlib.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` - gl_header_literal_regex=`echo 'stdlib.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + gl_header=$gl_cv_absolute_stdlib_h + gl_cv_next_stdlib_h='"'$gl_header'"' fi @@ -30715,7 +32743,7 @@ $as_echo "$gl_cv_next_stdlib_h" >&6; } - for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } @@ -30726,6 +32754,9 @@ else /* end confdefs.h. */ #include #if HAVE_SYS_LOADAVG_H +/* OpenIndiana has a bug: must be included before + . */ +# include # include #endif #if HAVE_RANDOM_H @@ -30978,10 +33009,10 @@ if ${gl_cv_func_working_strerror+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_working_strerror="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; esac else @@ -31159,6 +33190,13 @@ $as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define GNULIB_STRERROR_R_POSIX 1 +_ACEOF + + + + @@ -31202,11 +33240,14 @@ main () #endif char *strndup (const char *, size_t); #endif + int result; char *s; s = strndup ("some longer string", 15); free (s); s = strndup ("shorter string", 13); - return s[13] != '\0'; + result = s[13] != '\0'; + free (s); + return result; ; return 0; } @@ -31354,31 +33395,6 @@ $as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h - for ac_func in strtoul -do : - ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" -if test "x$ac_cv_func_strtoul" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOUL 1 -_ACEOF - -fi -done - - - if test $ac_cv_func_strtoul = no; then - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS strtoul.$ac_objext" - - fi - @@ -31453,36 +33469,40 @@ else if test $ac_cv_header_sys_stat_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'sys/stat.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/stat.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_stat_h + gl_cv_next_sys_stat_h='"'$gl_header'"' else gl_cv_next_sys_stat_h='<'sys/stat.h'>' fi @@ -31510,14 +33530,14 @@ $as_echo "$gl_cv_next_sys_stat_h" >&6; } + WINDOWS_STAT_TIMESPEC=0 + + - if test $WINDOWS_64_BIT_ST_SIZE = 1; then -$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h - fi ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include #include @@ -31599,36 +33619,40 @@ else if test $ac_cv_header_sys_wait_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'sys/wait.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_sys_wait_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/wait.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_wait_h + gl_cv_next_sys_wait_h='"'$gl_header'"' else gl_cv_next_sys_wait_h='<'sys/wait.h'>' fi @@ -31727,36 +33751,40 @@ else if test $ac_cv_header_unistd_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'unistd.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'unistd.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_unistd_h + gl_cv_next_unistd_h='"'$gl_header'"' else gl_cv_next_unistd_h='<'unistd.h'>' fi @@ -31792,7 +33820,7 @@ $as_echo "$gl_cv_next_unistd_h" >&6; } - for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r unlink unlinkat usleep; do + for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep; do as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } @@ -31810,7 +33838,7 @@ else # include # include # include -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ # include # endif #endif @@ -31858,7 +33886,7 @@ fi || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ - && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 } } } @@ -31885,7 +33913,7 @@ fi || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ - && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0 + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 } } } @@ -31912,7 +33940,7 @@ fi || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ - && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4 + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 8 } } } @@ -31932,6 +33960,190 @@ fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink honors trailing slashes" >&5 +$as_echo_n "checking whether unlink honors trailing slashes... " >&6; } +if ${gl_cv_func_unlink_honors_slashes+:} false; then : + $as_echo_n "(cached) " >&6 +else + touch conftest.file + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.file conftest.lnk + fi + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_unlink_honors_slashes="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unlink_honors_slashes="guessing no" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + #endif + #include + +int +main () +{ +int result = 0; + if (!unlink ("conftest.file/")) + result |= 1; + else if (errno != ENOTDIR) + result |= 2; +#if HAVE_LSTAT + if (!unlink ("conftest.lnk/")) + result |= 4; + else if (errno != ENOTDIR) + result |= 8; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_unlink_honors_slashes=yes +else + gl_cv_func_unlink_honors_slashes=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.file conftest.lnk +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_honors_slashes" >&5 +$as_echo "$gl_cv_func_unlink_honors_slashes" >&6; } + case "$gl_cv_func_unlink_honors_slashes" in + *no) + REPLACE_UNLINK=1 + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink of a parent directory fails as it should" >&5 +$as_echo_n "checking whether unlink of a parent directory fails as it should... " >&6; } +if ${gl_cv_func_unlink_parent_fails+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$host_os" in + darwin*) + if { + # Use the mktemp program if available. If not available, hide the error + # message. + tmp=`(umask 077 && mktemp -d /tmp/gtXXXXXX) 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" + } || + { + # Use a simple mkdir command. It is guaranteed to fail if the directory + # already exists. $RANDOM is bash specific and expands to empty in shells + # other than bash, ksh and zsh. Its use does not increase security; + # rather, it minimizes the probability of failure in a very cluttered /tmp + # directory. + tmp=/tmp/gt$$-$RANDOM + (umask 077 && mkdir "$tmp") + }; then + mkdir "$tmp/subdir" + GL_SUBDIR_FOR_UNLINK="$tmp/subdir" + export GL_SUBDIR_FOR_UNLINK + if test "$cross_compiling" = yes; then : + # If we don't know, assume the worst. + gl_cv_func_unlink_parent_fails="guessing no" + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + #endif + int main () + { + int result = 0; + if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0) + result |= 1; + else if (unlink ("..") == 0) + result |= 2; + return result; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_unlink_parent_fails=yes +else + gl_cv_func_unlink_parent_fails=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + unset GL_SUBDIR_FOR_UNLINK + rm -rf "$tmp" + else + gl_cv_func_unlink_parent_fails="guessing no" + fi + ;; + *) + gl_cv_func_unlink_parent_fails="guessing yes" + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_parent_fails" >&5 +$as_echo "$gl_cv_func_unlink_parent_fails" >&6; } + case "$gl_cv_func_unlink_parent_fails" in + *no) + REPLACE_UNLINK=1 + +$as_echo "#define UNLINK_PARENT_BUG 1" >>confdefs.h + + ;; + esac + + if test $REPLACE_UNLINK = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS unlink.$ac_objext" + + fi + + + + + + GNULIB_UNLINK=1 + + + + + +$as_echo "#define GNULIB_TEST_UNLINK 1" >>confdefs.h + + + + + $as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h @@ -32547,7 +34759,12 @@ if ${gl_cv_func_snprintf_size1+:} false; then : else if test "$cross_compiling" = yes; then : - gl_cv_func_snprintf_size1="guessing yes" + case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_func_snprintf_size1="guessing yes" ;; + *) gl_cv_func_snprintf_size1="guessing yes" ;; + esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32607,6 +34824,7 @@ else netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) gl_cv_func_printf_positions="guessing no";; beos*) gl_cv_func_printf_positions="guessing no";; + # Guess no on native Windows. mingw* | pw*) gl_cv_func_printf_positions="guessing no";; *) gl_cv_func_printf_positions="guessing yes";; esac @@ -32666,6 +34884,11 @@ $as_echo "$gl_cv_func_printf_positions" >&6; } if test $ac_cv_func_vsnprintf = yes; then REPLACE_VSNPRINTF=1 + else + + if test $ac_cv_have_decl_vsnprintf = yes; then + REPLACE_VSNPRINTF=1 + fi fi : @@ -32731,9 +34954,9 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; @@ -32763,6 +34986,8 @@ else netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess no on native Windows. + mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";; # If we don't know, assume the worst. *) gl_cv_func_snprintf_truncation_c99="guessing no";; esac @@ -32825,9 +35050,9 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; + *-gnu* | gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; @@ -32850,6 +35075,8 @@ else netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess no on native Windows. + mingw*) gl_cv_func_snprintf_directive_n="guessing no";; # If we don't know, assume the worst. *) gl_cv_func_snprintf_directive_n="guessing no";; esac @@ -32913,7 +35140,12 @@ if ${gl_cv_func_snprintf_size1+:} false; then : else if test "$cross_compiling" = yes; then : - gl_cv_func_snprintf_size1="guessing yes" + case "$host_os" in + # Guess yes on native Windows. + mingw*) gl_cv_func_snprintf_size1="guessing yes" ;; + *) gl_cv_func_snprintf_size1="guessing yes" ;; + esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -32966,9 +35198,9 @@ else case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; @@ -32990,7 +35222,7 @@ else netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on mingw. + # Guess yes on native Windows. mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; @@ -33350,6 +35582,11 @@ fi if test $ac_cv_func_vsnprintf = yes; then REPLACE_VSNPRINTF=1 + else + + if test $ac_cv_have_decl_vsnprintf = yes; then + REPLACE_VSNPRINTF=1 + fi fi : @@ -33758,36 +35995,40 @@ else if test $ac_cv_header_wchar_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'wchar.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wchar.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wchar_h + gl_cv_next_wchar_h='"'$gl_header'"' else gl_cv_next_wchar_h='<'wchar.h'>' fi @@ -33829,7 +36070,9 @@ $as_echo "$gl_cv_next_wchar_h" >&6; } - for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth ; do + + + for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ; do as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } @@ -33908,6 +36151,8 @@ fi + + if test $gl_cv_have_include_next = yes; then gl_cv_next_wctype_h='<'wctype.h'>' else @@ -33920,36 +36165,40 @@ else if test $ac_cv_header_wctype_h = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - - gl_header_literal_regex=`echo 'wctype.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"`'"' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' else gl_cv_next_wctype_h='<'wctype.h'>' fi @@ -33982,7 +36231,7 @@ if ${gl_cv_func_iswcntrl_works+:} false; then : else if test "$cross_compiling" = yes; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if __GNU_LIBRARY__ == 1 @@ -34274,9 +36523,37 @@ _ACEOF HAVE_DECL_WCWIDTH=0 fi - if test $ac_cv_func_wcwidth = yes; then + if test $ac_cv_func_wcwidth != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth is a macro" >&5 +$as_echo_n "checking whether wcwidth is a macro... " >&6; } +if ${gl_cv_func_wcwidth_macro+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef wcwidth + wchar_header_defines_wcwidth +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "wchar_header_defines_wcwidth" >/dev/null 2>&1; then : + gl_cv_func_wcwidth_macro=yes +else + gl_cv_func_wcwidth_macro=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_macro" >&5 +$as_echo "$gl_cv_func_wcwidth_macro" >&6; } + fi + + if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes; then HAVE_WCWIDTH=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 $as_echo_n "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } if ${gl_cv_func_wcwidth_works+:} false; then : $as_echo_n "(cached) " >&6 @@ -34285,9 +36562,9 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc and AIX 7 systems. - *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; - *) gl_cv_func_wcwidth_works="guessing no";; + # Guess yes on glibc and AIX 7 systems. + *-gnu* | gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; esac else @@ -34323,6 +36600,8 @@ int main () result |= 2; if (wcwidth (0x200B) > 0) result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; } return result; } @@ -34666,7 +36945,7 @@ $as_echo "$USE_NLS" >&6; } - GETTEXT_MACRO_VERSION=0.18 + GETTEXT_MACRO_VERSION=0.19 @@ -34995,7 +37274,7 @@ if test "${with_libiconv_prefix+set}" = set; then : additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then + && test ! -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi @@ -35556,16 +37835,21 @@ else /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -35685,36 +37969,42 @@ else if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - if test "$cross_compiling" = yes; then : - - case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac - + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes; then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -int main () + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main () { - int result = 0; +int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\342\202\254"; /* EURO SIGN */ + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; @@ -35727,14 +38017,14 @@ int main () iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\263"; + static ICONV_CONST char input[] = "\263"; char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; @@ -35746,14 +38036,14 @@ int main () iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304"; + static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; @@ -35766,14 +38056,14 @@ int main () iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; @@ -35783,27 +38073,42 @@ int main () #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ - if (/* Try standardized names. */ - iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) - /* Try IRIX, OSF/1 names. */ - && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) - /* Try AIX names. */ - && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) - /* Try HP-UX names. */ - && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - result |= 16; + { + /* Try standardized names. */ + iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); + /* Try IRIX, OSF/1 names. */ + iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); + /* Try AIX names. */ + iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); + /* Try HP-UX names. */ + iconv_t cd4 = iconv_open ("utf8", "eucJP"); + if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) + && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) + result |= 16; + if (cd1 != (iconv_t)(-1)) + iconv_close (cd1); + if (cd2 != (iconv_t)(-1)) + iconv_close (cd2); + if (cd3 != (iconv_t)(-1)) + iconv_close (cd3); + if (cd4 != (iconv_t)(-1)) + iconv_close (cd4); + } return result; + + ; + return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes -else - am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + test "$am_cv_func_iconv_works" = no || break + done LIBS="$am_save_LIBS" fi @@ -35879,7 +38184,7 @@ if test "${with_libintl_prefix+set}" = set; then : additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then + && test ! -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi @@ -36309,20 +38614,25 @@ else /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -36341,20 +38651,25 @@ rm -f core conftest.err conftest.$ac_objext \ /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -36522,10 +38837,11 @@ ac_config_files="$ac_config_files etc/bench.pl" # Initialize the test suite. ac_config_commands="$ac_config_commands tests/atconfig" -ac_config_files="$ac_config_files tests/Makefile tests/atlocal" +ac_config_files="$ac_config_files tests/atlocal" ac_config_files="$ac_config_files tests/bison" + for ac_prog in valgrind do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -36568,236 +38884,36 @@ fi test -n "$VALGRIND" && break done -case $VALGRIND:$host_os in +# Use something simpler that $host_os to select our suppression file. +uname=`uname` +case $VALGRIND:$uname in '':*) ;; - *:darwin*) + *:Darwin) # See README-hacking. - # VALGRIND+=' --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind' VALGRIND=;; *:*) - VALGRIND_PREBISON="$VALGRIND -q" -;; -esac - - -AUTOM4TE=${AUTOM4TE-"${am_missing_run}autom4te"} - -# Needed by tests/atlocal.in. - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Java virtual machine" >&5 -$as_echo_n "checking for Java virtual machine... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - CLASSPATH_SEPARATOR=';' -else - CLASSPATH_SEPARATOR=':' -fi -rm -f conftest* - - CONF_JAVA= - HAVE_JAVA_ENVVAR= - HAVE_GIJ= - HAVE_JAVA= - HAVE_JRE= - HAVE_JVIEW= - HAVE_JAVAEXEC=1 - if test -n "$JAVA"; then - HAVE_JAVA_ENVVAR=1 - CONF_JAVA="$JAVA" - else - # Extract the first word of "gij", so it can be a program name with args. -set dummy gij; ac_word=$2 -: -if ${ac_cv_prog_HAVE_GIJ_IN_PATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$HAVE_GIJ_IN_PATH"; then - ac_cv_prog_HAVE_GIJ_IN_PATH="$HAVE_GIJ_IN_PATH" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_HAVE_GIJ_IN_PATH="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -HAVE_GIJ_IN_PATH=$ac_cv_prog_HAVE_GIJ_IN_PATH -if test -n "$HAVE_GIJ_IN_PATH"; then - : -else - : -fi - - - # Extract the first word of "java", so it can be a program name with args. -set dummy java; ac_word=$2 -: -if ${ac_cv_prog_HAVE_JAVA_IN_PATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$HAVE_JAVA_IN_PATH"; then - ac_cv_prog_HAVE_JAVA_IN_PATH="$HAVE_JAVA_IN_PATH" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_HAVE_JAVA_IN_PATH="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -HAVE_JAVA_IN_PATH=$ac_cv_prog_HAVE_JAVA_IN_PATH -if test -n "$HAVE_JAVA_IN_PATH"; then - : -else - : -fi - - - # Extract the first word of "jre", so it can be a program name with args. -set dummy jre; ac_word=$2 -: -if ${ac_cv_prog_HAVE_JRE_IN_PATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$HAVE_JRE_IN_PATH"; then - ac_cv_prog_HAVE_JRE_IN_PATH="$HAVE_JRE_IN_PATH" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_HAVE_JRE_IN_PATH="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -HAVE_JRE_IN_PATH=$ac_cv_prog_HAVE_JRE_IN_PATH -if test -n "$HAVE_JRE_IN_PATH"; then - : -else - : -fi - + suppfile=build-aux/$uname.valgrind + if test -f "$srcdir/$suppfile"; then + VALGRIND_OPTS_SUPPRESSION="--suppressions=\$(abs_top_srcdir)/$suppfile" - # Extract the first word of "jview", so it can be a program name with args. -set dummy jview; ac_word=$2 -: -if ${ac_cv_prog_HAVE_JVIEW_IN_PATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$HAVE_JVIEW_IN_PATH"; then - ac_cv_prog_HAVE_JVIEW_IN_PATH="$HAVE_JVIEW_IN_PATH" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_HAVE_JVIEW_IN_PATH="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + fi + ;; +esac -fi -fi -HAVE_JVIEW_IN_PATH=$ac_cv_prog_HAVE_JVIEW_IN_PATH -if test -n "$HAVE_JVIEW_IN_PATH"; then - : +# Whether we cannot run the compiled bison. + if test "$cross_compiling" = yes; then + CROSS_COMPILING_TRUE= + CROSS_COMPILING_FALSE='#' else - : + CROSS_COMPILING_TRUE='#' + CROSS_COMPILING_FALSE= fi - export CLASSPATH - if test -n "$HAVE_GIJ_IN_PATH" \ - && gij --version >/dev/null 2>/dev/null \ - ; then - HAVE_GIJ=1 - CONF_JAVA="gij" - else - if test -n "$HAVE_JAVA_IN_PATH" \ - && java -version >/dev/null 2>/dev/null \ - ; then - HAVE_JAVA=1 - CONF_JAVA="java" - else - if test -n "$HAVE_JRE_IN_PATH" \ - && (jre >/dev/null 2>/dev/null || test $? = 1) \ - ; then - HAVE_JRE=1 - CONF_JAVA="jre" - else - if test -n "$HAVE_JVIEW_IN_PATH" \ - && (jview -? >/dev/null 2>/dev/null || test $? = 1) \ - ; then - HAVE_JVIEW=1 - CONF_JAVA="jview" - else - HAVE_JAVAEXEC= - fi - fi - fi - fi - - fi - if test -n "$HAVE_JAVAEXEC"; then - ac_result="$CONF_JAVA" - else - ac_result="no" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_result" >&5 -$as_echo "$ac_result" >&6; } - - - - - - +AUTOM4TE=${AUTOM4TE-"${am_missing_run}autom4te"} +# Needed by tests/atlocal.in. @@ -36805,7 +38921,7 @@ $as_echo "$ac_result" >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ +#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ yes #endif @@ -36822,41 +38938,21 @@ rm -f conftest* test -n "$source_version" || { as_fn_error $? "missing source-version argument to gt_JAVACOMP" "$LINENO" 5 } - if test -n "$HAVE_JAVAEXEC"; then - cat > conftestver.java <"!=fYpYJmkb_ece_YnejiJpblmeji/!?!@)!A/!B!C"!._jicnbmnpbl"!3fYpYKgYidKSZfb_n"!3fYpYKgYidKUqmnbh"!$jon"!8QfYpYKejKTleinUnlbYhL"!.dbnTljkblnq"!EFQfYpYKgYidKUnleidLGQfYpYKgYidKUnleidL"!6fYpYKejKTleinUnlbYh"!)kleingi"!8FQfYpYKgYidKUnleidLGW!D!(!)!!!!!#!"!*!+!"!,!!!@!"!"!!!&Hu!"r!!!"!.!!!(!"!!!"!+!/!0!"!,!!!F!#!"!!!/s!#5$v!%t!&r!!!"!.!!!,!#!!!$!.!%!"!1!!!#!2' \ - | tr -d '\012\015' \ - | tr '!"#$%&()*+,./0123456789:;<=>?@ABCDEFGHJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzI' '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\046\050\051\052\056\057\073\074\076\103\106\114\116\117\120\123\124\126\133\141\142\143\144\145\146\147\151\152\154\155\156\157\160\162\163\164\165\166\171\261\262\266\267\270\272\276\312\376\055' \ - > conftestver.class - target_version=`{ - unset JAVA_HOME - echo "$as_me:36839: CLASSPATH=.${CLASSPATH:+$CLASSPATH_SEPARATOR$CLASSPATH} $CONF_JAVA conftestver" >&5 - CLASSPATH=.${CLASSPATH:+$CLASSPATH_SEPARATOR$CLASSPATH} $CONF_JAVA conftestver 2>&5 - }` - case "$target_version" in - 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6) ;; - null) - target_version=1.1 ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown target-version $target_version, please update gt_JAVACOMP macro" >&5 -$as_echo "$as_me: WARNING: unknown target-version $target_version, please update gt_JAVACOMP macro" >&2;} - target_version=1.1 ;; - esac - else - target_version="1.1" - fi - + target_version=1.4 case "$source_version" in 1.3) goodcode='class conftest {}' failcode='class conftestfail { static { assert(true); } }' ;; 1.4) goodcode='class conftest { static { assert(true); } }' failcode='class conftestfail { T foo() { return null; } }' ;; 1.5) goodcode='class conftest { T foo() { return null; } }' + failcode='class conftestfail { void foo () { switch ("A") {} } }' ;; + 1.7) goodcode='class conftest { void foo () { switch ("A") {} } }' + failcode='class conftestfail { void foo () { Runnable r = () -> {}; } }' ;; + 1.8) goodcode='class conftest { void foo () { Runnable r = () -> {}; } }' + failcode='interface conftestfail { private void foo () {} }' ;; + 9) goodcode='interface conftest { private void foo () {} }' + failcode='class conftestfail { public void m() { var i = new Integer(0); } }' ;; + 10) goodcode='class conftest { public void m() { var i = new Integer(0); } }' failcode='class conftestfail syntax error' ;; *) as_fn_error $? "invalid source-version argument to gt_JAVACOMP: $source_version" "$LINENO" 5 ;; esac @@ -36867,6 +38963,10 @@ $as_echo "$as_me: WARNING: unknown target-version $target_version, please update 1.4) cfversion=48 ;; 1.5) cfversion=49 ;; 1.6) cfversion=50 ;; + 1.7) cfversion=51 ;; + 1.8) cfversion=52 ;; + 9) cfversion=53 ;; + 10) cfversion=54 ;; *) as_fn_error $? "invalid target-version argument to gt_JAVACOMP: $target_version" "$LINENO" 5 ;; esac # Function to output the classfile version of a file (8th byte) in decimal. @@ -36886,7 +38986,7 @@ $as_echo "$as_me: WARNING: unknown target-version $target_version, please update fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Java compiler" >&5 $as_echo_n "checking for Java compiler... " >&6; } - CONF_JAVAC= + CONF_JAVAC= HAVE_JAVAC_ENVVAR= HAVE_GCJ_C= HAVE_JAVAC= @@ -36904,23 +39004,23 @@ EOF if $JAVAC --version 2>/dev/null | sed -e 1q | grep gcj > /dev/null; then if $JAVAC --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^4\.[012]/d' | grep '^[4-9]' >/dev/null; then rm -f conftest.class - if { echo "$as_me:36907: $JAVAC -d . conftest.java" >&5 + if { echo "$as_me:39007: $JAVAC -d . conftest.java" >&5 $JAVAC -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then rm -f conftest.class rm -f conftestfail.class - if { echo "$as_me:36914: $JAVAC -fsource=$source_version -d . conftest.java" >&5 + if { echo "$as_me:39014: $JAVAC -fsource=$source_version -d . conftest.java" >&5 $JAVAC -fsource="$source_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ - && { echo "$as_me:36919: $JAVAC -d . conftestfail.java" >&5 + && { echo "$as_me:39019: $JAVAC -d . conftestfail.java" >&5 $JAVAC -d . conftestfail.java >&5 2>&1 } \ && test -f conftestfail.class \ - && ! { echo "$as_me:36923: $JAVAC -fsource=$source_version -d . conftestfail.java" >&5 + && ! { echo "$as_me:39023: $JAVAC -fsource=$source_version -d . conftestfail.java" >&5 $JAVAC -fsource="$source_version" -d . conftestfail.java >&5 2>&1 }; then CONF_JAVAC="$JAVAC -fsource=$source_version" @@ -36934,7 +39034,7 @@ EOF else rm -f conftest.class rm -f conftestfail.class - if { echo "$as_me:36937: $JAVAC -fsource=$source_version -ftarget=$target_version -d . conftest.java" >&5 + if { echo "$as_me:39037: $JAVAC -fsource=$source_version -ftarget=$target_version -d . conftest.java" >&5 $JAVAC -fsource="$source_version" -ftarget="$target_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ @@ -36947,7 +39047,7 @@ EOF else if test "$target_version" = 1.4 && test "$source_version" = 1.4; then rm -f conftest.class - if { echo "$as_me:36950: $JAVAC -d . conftest.java" >&5 + if { echo "$as_me:39050: $JAVAC -d . conftest.java" >&5 $JAVAC -d . conftest.java >&5 2>&1 } \ && test -f conftest.class; then @@ -36959,7 +39059,7 @@ EOF if test "$target_version" = 1.4 && test "$source_version" = 1.3; then javac_works= rm -f conftest.class - if { echo "$as_me:36962: $JAVAC -d . conftest.java" >&5 + if { echo "$as_me:39062: $JAVAC -d . conftest.java" >&5 $JAVAC -d . conftest.java >&5 2>&1 } \ && test -f conftest.class; then @@ -36967,7 +39067,7 @@ EOF fi javac_noassert_works= rm -f conftest.class - if { echo "$as_me:36970: $JAVAC -fno-assert -d . conftest.java" >&5 + if { echo "$as_me:39070: $JAVAC -fno-assert -d . conftest.java" >&5 $JAVAC -fno-assert -d . conftest.java >&5 2>&1 } \ && test -f conftest.class; then @@ -36975,11 +39075,11 @@ EOF fi if test -n "$javac_works" && test -n "$javac_noassert_works"; then rm -f conftestfail.class - if { echo "$as_me:36978: $JAVAC -d . conftestfail.java" >&5 + if { echo "$as_me:39078: $JAVAC -d . conftestfail.java" >&5 $JAVAC -d . conftestfail.java >&5 2>&1 } \ && test -f conftestfail.class \ - && ! { echo "$as_me:36982: $JAVAC -fno-assert -d . conftestfail.java" >&5 + && ! { echo "$as_me:39082: $JAVAC -fno-assert -d . conftestfail.java" >&5 $JAVAC -fno-assert -d . conftestfail.java >&5 2>&1 }; then javac_works= @@ -37000,24 +39100,30 @@ EOF fi fi else - rm -f conftest.class - if { echo "$as_me:37004: $JAVAC -d . conftest.java" >&5 + if test "$source_version" = 1.5; then + case "$target_version" in + 1.1 | 1.2 | 1.3 | 1.4 | 1.5) ;; + *) source_version='1.6' ;; + esac + fi + rm -f conftest.class + if { echo "$as_me:39110: $JAVAC -d . conftest.java" >&5 $JAVAC -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then rm -f conftest.class rm -f conftestfail.class - if { echo "$as_me:37011: $JAVAC -source $source_version -d . conftest.java" >&5 + if { echo "$as_me:39117: $JAVAC -source $source_version -d . conftest.java" >&5 $JAVAC -source "$source_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ - && { echo "$as_me:37016: $JAVAC -d . conftestfail.java" >&5 + && { echo "$as_me:39122: $JAVAC -d . conftestfail.java" >&5 $JAVAC -d . conftestfail.java >&5 2>&1 } \ && test -f conftestfail.class \ - && ! { echo "$as_me:37020: $JAVAC -source $source_version -d . conftestfail.java" >&5 + && ! { echo "$as_me:39126: $JAVAC -source $source_version -d . conftestfail.java" >&5 $JAVAC -source "$source_version" -d . conftestfail.java >&5 2>&1 }; then CONF_JAVAC="$JAVAC -source $source_version" @@ -37030,23 +39136,23 @@ EOF fi else rm -f conftest.class - if { echo "$as_me:37033: $JAVAC -target $target_version -d . conftest.java" >&5 + if { echo "$as_me:39139: $JAVAC -target $target_version -d . conftest.java" >&5 $JAVAC -target "$target_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then rm -f conftest.class rm -f conftestfail.class - if { echo "$as_me:37040: $JAVAC -target $target_version -source $source_version -d . conftest.java" >&5 + if { echo "$as_me:39146: $JAVAC -target $target_version -source $source_version -d . conftest.java" >&5 $JAVAC -target "$target_version" -source "$source_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ - && { echo "$as_me:37045: $JAVAC -target $target_version -d . conftestfail.java" >&5 + && { echo "$as_me:39151: $JAVAC -target $target_version -d . conftestfail.java" >&5 $JAVAC -target "$target_version" -d . conftestfail.java >&5 2>&1 } \ && test -f conftestfail.class \ - && ! { echo "$as_me:37049: $JAVAC -target $target_version -source $source_version -d . conftestfail.java" >&5 + && ! { echo "$as_me:39155: $JAVAC -target $target_version -source $source_version -d . conftestfail.java" >&5 $JAVAC -target "$target_version" -source "$source_version" -d . conftestfail.java >&5 2>&1 }; then CONF_JAVAC="$JAVAC -target $target_version -source $source_version" @@ -37059,7 +39165,7 @@ EOF fi else rm -f conftest.class - if { echo "$as_me:37062: $JAVAC -target $target_version -source $source_version -d . conftest.java" >&5 + if { echo "$as_me:39168: $JAVAC -target $target_version -source $source_version -d . conftest.java" >&5 $JAVAC -target "$target_version" -source "$source_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ @@ -37177,28 +39283,28 @@ fi if test -z "$HAVE_JAVACOMP" && test -n "$HAVE_GCJ_IN_PATH"; then if gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^3\.[01]/d' | grep '^[3-9]' >/dev/null; then - if { echo "$as_me:37180: gcj -C -d . conftestlib.java" >&5 + if { echo "$as_me:39286: gcj -C -d . conftestlib.java" >&5 gcj -C -d . conftestlib.java >&5 2>&1 }; then if gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^4\.[012]/d' | grep '^[4-9]' >/dev/null; then rm -f conftest.class - if { echo "$as_me:37185: gcj -C -d . conftest.java" >&5 + if { echo "$as_me:39291: gcj -C -d . conftest.java" >&5 gcj -C -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then rm -f conftest.class rm -f conftestfail.class - if { echo "$as_me:37192: gcj -C -fsource=$source_version -d . conftest.java" >&5 + if { echo "$as_me:39298: gcj -C -fsource=$source_version -d . conftest.java" >&5 gcj -C -fsource="$source_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ - && { echo "$as_me:37197: gcj -C -d . conftestfail.java" >&5 + && { echo "$as_me:39303: gcj -C -d . conftestfail.java" >&5 gcj -C -d . conftestfail.java >&5 2>&1 } \ && test -f conftestfail.class \ - && ! { echo "$as_me:37201: gcj -C -fsource=$source_version -d . conftestfail.java" >&5 + && ! { echo "$as_me:39307: gcj -C -fsource=$source_version -d . conftestfail.java" >&5 gcj -C -fsource="$source_version" -d . conftestfail.java >&5 2>&1 }; then CONF_JAVAC="gcj -C -fsource=$source_version" @@ -37212,7 +39318,7 @@ fi else rm -f conftest.class rm -f conftestfail.class - if { echo "$as_me:37215: gcj -C -fsource=$source_version -ftarget=$target_version -d . conftest.java" >&5 + if { echo "$as_me:39321: gcj -C -fsource=$source_version -ftarget=$target_version -d . conftest.java" >&5 gcj -C -fsource="$source_version" -ftarget="$target_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ @@ -37225,7 +39331,7 @@ fi else if test "$target_version" = 1.4 && test "$source_version" = 1.4; then rm -f conftest.class - if { echo "$as_me:37228: gcj -C -d . conftest.java" >&5 + if { echo "$as_me:39334: gcj -C -d . conftest.java" >&5 gcj -C -d . conftest.java >&5 2>&1 } \ && test -f conftest.class; then @@ -37236,7 +39342,7 @@ fi else if test "$target_version" = 1.4 && test "$source_version" = 1.3; then rm -f conftest.class - if { echo "$as_me:37239: gcj -C -fno-assert -d . conftest.java" >&5 + if { echo "$as_me:39345: gcj -C -fno-assert -d . conftest.java" >&5 gcj -C -fno-assert -d . conftest.java >&5 2>&1 } \ && test -f conftest.class; then @@ -37245,7 +39351,7 @@ fi HAVE_JAVACOMP=1 else rm -f conftest.class - if { echo "$as_me:37248: gcj -C -d . conftest.java" >&5 + if { echo "$as_me:39354: gcj -C -d . conftest.java" >&5 gcj -C -d . conftest.java >&5 2>&1 } \ && test -f conftest.class; then @@ -37263,24 +39369,30 @@ fi if test -z "$HAVE_JAVACOMP" && test -n "$HAVE_JAVAC_IN_PATH"; then if { javac -version >/dev/null 2>/dev/null || test $? -le 2; } \ && ( if javac -help 2>&1 >/dev/null | grep at.dms.kjc.Main >/dev/null && javac -help 2>/dev/null | grep 'released.*2000' >/dev/null ; then exit 1; else exit 0; fi ); then - rm -f conftest.class - if { echo "$as_me:37267: javac -d . conftest.java" >&5 + if test "$source_version" = 1.5; then + case "$target_version" in + 1.1 | 1.2 | 1.3 | 1.4 | 1.5) ;; + *) source_version='1.6' ;; + esac + fi + rm -f conftest.class + if { echo "$as_me:39379: javac -d . conftest.java" >&5 javac -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then rm -f conftest.class rm -f conftestfail.class - if { echo "$as_me:37274: javac -source $source_version -d . conftest.java" >&5 + if { echo "$as_me:39386: javac -source $source_version -d . conftest.java" >&5 javac -source "$source_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ - && { echo "$as_me:37279: javac -d . conftestfail.java" >&5 + && { echo "$as_me:39391: javac -d . conftestfail.java" >&5 javac -d . conftestfail.java >&5 2>&1 } \ && test -f conftestfail.class \ - && ! { echo "$as_me:37283: javac -source $source_version -d . conftestfail.java" >&5 + && ! { echo "$as_me:39395: javac -source $source_version -d . conftestfail.java" >&5 javac -source "$source_version" -d . conftestfail.java >&5 2>&1 }; then CONF_JAVAC="javac -source $source_version" @@ -37293,23 +39405,23 @@ fi fi else rm -f conftest.class - if { echo "$as_me:37296: javac -target $target_version -d . conftest.java" >&5 + if { echo "$as_me:39408: javac -target $target_version -d . conftest.java" >&5 javac -target "$target_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5; then rm -f conftest.class rm -f conftestfail.class - if { echo "$as_me:37303: javac -target $target_version -source $source_version -d . conftest.java" >&5 + if { echo "$as_me:39415: javac -target $target_version -source $source_version -d . conftest.java" >&5 javac -target "$target_version" -source "$source_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&5 \ - && { echo "$as_me:37308: javac -target $target_version -d . conftestfail.java" >&5 + && { echo "$as_me:39420: javac -target $target_version -d . conftestfail.java" >&5 javac -target "$target_version" -d . conftestfail.java >&5 2>&1 } \ && test -f conftestfail.class \ - && ! { echo "$as_me:37312: javac -target $target_version -source $source_version -d . conftestfail.java" >&5 + && ! { echo "$as_me:39424: javac -target $target_version -source $source_version -d . conftestfail.java" >&5 javac -target "$target_version" -source "$source_version" -d . conftestfail.java >&5 2>&1 }; then CONF_JAVAC="javac -target $target_version -source $source_version" @@ -37322,7 +39434,7 @@ fi fi else rm -f conftest.class - if { echo "$as_me:37325: javac -target $target_version -source $source_version -d . conftest.java" >&5 + if { echo "$as_me:39437: javac -target $target_version -source $source_version -d . conftest.java" >&5 javac -target "$target_version" -source "$source_version" -d . conftest.java >&5 2>&1 } \ && test -f conftest.class \ @@ -37375,7 +39487,7 @@ $as_echo_n "checking for Java virtual machine... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ +#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ yes #endif @@ -37585,7 +39697,7 @@ $as_echo "$ac_result" >&6; } -ac_config_files="$ac_config_files Makefile build-aux/Makefile po/Makefile.in data/Makefile etc/Makefile examples/Makefile examples/calc++/Makefile lib/Makefile src/Makefile doc/Makefile doc/yacc.1" +ac_config_files="$ac_config_files Makefile po/Makefile.in doc/yacc.1" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -37724,10 +39836,22 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_GCC_WARNINGS_TRUE}" && test -z "${ENABLE_GCC_WARNINGS_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GCC_WARNINGS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BISON_CXX_WORKS_TRUE}" && test -z "${BISON_CXX_WORKS_FALSE}"; then as_fn_error $? "conditional \"BISON_CXX_WORKS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_YACC_TRUE}" && test -z "${ENABLE_YACC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_YACC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FLEX_CXX_WORKS_TRUE}" && test -z "${FLEX_CXX_WORKS_FALSE}"; then + as_fn_error $? "conditional \"FLEX_CXX_WORKS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -37747,12 +39871,45 @@ Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi CONFIG_INCLUDE=lib/config.h + + + + # Tell AC_LIBSOURCES where to find source files like alloca.c. + + + # This hack originated in bison. It is required when using non-recursive + # automake rules to build from gnulib-provided lib/ sources. Hence, LIB_DIR + # is usually simply "lib". Those rules use the list of names like "fchdir.o" + # and "strstr.o" in gl_LIBOBJS. With non-recursive make, we must prefix each + # such file name with the "lib/" prefix. See also build-aux/prefix-gnulib-mk. + gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, , lib/,g'` + + # Listing the names of the variables to prefix is error-prone. + # Rather, adjust each AC_SUBST'd variable whose name ends in '_H' + # and whose value ends in '.h'. + for ac_var in $ac_subst_vars + do + eval "ac_val=\$$ac_var" + case $ac_var:$ac_val in + *_H:*.h) eval "$ac_var=lib/\$$ac_var";; + esac + done + + if test -z "${GL_GENERATE_SCHED_H_TRUE}" && test -z "${GL_GENERATE_SCHED_H_FALSE}"; then as_fn_error $? "conditional \"GL_GENERATE_SCHED_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -37801,6 +39958,10 @@ fi gltests_LTLIBOBJS=$gltests_ltlibobjs +if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then + as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -38198,7 +40359,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU Bison $as_me 2.7.12-4996, which was +This file was extended by GNU Bison $as_me 3.0.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -38270,7 +40431,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU Bison config.status 2.7.12-4996 +GNU Bison config.status 3.0.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -38389,7 +40550,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" GNUmakefile=$GNUmakefile # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it @@ -38417,19 +40578,10 @@ do "runtime-po/Makefile.in") CONFIG_FILES="$CONFIG_FILES runtime-po/Makefile.in" ;; "etc/bench.pl") CONFIG_FILES="$CONFIG_FILES etc/bench.pl" ;; "tests/atconfig") CONFIG_COMMANDS="$CONFIG_COMMANDS tests/atconfig" ;; - "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/atlocal") CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;; "tests/bison") CONFIG_FILES="$CONFIG_FILES tests/bison" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "build-aux/Makefile") CONFIG_FILES="$CONFIG_FILES build-aux/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; - "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; - "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; - "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - "examples/calc++/Makefile") CONFIG_FILES="$CONFIG_FILES examples/calc++/Makefile" ;; - "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/yacc.1") CONFIG_FILES="$CONFIG_FILES doc/yacc.1" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -39062,29 +41214,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -39102,53 +41260,48 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; "po-directories":C) diff --git a/configure.ac b/configure.ac index 2c9be08..99f6ad4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Configure template for GNU Bison. -*-Autoconf-*- # -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2015, 2018 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ # In order for some versions of Sun Studio to compile our C++ test cases # correctly, we need Autoconf 2.64 or better to handle the restrict # keyword in at least string.h from gnulib. We need Autoconf 2.68 or -# better to avoid a typo in the `configure --help' entry for the YACC +# better to avoid a typo in the 'configure --help' entry for the YACC # environment variable. AC_PREREQ([2.68]) m4_pattern_forbid([^gl_[A-Z]]) @@ -26,18 +26,14 @@ m4_pattern_forbid([^gl_[A-Z]]) AC_INIT([GNU Bison], m4_esyscmd([build-aux/git-version-gen .tarball-version]), [bug-bison@gnu.org]) -AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2013]) +AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2018]) AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR], [The copyright year for this package]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) -# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here: -# -# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131 -# -# To avoid 1.11, we make 1.11.1 the minimum version. +# We use Automake 1.14's %D% and %C%. # # We want gnits strictness only when rolling a stable release. For # release candidates, we use version strings like 2.4.3_rc1, but gnits @@ -45,7 +41,9 @@ AC_CONFIG_MACRO_DIR([m4]) # releases, we want to be able run make dist without being required to # add a bogus NEWS entry. In that case, the version string # automatically contains a dash, which we also let disable gnits. -AM_INIT_AUTOMAKE([1.11.1 dist-xz silent-rules] +AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc + color-tests parallel-tests + silent-rules] m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]], [gnu], [gnits])) AM_SILENT_RULES([yes]) @@ -73,15 +71,18 @@ AC_CACHE_CHECK([whether pragma GCC diagnostic push works], CFLAGS=$save_CFLAGS]) AC_ARG_ENABLE([gcc-warnings], -[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)], +[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended). + Also, issue synclines from the examples/ to + the corresponding source in the Texinfo doc.], [case $enable_gcc_warnings in yes|no) ;; *) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);; esac], [enable_gcc_warnings=no]) +AM_CONDITIONAL([ENABLE_GCC_WARNINGS], [test "$enable_gcc_warnings" = yes]) if test "$enable_gcc_warnings" = yes; then - warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align - -Wformat -Wpointer-arith -Wwrite-strings' + warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align -Wdocumentation + -Wformat -Wnull-dereference -Wpointer-arith -Wwrite-strings' warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes' warn_cxx='-Wnoexcept' # Warnings for the test suite only. @@ -89,7 +90,12 @@ if test "$enable_gcc_warnings" = yes; then # -fno-color-diagnostics: Clang's use of colors in the error # messages is confusing the tests looking at the compiler's output # (e.g., synclines.at). - warn_tests='-Wundef -pedantic -fno-color-diagnostics' + # + # -Wno-keyword-macro: We use the "#define private public" dirty + # trick in the test suite to check some private implementation + # details for lalr1.cc. + warn_tests='-Wundef -pedantic -Wdeprecated -Wsign-compare -fno-color-diagnostics + -Wno-keyword-macro' AC_LANG_PUSH([C]) # Clang supports many of GCC's -W options, but only issues warnings @@ -141,9 +147,11 @@ if test "$enable_gcc_warnings" = yes; then gl_WARN_ADD([$i], [WARN_CXXFLAGS_TEST]) done # Clang++ 3.2+ reject C code generated by Flex. - gl_WARN_ADD([-Wno-null-conversion], [WARN_NO_NULL_CONVERSION_CXXFLAGS]) - # Variants break strict aliasing analysis. - gl_WARN_ADD([-fno-strict-aliasing], [NO_STRICT_ALIAS_CXXFLAGS]) + gl_WARN_ADD([-Wno-null-conversion], [FLEX_SCANNER_CXXFLAGS]) + # So does G++ 4.8... + gl_WARN_ADD([-Wno-sign-compare], [FLEX_SCANNER_CXXFLAGS]) + # ... possiby in std=c++11 mode. + gl_WARN_ADD([-Wno-zero-as-null-pointer-constant], [FLEX_SCANNER_CXXFLAGS]) CXXFLAGS=$save_CXXFLAGS AC_LANG_POP([C++]) fi @@ -157,21 +165,17 @@ AC_ARG_ENABLE([yacc], [AC_HELP_STRING([--disable-yacc], [do not build a yacc command or an -ly library])], , [enable_yacc=yes]) -case $enable_yacc in -yes) - YACC_SCRIPT=yacc - YACC_LIBRARY=liby.a;; -*) - YACC_SCRIPT= - YACC_LIBRARY=;; -esac -AC_SUBST([YACC_SCRIPT]) -AC_SUBST([YACC_LIBRARY]) +AM_CONDITIONAL([ENABLE_YACC], [test "$enable_yacc" = yes]) # Checks for programs. AM_MISSING_PROG([DOT], [dot]) AC_PROG_LEX -$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required]) +$LEX_IS_FLEX || test "X$LEX" = X: || { + AC_MSG_WARN([bypassing lex because flex is required]) + LEX=: +} +AM_CONDITIONAL([FLEX_CXX_WORKS], + [$LEX_IS_FLEX && test $bison_cv_cxx_works = yes]) AC_PROG_YACC AC_PROG_RANLIB AC_PROG_GNU_M4 @@ -219,34 +223,37 @@ AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl]) # Initialize the test suite. AC_CONFIG_TESTDIR(tests) -AC_CONFIG_FILES([tests/Makefile tests/atlocal]) +AC_CONFIG_FILES([tests/atlocal]) AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison]) + AC_CHECK_PROGS([VALGRIND], [valgrind]) -case $VALGRIND:$host_os in +# Use something simpler that $host_os to select our suppression file. +uname=`uname` +case $VALGRIND:$uname in '':*) ;; - *:darwin*) + *:Darwin) # See README-hacking. - # VALGRIND+=' --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind' VALGRIND=;; *:*) - AC_SUBST([VALGRIND_PREBISON], ["$VALGRIND -q"]);; + suppfile=build-aux/$uname.valgrind + if test -f "$srcdir/$suppfile"; then + AC_SUBST([VALGRIND_OPTS_SUPPRESSION], + ["--suppressions=\$(abs_top_srcdir)/$suppfile"]) + fi + ;; esac +# Whether we cannot run the compiled bison. +AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes]) + AM_MISSING_PROG([AUTOM4TE], [autom4te]) # Needed by tests/atlocal.in. AC_SUBST([GCC]) -gt_JAVACOMP([1.3]) +gt_JAVACOMP([1.3], [1.4]) gt_JAVAEXEC AC_CONFIG_FILES([Makefile - build-aux/Makefile - po/Makefile.in - data/Makefile - etc/Makefile - examples/Makefile - examples/calc++/Makefile - lib/Makefile src/Makefile - doc/Makefile - doc/yacc.1]) + po/Makefile.in + doc/yacc.1]) AC_OUTPUT diff --git a/data/Makefile.am b/data/Makefile.am deleted file mode 100644 index 5678c25..0000000 --- a/data/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -## Copyright (C) 2002, 2005-2013 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -dist_pkgdata_DATA = README bison.m4 \ - c-like.m4 \ - c-skel.m4 c.m4 yacc.c glr.c \ - c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc stack.hh \ - java-skel.m4 java.m4 lalr1.java - -m4sugardir = $(pkgdatadir)/m4sugar -dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/foreach.m4 - -xsltdir = $(pkgdatadir)/xslt -dist_xslt_DATA = \ - xslt/bison.xsl \ - xslt/xml2dot.xsl \ - xslt/xml2text.xsl \ - xslt/xml2xhtml.xsl diff --git a/data/Makefile.in b/data/Makefile.in deleted file mode 100644 index f7b4c3c..0000000 --- a/data/Makefile.in +++ /dev/null @@ -1,1643 +0,0 @@ -# Makefile.in generated by automake 1.13.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = data -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) $(dist_xslt_DATA) \ - README -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ - $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \ - $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/bison-i18n.m4 \ - $(top_srcdir)/m4/c-working.m4 $(top_srcdir)/m4/calloc.m4 \ - $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \ - $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \ - $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \ - $(top_srcdir)/m4/cxx.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/dmalloc.m4 \ - $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ - $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \ - $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \ - $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ - $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/extern-inline.m4 \ - $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fcntl-o.m4 \ - $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ - $(top_srcdir)/m4/flex.m4 $(top_srcdir)/m4/float_h.m4 \ - $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \ - $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \ - $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \ - $(top_srcdir)/m4/fseterr.m4 $(top_srcdir)/m4/fstat.m4 \ - $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getdtablesize.m4 \ - $(top_srcdir)/m4/getline.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ - $(top_srcdir)/m4/gnulib-common.m4 \ - $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/include_next.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ - $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ - $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isnan.m4 \ - $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \ - $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/iswblank.m4 \ - $(top_srcdir)/m4/javacomp.m4 $(top_srcdir)/m4/javaexec.m4 \ - $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/ldexp.m4 \ - $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libunistring-base.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ - $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ - $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/malloc.m4 \ - $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \ - $(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \ - $(top_srcdir)/m4/msvc-inval.m4 \ - $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ - $(top_srcdir)/m4/obstack-printf.m4 $(top_srcdir)/m4/off_t.m4 \ - $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/pipe2.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \ - $(top_srcdir)/m4/printf-frexp.m4 \ - $(top_srcdir)/m4/printf-frexpl.m4 \ - $(top_srcdir)/m4/printf-posix-rpl.m4 \ - $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ - $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \ - $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/sched_h.m4 \ - $(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \ - $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \ - $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \ - $(top_srcdir)/m4/size_max.m4 \ - $(top_srcdir)/m4/snprintf-posix.m4 \ - $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/spawn-pipe.m4 \ - $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/sprintf-posix.m4 \ - $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \ - $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ - $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ - $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \ - $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \ - $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \ - $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ - $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strverscmp.m4 \ - $(top_srcdir)/m4/sys_socket_h.m4 \ - $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_types_h.m4 \ - $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/threadlib.m4 \ - $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/timevar.m4 \ - $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ - $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ - $(top_srcdir)/m4/vfprintf-posix.m4 \ - $(top_srcdir)/m4/vsnprintf-posix.m4 \ - $(top_srcdir)/m4/vsnprintf.m4 \ - $(top_srcdir)/m4/vsprintf-posix.m4 \ - $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \ - $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ - $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \ - $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/lib/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)" \ - "$(DESTDIR)$(xsltdir)" -DATA = $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) $(dist_xslt_DATA) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -pkglibexecdir = @pkglibexecdir@ -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -ALLOCA_H = @ALLOCA_H@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ -AR = @AR@ -ARFLAGS = @ARFLAGS@ -ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOM4TE = @AUTOM4TE@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BISON_CXX_WORKS = @BISON_CXX_WORKS@ -BISON_C_WORKS = @BISON_C_WORKS@ -BISON_LOCALEDIR = @BISON_LOCALEDIR@ -BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ -BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ -BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ -BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ -BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CLASSPATH = @CLASSPATH@ -CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@ -CONFIG_INCLUDE = @CONFIG_INCLUDE@ -CONF_JAVA = @CONF_JAVA@ -CONF_JAVAC = @CONF_JAVAC@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CXX_COMPILER_POSIXLY_CORRECT = @CXX_COMPILER_POSIXLY_CORRECT@ -CYGPATH_W = @CYGPATH_W@ -C_COMPILER_POSIXLY_CORRECT = @C_COMPILER_POSIXLY_CORRECT@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOT = @DOT@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ -EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ -ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ -ENOLINK_VALUE = @ENOLINK_VALUE@ -EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ -EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ -ERRNO_H = @ERRNO_H@ -EXEEXT = @EXEEXT@ -FLOAT_H = @FLOAT_H@ -GCC = @GCC@ -GETOPT_H = @GETOPT_H@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GNULIB_ACOSF = @GNULIB_ACOSF@ -GNULIB_ACOSL = @GNULIB_ACOSL@ -GNULIB_ASINF = @GNULIB_ASINF@ -GNULIB_ASINL = @GNULIB_ASINL@ -GNULIB_ATAN2F = @GNULIB_ATAN2F@ -GNULIB_ATANF = @GNULIB_ATANF@ -GNULIB_ATANL = @GNULIB_ATANL@ -GNULIB_ATOLL = @GNULIB_ATOLL@ -GNULIB_BTOWC = @GNULIB_BTOWC@ -GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ -GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ -GNULIB_CBRT = @GNULIB_CBRT@ -GNULIB_CBRTF = @GNULIB_CBRTF@ -GNULIB_CBRTL = @GNULIB_CBRTL@ -GNULIB_CEIL = @GNULIB_CEIL@ -GNULIB_CEILF = @GNULIB_CEILF@ -GNULIB_CEILL = @GNULIB_CEILL@ -GNULIB_CHDIR = @GNULIB_CHDIR@ -GNULIB_CHOWN = @GNULIB_CHOWN@ -GNULIB_CLOSE = @GNULIB_CLOSE@ -GNULIB_COPYSIGN = @GNULIB_COPYSIGN@ -GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@ -GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@ -GNULIB_COSF = @GNULIB_COSF@ -GNULIB_COSHF = @GNULIB_COSHF@ -GNULIB_COSL = @GNULIB_COSL@ -GNULIB_DPRINTF = @GNULIB_DPRINTF@ -GNULIB_DUP = @GNULIB_DUP@ -GNULIB_DUP2 = @GNULIB_DUP2@ -GNULIB_DUP3 = @GNULIB_DUP3@ -GNULIB_ENVIRON = @GNULIB_ENVIRON@ -GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ -GNULIB_EXP2 = @GNULIB_EXP2@ -GNULIB_EXP2F = @GNULIB_EXP2F@ -GNULIB_EXP2L = @GNULIB_EXP2L@ -GNULIB_EXPF = @GNULIB_EXPF@ -GNULIB_EXPL = @GNULIB_EXPL@ -GNULIB_EXPM1 = @GNULIB_EXPM1@ -GNULIB_EXPM1F = @GNULIB_EXPM1F@ -GNULIB_EXPM1L = @GNULIB_EXPM1L@ -GNULIB_FABSF = @GNULIB_FABSF@ -GNULIB_FABSL = @GNULIB_FABSL@ -GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ -GNULIB_FCHDIR = @GNULIB_FCHDIR@ -GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ -GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ -GNULIB_FCLOSE = @GNULIB_FCLOSE@ -GNULIB_FCNTL = @GNULIB_FCNTL@ -GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ -GNULIB_FDOPEN = @GNULIB_FDOPEN@ -GNULIB_FFLUSH = @GNULIB_FFLUSH@ -GNULIB_FFSL = @GNULIB_FFSL@ -GNULIB_FFSLL = @GNULIB_FFSLL@ -GNULIB_FGETC = @GNULIB_FGETC@ -GNULIB_FGETS = @GNULIB_FGETS@ -GNULIB_FLOOR = @GNULIB_FLOOR@ -GNULIB_FLOORF = @GNULIB_FLOORF@ -GNULIB_FLOORL = @GNULIB_FLOORL@ -GNULIB_FMA = @GNULIB_FMA@ -GNULIB_FMAF = @GNULIB_FMAF@ -GNULIB_FMAL = @GNULIB_FMAL@ -GNULIB_FMOD = @GNULIB_FMOD@ -GNULIB_FMODF = @GNULIB_FMODF@ -GNULIB_FMODL = @GNULIB_FMODL@ -GNULIB_FOPEN = @GNULIB_FOPEN@ -GNULIB_FPRINTF = @GNULIB_FPRINTF@ -GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ -GNULIB_FPURGE = @GNULIB_FPURGE@ -GNULIB_FPUTC = @GNULIB_FPUTC@ -GNULIB_FPUTS = @GNULIB_FPUTS@ -GNULIB_FREAD = @GNULIB_FREAD@ -GNULIB_FREOPEN = @GNULIB_FREOPEN@ -GNULIB_FREXP = @GNULIB_FREXP@ -GNULIB_FREXPF = @GNULIB_FREXPF@ -GNULIB_FREXPL = @GNULIB_FREXPL@ -GNULIB_FSCANF = @GNULIB_FSCANF@ -GNULIB_FSEEK = @GNULIB_FSEEK@ -GNULIB_FSEEKO = @GNULIB_FSEEKO@ -GNULIB_FSTAT = @GNULIB_FSTAT@ -GNULIB_FSTATAT = @GNULIB_FSTATAT@ -GNULIB_FSYNC = @GNULIB_FSYNC@ -GNULIB_FTELL = @GNULIB_FTELL@ -GNULIB_FTELLO = @GNULIB_FTELLO@ -GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ -GNULIB_FUTIMENS = @GNULIB_FUTIMENS@ -GNULIB_FWRITE = @GNULIB_FWRITE@ -GNULIB_GETC = @GNULIB_GETC@ -GNULIB_GETCHAR = @GNULIB_GETCHAR@ -GNULIB_GETCWD = @GNULIB_GETCWD@ -GNULIB_GETDELIM = @GNULIB_GETDELIM@ -GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ -GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ -GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ -GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ -GNULIB_GETLINE = @GNULIB_GETLINE@ -GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ -GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ -GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ -GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ -GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ -GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ -GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ -GNULIB_GRANTPT = @GNULIB_GRANTPT@ -GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ -GNULIB_HYPOT = @GNULIB_HYPOT@ -GNULIB_HYPOTF = @GNULIB_HYPOTF@ -GNULIB_HYPOTL = @GNULIB_HYPOTL@ -GNULIB_ILOGB = @GNULIB_ILOGB@ -GNULIB_ILOGBF = @GNULIB_ILOGBF@ -GNULIB_ILOGBL = @GNULIB_ILOGBL@ -GNULIB_IMAXABS = @GNULIB_IMAXABS@ -GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ -GNULIB_ISATTY = @GNULIB_ISATTY@ -GNULIB_ISFINITE = @GNULIB_ISFINITE@ -GNULIB_ISINF = @GNULIB_ISINF@ -GNULIB_ISNAN = @GNULIB_ISNAN@ -GNULIB_ISNAND = @GNULIB_ISNAND@ -GNULIB_ISNANF = @GNULIB_ISNANF@ -GNULIB_ISNANL = @GNULIB_ISNANL@ -GNULIB_ISWBLANK = @GNULIB_ISWBLANK@ -GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@ -GNULIB_LCHMOD = @GNULIB_LCHMOD@ -GNULIB_LCHOWN = @GNULIB_LCHOWN@ -GNULIB_LDEXPF = @GNULIB_LDEXPF@ -GNULIB_LDEXPL = @GNULIB_LDEXPL@ -GNULIB_LINK = @GNULIB_LINK@ -GNULIB_LINKAT = @GNULIB_LINKAT@ -GNULIB_LOG = @GNULIB_LOG@ -GNULIB_LOG10 = @GNULIB_LOG10@ -GNULIB_LOG10F = @GNULIB_LOG10F@ -GNULIB_LOG10L = @GNULIB_LOG10L@ -GNULIB_LOG1P = @GNULIB_LOG1P@ -GNULIB_LOG1PF = @GNULIB_LOG1PF@ -GNULIB_LOG1PL = @GNULIB_LOG1PL@ -GNULIB_LOG2 = @GNULIB_LOG2@ -GNULIB_LOG2F = @GNULIB_LOG2F@ -GNULIB_LOG2L = @GNULIB_LOG2L@ -GNULIB_LOGB = @GNULIB_LOGB@ -GNULIB_LOGBF = @GNULIB_LOGBF@ -GNULIB_LOGBL = @GNULIB_LOGBL@ -GNULIB_LOGF = @GNULIB_LOGF@ -GNULIB_LOGL = @GNULIB_LOGL@ -GNULIB_LSEEK = @GNULIB_LSEEK@ -GNULIB_LSTAT = @GNULIB_LSTAT@ -GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ -GNULIB_MBRLEN = @GNULIB_MBRLEN@ -GNULIB_MBRTOWC = @GNULIB_MBRTOWC@ -GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ -GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ -GNULIB_MBSCHR = @GNULIB_MBSCHR@ -GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ -GNULIB_MBSINIT = @GNULIB_MBSINIT@ -GNULIB_MBSLEN = @GNULIB_MBSLEN@ -GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ -GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ -GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@ -GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ -GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ -GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ -GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@ -GNULIB_MBSSEP = @GNULIB_MBSSEP@ -GNULIB_MBSSPN = @GNULIB_MBSSPN@ -GNULIB_MBSSTR = @GNULIB_MBSSTR@ -GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ -GNULIB_MBTOWC = @GNULIB_MBTOWC@ -GNULIB_MEMCHR = @GNULIB_MEMCHR@ -GNULIB_MEMMEM = @GNULIB_MEMMEM@ -GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ -GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ -GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ -GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ -GNULIB_MKFIFO = @GNULIB_MKFIFO@ -GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@ -GNULIB_MKNOD = @GNULIB_MKNOD@ -GNULIB_MKNODAT = @GNULIB_MKNODAT@ -GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ -GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ -GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ -GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ -GNULIB_MKTIME = @GNULIB_MKTIME@ -GNULIB_MODF = @GNULIB_MODF@ -GNULIB_MODFF = @GNULIB_MODFF@ -GNULIB_MODFL = @GNULIB_MODFL@ -GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ -GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ -GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ -GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ -GNULIB_OPEN = @GNULIB_OPEN@ -GNULIB_OPENAT = @GNULIB_OPENAT@ -GNULIB_PCLOSE = @GNULIB_PCLOSE@ -GNULIB_PERROR = @GNULIB_PERROR@ -GNULIB_PIPE = @GNULIB_PIPE@ -GNULIB_PIPE2 = @GNULIB_PIPE2@ -GNULIB_POPEN = @GNULIB_POPEN@ -GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ -GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@ -GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@ -GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@ -GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@ -GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ -GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@ -GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ -GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@ -GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@ -GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@ -GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@ -GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ -GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ -GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@ -GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@ -GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ -GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ -GNULIB_POWF = @GNULIB_POWF@ -GNULIB_PREAD = @GNULIB_PREAD@ -GNULIB_PRINTF = @GNULIB_PRINTF@ -GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ -GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@ -GNULIB_PTSNAME = @GNULIB_PTSNAME@ -GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ -GNULIB_PUTC = @GNULIB_PUTC@ -GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ -GNULIB_PUTENV = @GNULIB_PUTENV@ -GNULIB_PUTS = @GNULIB_PUTS@ -GNULIB_PWRITE = @GNULIB_PWRITE@ -GNULIB_RAISE = @GNULIB_RAISE@ -GNULIB_RANDOM = @GNULIB_RANDOM@ -GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ -GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@ -GNULIB_READ = @GNULIB_READ@ -GNULIB_READLINK = @GNULIB_READLINK@ -GNULIB_READLINKAT = @GNULIB_READLINKAT@ -GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ -GNULIB_REALPATH = @GNULIB_REALPATH@ -GNULIB_REMAINDER = @GNULIB_REMAINDER@ -GNULIB_REMAINDERF = @GNULIB_REMAINDERF@ -GNULIB_REMAINDERL = @GNULIB_REMAINDERL@ -GNULIB_REMOVE = @GNULIB_REMOVE@ -GNULIB_RENAME = @GNULIB_RENAME@ -GNULIB_RENAMEAT = @GNULIB_RENAMEAT@ -GNULIB_RINT = @GNULIB_RINT@ -GNULIB_RINTF = @GNULIB_RINTF@ -GNULIB_RINTL = @GNULIB_RINTL@ -GNULIB_RMDIR = @GNULIB_RMDIR@ -GNULIB_ROUND = @GNULIB_ROUND@ -GNULIB_ROUNDF = @GNULIB_ROUNDF@ -GNULIB_ROUNDL = @GNULIB_ROUNDL@ -GNULIB_RPMATCH = @GNULIB_RPMATCH@ -GNULIB_SCANF = @GNULIB_SCANF@ -GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ -GNULIB_SETENV = @GNULIB_SETENV@ -GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ -GNULIB_SIGACTION = @GNULIB_SIGACTION@ -GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@ -GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ -GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@ -GNULIB_SINF = @GNULIB_SINF@ -GNULIB_SINHF = @GNULIB_SINHF@ -GNULIB_SINL = @GNULIB_SINL@ -GNULIB_SLEEP = @GNULIB_SLEEP@ -GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ -GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ -GNULIB_SQRTF = @GNULIB_SQRTF@ -GNULIB_SQRTL = @GNULIB_SQRTL@ -GNULIB_STAT = @GNULIB_STAT@ -GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@ -GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@ -GNULIB_STPCPY = @GNULIB_STPCPY@ -GNULIB_STPNCPY = @GNULIB_STPNCPY@ -GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ -GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ -GNULIB_STRDUP = @GNULIB_STRDUP@ -GNULIB_STRERROR = @GNULIB_STRERROR@ -GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ -GNULIB_STRNCAT = @GNULIB_STRNCAT@ -GNULIB_STRNDUP = @GNULIB_STRNDUP@ -GNULIB_STRNLEN = @GNULIB_STRNLEN@ -GNULIB_STRPBRK = @GNULIB_STRPBRK@ -GNULIB_STRPTIME = @GNULIB_STRPTIME@ -GNULIB_STRSEP = @GNULIB_STRSEP@ -GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ -GNULIB_STRSTR = @GNULIB_STRSTR@ -GNULIB_STRTOD = @GNULIB_STRTOD@ -GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ -GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ -GNULIB_STRTOLL = @GNULIB_STRTOLL@ -GNULIB_STRTOULL = @GNULIB_STRTOULL@ -GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ -GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@ -GNULIB_SYMLINK = @GNULIB_SYMLINK@ -GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ -GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ -GNULIB_TANF = @GNULIB_TANF@ -GNULIB_TANHF = @GNULIB_TANHF@ -GNULIB_TANL = @GNULIB_TANL@ -GNULIB_TIMEGM = @GNULIB_TIMEGM@ -GNULIB_TIME_R = @GNULIB_TIME_R@ -GNULIB_TMPFILE = @GNULIB_TMPFILE@ -GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@ -GNULIB_TRUNC = @GNULIB_TRUNC@ -GNULIB_TRUNCF = @GNULIB_TRUNCF@ -GNULIB_TRUNCL = @GNULIB_TRUNCL@ -GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ -GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ -GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ -GNULIB_UNLINK = @GNULIB_UNLINK@ -GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ -GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ -GNULIB_UNSETENV = @GNULIB_UNSETENV@ -GNULIB_USLEEP = @GNULIB_USLEEP@ -GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@ -GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ -GNULIB_VDPRINTF = @GNULIB_VDPRINTF@ -GNULIB_VFPRINTF = @GNULIB_VFPRINTF@ -GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ -GNULIB_VFSCANF = @GNULIB_VFSCANF@ -GNULIB_VPRINTF = @GNULIB_VPRINTF@ -GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ -GNULIB_VSCANF = @GNULIB_VSCANF@ -GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ -GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNULIB_WAITPID = @GNULIB_WAITPID@ -GNULIB_WCPCPY = @GNULIB_WCPCPY@ -GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ -GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ -GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@ -GNULIB_WCSCAT = @GNULIB_WCSCAT@ -GNULIB_WCSCHR = @GNULIB_WCSCHR@ -GNULIB_WCSCMP = @GNULIB_WCSCMP@ -GNULIB_WCSCOLL = @GNULIB_WCSCOLL@ -GNULIB_WCSCPY = @GNULIB_WCSCPY@ -GNULIB_WCSCSPN = @GNULIB_WCSCSPN@ -GNULIB_WCSDUP = @GNULIB_WCSDUP@ -GNULIB_WCSLEN = @GNULIB_WCSLEN@ -GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@ -GNULIB_WCSNCAT = @GNULIB_WCSNCAT@ -GNULIB_WCSNCMP = @GNULIB_WCSNCMP@ -GNULIB_WCSNCPY = @GNULIB_WCSNCPY@ -GNULIB_WCSNLEN = @GNULIB_WCSNLEN@ -GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@ -GNULIB_WCSPBRK = @GNULIB_WCSPBRK@ -GNULIB_WCSRCHR = @GNULIB_WCSRCHR@ -GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@ -GNULIB_WCSSPN = @GNULIB_WCSSPN@ -GNULIB_WCSSTR = @GNULIB_WCSSTR@ -GNULIB_WCSTOK = @GNULIB_WCSTOK@ -GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@ -GNULIB_WCSXFRM = @GNULIB_WCSXFRM@ -GNULIB_WCTOB = @GNULIB_WCTOB@ -GNULIB_WCTOMB = @GNULIB_WCTOMB@ -GNULIB_WCTRANS = @GNULIB_WCTRANS@ -GNULIB_WCTYPE = @GNULIB_WCTYPE@ -GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ -GNULIB_WMEMCHR = @GNULIB_WMEMCHR@ -GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ -GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ -GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ -GNULIB_WMEMSET = @GNULIB_WMEMSET@ -GNULIB_WRITE = @GNULIB_WRITE@ -GNULIB__EXIT = @GNULIB__EXIT@ -GREP = @GREP@ -HAVE_ACOSF = @HAVE_ACOSF@ -HAVE_ACOSL = @HAVE_ACOSL@ -HAVE_ASINF = @HAVE_ASINF@ -HAVE_ASINL = @HAVE_ASINL@ -HAVE_ATAN2F = @HAVE_ATAN2F@ -HAVE_ATANF = @HAVE_ATANF@ -HAVE_ATANL = @HAVE_ATANL@ -HAVE_ATOLL = @HAVE_ATOLL@ -HAVE_BTOWC = @HAVE_BTOWC@ -HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ -HAVE_CBRT = @HAVE_CBRT@ -HAVE_CBRTF = @HAVE_CBRTF@ -HAVE_CBRTL = @HAVE_CBRTL@ -HAVE_CHOWN = @HAVE_CHOWN@ -HAVE_COPYSIGN = @HAVE_COPYSIGN@ -HAVE_COPYSIGNL = @HAVE_COPYSIGNL@ -HAVE_COSF = @HAVE_COSF@ -HAVE_COSHF = @HAVE_COSHF@ -HAVE_COSL = @HAVE_COSL@ -HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ -HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ -HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ -HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@ -HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@ -HAVE_DECL_CEILF = @HAVE_DECL_CEILF@ -HAVE_DECL_CEILL = @HAVE_DECL_CEILL@ -HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@ -HAVE_DECL_COSL = @HAVE_DECL_COSL@ -HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ -HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@ -HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@ -HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@ -HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ -HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@ -HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ -HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ -HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@ -HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@ -HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ -HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ -HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ -HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ -HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ -HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ -HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ -HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ -HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ -HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ -HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ -HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ -HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ -HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ -HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ -HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@ -HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@ -HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@ -HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@ -HAVE_DECL_LOGB = @HAVE_DECL_LOGB@ -HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ -HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ -HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ -HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ -HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@ -HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@ -HAVE_DECL_RINTF = @HAVE_DECL_RINTF@ -HAVE_DECL_ROUND = @HAVE_DECL_ROUND@ -HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@ -HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@ -HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ -HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ -HAVE_DECL_SINL = @HAVE_DECL_SINL@ -HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ -HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ -HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ -HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ -HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ -HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ -HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ -HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ -HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ -HAVE_DECL_TANL = @HAVE_DECL_TANL@ -HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ -HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ -HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ -HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ -HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ -HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ -HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ -HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ -HAVE_DPRINTF = @HAVE_DPRINTF@ -HAVE_DUP2 = @HAVE_DUP2@ -HAVE_DUP3 = @HAVE_DUP3@ -HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ -HAVE_EXPF = @HAVE_EXPF@ -HAVE_EXPL = @HAVE_EXPL@ -HAVE_EXPM1 = @HAVE_EXPM1@ -HAVE_EXPM1F = @HAVE_EXPM1F@ -HAVE_FABSF = @HAVE_FABSF@ -HAVE_FABSL = @HAVE_FABSL@ -HAVE_FACCESSAT = @HAVE_FACCESSAT@ -HAVE_FCHDIR = @HAVE_FCHDIR@ -HAVE_FCHMODAT = @HAVE_FCHMODAT@ -HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ -HAVE_FCNTL = @HAVE_FCNTL@ -HAVE_FDATASYNC = @HAVE_FDATASYNC@ -HAVE_FEATURES_H = @HAVE_FEATURES_H@ -HAVE_FFSL = @HAVE_FFSL@ -HAVE_FFSLL = @HAVE_FFSLL@ -HAVE_FMA = @HAVE_FMA@ -HAVE_FMAF = @HAVE_FMAF@ -HAVE_FMAL = @HAVE_FMAL@ -HAVE_FMODF = @HAVE_FMODF@ -HAVE_FMODL = @HAVE_FMODL@ -HAVE_FREXPF = @HAVE_FREXPF@ -HAVE_FSEEKO = @HAVE_FSEEKO@ -HAVE_FSTATAT = @HAVE_FSTATAT@ -HAVE_FSYNC = @HAVE_FSYNC@ -HAVE_FTELLO = @HAVE_FTELLO@ -HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ -HAVE_FUTIMENS = @HAVE_FUTIMENS@ -HAVE_GCJ_C = @HAVE_GCJ_C@ -HAVE_GCJ_IN_PATH = @HAVE_GCJ_IN_PATH@ -HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ -HAVE_GETGROUPS = @HAVE_GETGROUPS@ -HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ -HAVE_GETLOGIN = @HAVE_GETLOGIN@ -HAVE_GETOPT_H = @HAVE_GETOPT_H@ -HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ -HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ -HAVE_GIJ = @HAVE_GIJ@ -HAVE_GIJ_IN_PATH = @HAVE_GIJ_IN_PATH@ -HAVE_GRANTPT = @HAVE_GRANTPT@ -HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ -HAVE_HYPOTF = @HAVE_HYPOTF@ -HAVE_HYPOTL = @HAVE_HYPOTL@ -HAVE_ILOGB = @HAVE_ILOGB@ -HAVE_ILOGBF = @HAVE_ILOGBF@ -HAVE_ILOGBL = @HAVE_ILOGBL@ -HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_ISNAND = @HAVE_ISNAND@ -HAVE_ISNANF = @HAVE_ISNANF@ -HAVE_ISNANL = @HAVE_ISNANL@ -HAVE_ISWBLANK = @HAVE_ISWBLANK@ -HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ -HAVE_JAVA = @HAVE_JAVA@ -HAVE_JAVAC = @HAVE_JAVAC@ -HAVE_JAVAC_ENVVAR = @HAVE_JAVAC_ENVVAR@ -HAVE_JAVAC_IN_PATH = @HAVE_JAVAC_IN_PATH@ -HAVE_JAVA_ENVVAR = @HAVE_JAVA_ENVVAR@ -HAVE_JAVA_IN_PATH = @HAVE_JAVA_IN_PATH@ -HAVE_JIKES = @HAVE_JIKES@ -HAVE_JIKES_IN_PATH = @HAVE_JIKES_IN_PATH@ -HAVE_JRE = @HAVE_JRE@ -HAVE_JRE_IN_PATH = @HAVE_JRE_IN_PATH@ -HAVE_JVIEW = @HAVE_JVIEW@ -HAVE_JVIEW_IN_PATH = @HAVE_JVIEW_IN_PATH@ -HAVE_LCHMOD = @HAVE_LCHMOD@ -HAVE_LCHOWN = @HAVE_LCHOWN@ -HAVE_LDEXPF = @HAVE_LDEXPF@ -HAVE_LINK = @HAVE_LINK@ -HAVE_LINKAT = @HAVE_LINKAT@ -HAVE_LOG10F = @HAVE_LOG10F@ -HAVE_LOG10L = @HAVE_LOG10L@ -HAVE_LOG1P = @HAVE_LOG1P@ -HAVE_LOG1PF = @HAVE_LOG1PF@ -HAVE_LOG1PL = @HAVE_LOG1PL@ -HAVE_LOGBF = @HAVE_LOGBF@ -HAVE_LOGBL = @HAVE_LOGBL@ -HAVE_LOGF = @HAVE_LOGF@ -HAVE_LOGL = @HAVE_LOGL@ -HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ -HAVE_LSTAT = @HAVE_LSTAT@ -HAVE_MBRLEN = @HAVE_MBRLEN@ -HAVE_MBRTOWC = @HAVE_MBRTOWC@ -HAVE_MBSINIT = @HAVE_MBSINIT@ -HAVE_MBSLEN = @HAVE_MBSLEN@ -HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ -HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ -HAVE_MEMCHR = @HAVE_MEMCHR@ -HAVE_MEMPCPY = @HAVE_MEMPCPY@ -HAVE_MKDIRAT = @HAVE_MKDIRAT@ -HAVE_MKDTEMP = @HAVE_MKDTEMP@ -HAVE_MKFIFO = @HAVE_MKFIFO@ -HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ -HAVE_MKNOD = @HAVE_MKNOD@ -HAVE_MKNODAT = @HAVE_MKNODAT@ -HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ -HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ -HAVE_MKSTEMP = @HAVE_MKSTEMP@ -HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ -HAVE_MODFF = @HAVE_MODFF@ -HAVE_MODFL = @HAVE_MODFL@ -HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ -HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ -HAVE_OPENAT = @HAVE_OPENAT@ -HAVE_OS_H = @HAVE_OS_H@ -HAVE_PCLOSE = @HAVE_PCLOSE@ -HAVE_PIPE = @HAVE_PIPE@ -HAVE_PIPE2 = @HAVE_PIPE2@ -HAVE_POPEN = @HAVE_POPEN@ -HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ -HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@ -HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@ -HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@ -HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ -HAVE_POWF = @HAVE_POWF@ -HAVE_PREAD = @HAVE_PREAD@ -HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@ -HAVE_PTSNAME = @HAVE_PTSNAME@ -HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ -HAVE_PWRITE = @HAVE_PWRITE@ -HAVE_RAISE = @HAVE_RAISE@ -HAVE_RANDOM = @HAVE_RANDOM@ -HAVE_RANDOM_H = @HAVE_RANDOM_H@ -HAVE_RANDOM_R = @HAVE_RANDOM_R@ -HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ -HAVE_READLINK = @HAVE_READLINK@ -HAVE_READLINKAT = @HAVE_READLINKAT@ -HAVE_REALPATH = @HAVE_REALPATH@ -HAVE_REMAINDER = @HAVE_REMAINDER@ -HAVE_REMAINDERF = @HAVE_REMAINDERF@ -HAVE_RENAMEAT = @HAVE_RENAMEAT@ -HAVE_RINT = @HAVE_RINT@ -HAVE_RINTL = @HAVE_RINTL@ -HAVE_RPMATCH = @HAVE_RPMATCH@ -HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@ -HAVE_SCHED_H = @HAVE_SCHED_H@ -HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ -HAVE_SETENV = @HAVE_SETENV@ -HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ -HAVE_SIGACTION = @HAVE_SIGACTION@ -HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@ -HAVE_SIGINFO_T = @HAVE_SIGINFO_T@ -HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ -HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ -HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ -HAVE_SIGSET_T = @HAVE_SIGSET_T@ -HAVE_SINF = @HAVE_SINF@ -HAVE_SINHF = @HAVE_SINHF@ -HAVE_SINL = @HAVE_SINL@ -HAVE_SLEEP = @HAVE_SLEEP@ -HAVE_SPAWN_H = @HAVE_SPAWN_H@ -HAVE_SQRTF = @HAVE_SQRTF@ -HAVE_SQRTL = @HAVE_SQRTL@ -HAVE_STDINT_H = @HAVE_STDINT_H@ -HAVE_STPCPY = @HAVE_STPCPY@ -HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASESTR = @HAVE_STRCASESTR@ -HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ -HAVE_STRPBRK = @HAVE_STRPBRK@ -HAVE_STRPTIME = @HAVE_STRPTIME@ -HAVE_STRSEP = @HAVE_STRSEP@ -HAVE_STRTOD = @HAVE_STRTOD@ -HAVE_STRTOLL = @HAVE_STRTOLL@ -HAVE_STRTOULL = @HAVE_STRTOULL@ -HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ -HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@ -HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@ -HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ -HAVE_SYMLINK = @HAVE_SYMLINK@ -HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ -HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ -HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ -HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ -HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ -HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_TANF = @HAVE_TANF@ -HAVE_TANHF = @HAVE_TANHF@ -HAVE_TANL = @HAVE_TANL@ -HAVE_TIMEGM = @HAVE_TIMEGM@ -HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ -HAVE_UNISTD_H = @HAVE_UNISTD_H@ -HAVE_UNLINKAT = @HAVE_UNLINKAT@ -HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ -HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_USLEEP = @HAVE_USLEEP@ -HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ -HAVE_VASPRINTF = @HAVE_VASPRINTF@ -HAVE_VDPRINTF = @HAVE_VDPRINTF@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ -HAVE_WCHAR_T = @HAVE_WCHAR_T@ -HAVE_WCPCPY = @HAVE_WCPCPY@ -HAVE_WCPNCPY = @HAVE_WCPNCPY@ -HAVE_WCRTOMB = @HAVE_WCRTOMB@ -HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ -HAVE_WCSCAT = @HAVE_WCSCAT@ -HAVE_WCSCHR = @HAVE_WCSCHR@ -HAVE_WCSCMP = @HAVE_WCSCMP@ -HAVE_WCSCOLL = @HAVE_WCSCOLL@ -HAVE_WCSCPY = @HAVE_WCSCPY@ -HAVE_WCSCSPN = @HAVE_WCSCSPN@ -HAVE_WCSDUP = @HAVE_WCSDUP@ -HAVE_WCSLEN = @HAVE_WCSLEN@ -HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ -HAVE_WCSNCAT = @HAVE_WCSNCAT@ -HAVE_WCSNCMP = @HAVE_WCSNCMP@ -HAVE_WCSNCPY = @HAVE_WCSNCPY@ -HAVE_WCSNLEN = @HAVE_WCSNLEN@ -HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ -HAVE_WCSPBRK = @HAVE_WCSPBRK@ -HAVE_WCSRCHR = @HAVE_WCSRCHR@ -HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ -HAVE_WCSSPN = @HAVE_WCSSPN@ -HAVE_WCSSTR = @HAVE_WCSSTR@ -HAVE_WCSTOK = @HAVE_WCSTOK@ -HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ -HAVE_WCSXFRM = @HAVE_WCSXFRM@ -HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ -HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ -HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ -HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ -HAVE_WINT_T = @HAVE_WINT_T@ -HAVE_WMEMCHR = @HAVE_WMEMCHR@ -HAVE_WMEMCMP = @HAVE_WMEMCMP@ -HAVE_WMEMCPY = @HAVE_WMEMCPY@ -HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ -HAVE_WMEMSET = @HAVE_WMEMSET@ -HAVE__BOOL = @HAVE__BOOL@ -HAVE__EXIT = @HAVE__EXIT@ -HELP2MAN = @HELP2MAN@ -INCLUDE_NEXT = @INCLUDE_NEXT@ -INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ -INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -ISNAND_LIBM = @ISNAND_LIBM@ -ISNANF_LIBM = @ISNANF_LIBM@ -ISNANL_LIBM = @ISNANL_LIBM@ -ISNAN_LIBM = @ISNAN_LIBM@ -LDEXPL_LIBM = @LDEXPL_LIBM@ -LDEXP_LIBM = @LDEXP_LIBM@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_IS_FLEX = @LEX_IS_FLEX@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBBISON_LIBDEPS = @LIBBISON_LIBDEPS@ -LIBBISON_LTLIBDEPS = @LIBBISON_LTLIBDEPS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBMULTITHREAD = @LIBMULTITHREAD@ -LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ -LIBS = @LIBS@ -LIBTHREAD = @LIBTHREAD@ -LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ -LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ -LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ -LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ -LOCALE_JA = @LOCALE_JA@ -LOCALE_ZH_CN = @LOCALE_ZH_CN@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ -LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ -LTLIBTHREAD = @LTLIBTHREAD@ -M4 = @M4@ -M4_DEBUGFILE = @M4_DEBUGFILE@ -M4_GNU = @M4_GNU@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ -NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ -NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ -NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ -NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ -NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ -NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@ -NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@ -NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@ -NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ -NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ -NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ -NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ -NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ -NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ -NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ -NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ -NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ -NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ -NEXT_ERRNO_H = @NEXT_ERRNO_H@ -NEXT_FCNTL_H = @NEXT_FCNTL_H@ -NEXT_FLOAT_H = @NEXT_FLOAT_H@ -NEXT_GETOPT_H = @NEXT_GETOPT_H@ -NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ -NEXT_MATH_H = @NEXT_MATH_H@ -NEXT_SCHED_H = @NEXT_SCHED_H@ -NEXT_SIGNAL_H = @NEXT_SIGNAL_H@ -NEXT_SPAWN_H = @NEXT_SPAWN_H@ -NEXT_STDDEF_H = @NEXT_STDDEF_H@ -NEXT_STDINT_H = @NEXT_STDINT_H@ -NEXT_STDIO_H = @NEXT_STDIO_H@ -NEXT_STDLIB_H = @NEXT_STDLIB_H@ -NEXT_STRING_H = @NEXT_STRING_H@ -NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ -NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ -NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ -NEXT_TIME_H = @NEXT_TIME_H@ -NEXT_UNISTD_H = @NEXT_UNISTD_H@ -NEXT_WCHAR_H = @NEXT_WCHAR_H@ -NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ -NO_STRICT_ALIAS_CXXFLAGS = @NO_STRICT_ALIAS_CXXFLAGS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_COPYRIGHT_YEAR = @PACKAGE_COPYRIGHT_YEAR@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -POSUB = @POSUB@ -PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ -PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ -PRIPTR_PREFIX = @PRIPTR_PREFIX@ -PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ -PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ -PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ -RANLIB = @RANLIB@ -REPLACE_BTOWC = @REPLACE_BTOWC@ -REPLACE_CALLOC = @REPLACE_CALLOC@ -REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ -REPLACE_CBRTF = @REPLACE_CBRTF@ -REPLACE_CBRTL = @REPLACE_CBRTL@ -REPLACE_CEIL = @REPLACE_CEIL@ -REPLACE_CEILF = @REPLACE_CEILF@ -REPLACE_CEILL = @REPLACE_CEILL@ -REPLACE_CHOWN = @REPLACE_CHOWN@ -REPLACE_CLOSE = @REPLACE_CLOSE@ -REPLACE_DPRINTF = @REPLACE_DPRINTF@ -REPLACE_DUP = @REPLACE_DUP@ -REPLACE_DUP2 = @REPLACE_DUP2@ -REPLACE_EXP2 = @REPLACE_EXP2@ -REPLACE_EXP2L = @REPLACE_EXP2L@ -REPLACE_EXPM1 = @REPLACE_EXPM1@ -REPLACE_EXPM1F = @REPLACE_EXPM1F@ -REPLACE_FABSL = @REPLACE_FABSL@ -REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ -REPLACE_FCLOSE = @REPLACE_FCLOSE@ -REPLACE_FCNTL = @REPLACE_FCNTL@ -REPLACE_FDOPEN = @REPLACE_FDOPEN@ -REPLACE_FFLUSH = @REPLACE_FFLUSH@ -REPLACE_FLOOR = @REPLACE_FLOOR@ -REPLACE_FLOORF = @REPLACE_FLOORF@ -REPLACE_FLOORL = @REPLACE_FLOORL@ -REPLACE_FMA = @REPLACE_FMA@ -REPLACE_FMAF = @REPLACE_FMAF@ -REPLACE_FMAL = @REPLACE_FMAL@ -REPLACE_FMOD = @REPLACE_FMOD@ -REPLACE_FMODF = @REPLACE_FMODF@ -REPLACE_FMODL = @REPLACE_FMODL@ -REPLACE_FOPEN = @REPLACE_FOPEN@ -REPLACE_FPRINTF = @REPLACE_FPRINTF@ -REPLACE_FPURGE = @REPLACE_FPURGE@ -REPLACE_FREOPEN = @REPLACE_FREOPEN@ -REPLACE_FREXP = @REPLACE_FREXP@ -REPLACE_FREXPF = @REPLACE_FREXPF@ -REPLACE_FREXPL = @REPLACE_FREXPL@ -REPLACE_FSEEK = @REPLACE_FSEEK@ -REPLACE_FSEEKO = @REPLACE_FSEEKO@ -REPLACE_FSTAT = @REPLACE_FSTAT@ -REPLACE_FSTATAT = @REPLACE_FSTATAT@ -REPLACE_FTELL = @REPLACE_FTELL@ -REPLACE_FTELLO = @REPLACE_FTELLO@ -REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ -REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ -REPLACE_GETCWD = @REPLACE_GETCWD@ -REPLACE_GETDELIM = @REPLACE_GETDELIM@ -REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ -REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ -REPLACE_GETLINE = @REPLACE_GETLINE@ -REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ -REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ -REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ -REPLACE_HYPOT = @REPLACE_HYPOT@ -REPLACE_HYPOTF = @REPLACE_HYPOTF@ -REPLACE_HYPOTL = @REPLACE_HYPOTL@ -REPLACE_ILOGB = @REPLACE_ILOGB@ -REPLACE_ILOGBF = @REPLACE_ILOGBF@ -REPLACE_ISATTY = @REPLACE_ISATTY@ -REPLACE_ISFINITE = @REPLACE_ISFINITE@ -REPLACE_ISINF = @REPLACE_ISINF@ -REPLACE_ISNAN = @REPLACE_ISNAN@ -REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ -REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ -REPLACE_ITOLD = @REPLACE_ITOLD@ -REPLACE_LCHOWN = @REPLACE_LCHOWN@ -REPLACE_LDEXPL = @REPLACE_LDEXPL@ -REPLACE_LINK = @REPLACE_LINK@ -REPLACE_LINKAT = @REPLACE_LINKAT@ -REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ -REPLACE_LOG = @REPLACE_LOG@ -REPLACE_LOG10 = @REPLACE_LOG10@ -REPLACE_LOG10F = @REPLACE_LOG10F@ -REPLACE_LOG10L = @REPLACE_LOG10L@ -REPLACE_LOG1P = @REPLACE_LOG1P@ -REPLACE_LOG1PF = @REPLACE_LOG1PF@ -REPLACE_LOG1PL = @REPLACE_LOG1PL@ -REPLACE_LOG2 = @REPLACE_LOG2@ -REPLACE_LOG2F = @REPLACE_LOG2F@ -REPLACE_LOG2L = @REPLACE_LOG2L@ -REPLACE_LOGB = @REPLACE_LOGB@ -REPLACE_LOGBF = @REPLACE_LOGBF@ -REPLACE_LOGBL = @REPLACE_LOGBL@ -REPLACE_LOGF = @REPLACE_LOGF@ -REPLACE_LOGL = @REPLACE_LOGL@ -REPLACE_LSEEK = @REPLACE_LSEEK@ -REPLACE_LSTAT = @REPLACE_LSTAT@ -REPLACE_MALLOC = @REPLACE_MALLOC@ -REPLACE_MBRLEN = @REPLACE_MBRLEN@ -REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ -REPLACE_MBSINIT = @REPLACE_MBSINIT@ -REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ -REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ -REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ -REPLACE_MBTOWC = @REPLACE_MBTOWC@ -REPLACE_MEMCHR = @REPLACE_MEMCHR@ -REPLACE_MEMMEM = @REPLACE_MEMMEM@ -REPLACE_MKDIR = @REPLACE_MKDIR@ -REPLACE_MKFIFO = @REPLACE_MKFIFO@ -REPLACE_MKNOD = @REPLACE_MKNOD@ -REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ -REPLACE_MKTIME = @REPLACE_MKTIME@ -REPLACE_MODF = @REPLACE_MODF@ -REPLACE_MODFF = @REPLACE_MODFF@ -REPLACE_MODFL = @REPLACE_MODFL@ -REPLACE_NAN = @REPLACE_NAN@ -REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ -REPLACE_NULL = @REPLACE_NULL@ -REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ -REPLACE_OPEN = @REPLACE_OPEN@ -REPLACE_OPENAT = @REPLACE_OPENAT@ -REPLACE_PERROR = @REPLACE_PERROR@ -REPLACE_POPEN = @REPLACE_POPEN@ -REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ -REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ -REPLACE_PREAD = @REPLACE_PREAD@ -REPLACE_PRINTF = @REPLACE_PRINTF@ -REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@ -REPLACE_PTSNAME = @REPLACE_PTSNAME@ -REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ -REPLACE_PUTENV = @REPLACE_PUTENV@ -REPLACE_PWRITE = @REPLACE_PWRITE@ -REPLACE_RAISE = @REPLACE_RAISE@ -REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ -REPLACE_READ = @REPLACE_READ@ -REPLACE_READLINK = @REPLACE_READLINK@ -REPLACE_REALLOC = @REPLACE_REALLOC@ -REPLACE_REALPATH = @REPLACE_REALPATH@ -REPLACE_REMAINDER = @REPLACE_REMAINDER@ -REPLACE_REMAINDERF = @REPLACE_REMAINDERF@ -REPLACE_REMAINDERL = @REPLACE_REMAINDERL@ -REPLACE_REMOVE = @REPLACE_REMOVE@ -REPLACE_RENAME = @REPLACE_RENAME@ -REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ -REPLACE_RMDIR = @REPLACE_RMDIR@ -REPLACE_ROUND = @REPLACE_ROUND@ -REPLACE_ROUNDF = @REPLACE_ROUNDF@ -REPLACE_ROUNDL = @REPLACE_ROUNDL@ -REPLACE_SETENV = @REPLACE_SETENV@ -REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ -REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ -REPLACE_SLEEP = @REPLACE_SLEEP@ -REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ -REPLACE_SPRINTF = @REPLACE_SPRINTF@ -REPLACE_SQRTL = @REPLACE_SQRTL@ -REPLACE_STAT = @REPLACE_STAT@ -REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ -REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ -REPLACE_STPNCPY = @REPLACE_STPNCPY@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ -REPLACE_STRDUP = @REPLACE_STRDUP@ -REPLACE_STRERROR = @REPLACE_STRERROR@ -REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ -REPLACE_STRNCAT = @REPLACE_STRNCAT@ -REPLACE_STRNDUP = @REPLACE_STRNDUP@ -REPLACE_STRNLEN = @REPLACE_STRNLEN@ -REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ -REPLACE_STRSTR = @REPLACE_STRSTR@ -REPLACE_STRTOD = @REPLACE_STRTOD@ -REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ -REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ -REPLACE_SYMLINK = @REPLACE_SYMLINK@ -REPLACE_TIMEGM = @REPLACE_TIMEGM@ -REPLACE_TMPFILE = @REPLACE_TMPFILE@ -REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ -REPLACE_TRUNC = @REPLACE_TRUNC@ -REPLACE_TRUNCF = @REPLACE_TRUNCF@ -REPLACE_TRUNCL = @REPLACE_TRUNCL@ -REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ -REPLACE_UNLINK = @REPLACE_UNLINK@ -REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ -REPLACE_UNSETENV = @REPLACE_UNSETENV@ -REPLACE_USLEEP = @REPLACE_USLEEP@ -REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ -REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ -REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ -REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ -REPLACE_VPRINTF = @REPLACE_VPRINTF@ -REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ -REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ -REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ -REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ -REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ -REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ -REPLACE_WCTOB = @REPLACE_WCTOB@ -REPLACE_WCTOMB = @REPLACE_WCTOMB@ -REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ -REPLACE_WRITE = @REPLACE_WRITE@ -SCHED_H = @SCHED_H@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ -SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ -STDBOOL_H = @STDBOOL_H@ -STDDEF_H = @STDDEF_H@ -STDINT_H = @STDINT_H@ -STRIP = @STRIP@ -SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ -TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ -UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ -UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ -UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ -UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ -UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ -USE_NLS = @USE_NLS@ -VALGRIND = @VALGRIND@ -VALGRIND_PREBISON = @VALGRIND_PREBISON@ -VERSION = @VERSION@ -WARN_CFLAGS = @WARN_CFLAGS@ -WARN_CFLAGS_TEST = @WARN_CFLAGS_TEST@ -WARN_CXXFLAGS = @WARN_CXXFLAGS@ -WARN_CXXFLAGS_TEST = @WARN_CXXFLAGS_TEST@ -WARN_NO_NULL_CONVERSION_CXXFLAGS = @WARN_NO_NULL_CONVERSION_CXXFLAGS@ -WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WERROR_CFLAGS = @WERROR_CFLAGS@ -WERROR_CXXFLAGS = @WERROR_CXXFLAGS@ -WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ -WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ -WINT_T_SUFFIX = @WINT_T_SUFFIX@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -XSLTPROC = @XSLTPROC@ -YACC = @YACC@ -YACC_LIBRARY = @YACC_LIBRARY@ -YACC_SCRIPT = @YACC_SCRIPT@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -aclocaldir = @aclocaldir@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gl_LIBOBJS = @gl_LIBOBJS@ -gl_LTLIBOBJS = @gl_LTLIBOBJS@ -gltests_LIBOBJS = @gltests_LIBOBJS@ -gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ -gltests_WITNESS = @gltests_WITNESS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -lispdir = @lispdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -dist_pkgdata_DATA = README bison.m4 \ - c-like.m4 \ - c-skel.m4 c.m4 yacc.c glr.c \ - c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc stack.hh \ - java-skel.m4 java.m4 lalr1.java - -m4sugardir = $(pkgdatadir)/m4sugar -dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/foreach.m4 -xsltdir = $(pkgdatadir)/xslt -dist_xslt_DATA = \ - xslt/bison.xsl \ - xslt/xml2dot.xsl \ - xslt/xml2text.xsl \ - xslt/xml2xhtml.xsl - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu data/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-dist_m4sugarDATA: $(dist_m4sugar_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_m4sugar_DATA)'; test -n "$(m4sugardir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(m4sugardir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(m4sugardir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4sugardir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(m4sugardir)" || exit $$?; \ - done - -uninstall-dist_m4sugarDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_m4sugar_DATA)'; test -n "$(m4sugardir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(m4sugardir)'; $(am__uninstall_files_from_dir) -install-dist_pkgdataDATA: $(dist_pkgdata_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ - done - -uninstall-dist_pkgdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) -install-dist_xsltDATA: $(dist_xslt_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_xslt_DATA)'; test -n "$(xsltdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(xsltdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(xsltdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xsltdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(xsltdir)" || exit $$?; \ - done - -uninstall-dist_xsltDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_xslt_DATA)'; test -n "$(xsltdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(xsltdir)'; $(am__uninstall_files_from_dir) -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(xsltdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-dist_m4sugarDATA install-dist_pkgdataDATA \ - install-dist_xsltDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-dist_m4sugarDATA uninstall-dist_pkgdataDATA \ - uninstall-dist_xsltDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ - ctags-am distclean distclean-generic distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dist_m4sugarDATA \ - install-dist_pkgdataDATA install-dist_xsltDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-dist_m4sugarDATA \ - uninstall-dist_pkgdataDATA uninstall-dist_xsltDATA - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/data/README b/data/README index 9dc9ca6..629599c 100644 --- a/data/README +++ b/data/README @@ -27,7 +27,7 @@ Currently, the supported skeletons are: These skeletons are the only ones supported by the Bison team. Because the interface between skeletons and the bison program is not finished, *we are not bound to it*. In particular, Bison is not -mature enough for us to consider that ``foreign skeletons'' are +mature enough for us to consider that "foreign skeletons" are supported. * m4sugar @@ -52,7 +52,7 @@ into various formats. ----- -Copyright (C) 2002, 2008-2013 Free Software Foundation, Inc. +Copyright (C) 2002, 2008-2015, 2018 Free Software Foundation, Inc. This file is part of GNU Bison. diff --git a/data/bison.m4 b/data/bison.m4 index d870828..42bb67b 100644 --- a/data/bison.m4 +++ b/data/bison.m4 @@ -2,7 +2,7 @@ # Language-independent M4 Macros for Bison. -# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2002, 2004-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,14 +22,17 @@ ## Identification. ## ## ---------------- ## -# b4_copyright(TITLE, YEARS) -# -------------------------- +# b4_copyright(TITLE, [YEARS]) +# ---------------------------- +# If YEARS are not defined, use b4_copyright_years. m4_define([b4_copyright], [b4_comment([A Bison parser, made by GNU Bison b4_version.]) b4_comment([$1 -m4_text_wrap([Copyright (C) $2 Free Software Foundation, Inc.], [ ]) +]m4_dquote(m4_text_wrap([Copyright (C) +]m4_ifval([$2], [[$2]], [m4_defn([b4_copyright_years])])[ +Free Software Foundation, Inc.]))[ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -82,6 +85,20 @@ m4_changecom([#]) ]) +# b4_divert_kill(CODE) +# -------------------- +# Expand CODE for its side effects, discard its output. +m4_define([b4_divert_kill], +[m4_divert_text([KILL], [$1])]) + + +# b4_define_silent(MACRO, CODE) +# ----------------------------- +# Same as m4_define, but throw away the expansion of CODE. +m4_define([b4_define_silent], +[m4_define([$1], [b4_divert_kill([$2])])]) + + ## ---------------- ## ## Error handling. ## ## ---------------- ## @@ -103,30 +120,16 @@ _m4eof ])dnl m4_if(m4_sysval, [0], [], [m4_fatal([$0: cannot write to stdout])])]) -# b4_error(KIND, FORMAT, [ARG1], [ARG2], ...) -# ------------------------------------------- -# Write @KIND(FORMAT@,ARG1@,ARG2@,...@) to stdout. +# b4_error(KIND, START, END, FORMAT, [ARG1], [ARG2], ...) +# ------------------------------------------------------- +# Write @KIND(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout. # # For example: # -# b4_error([[warn]], [[invalid value for '%s': %s]], [[foo]], [[3]]) +# b4_error([[complain]], [[input.y:2.3]], [[input.y:5.4]], +# [[invalid %s]], [[foo]]) m4_define([b4_error], -[b4_cat([[@]$1[(]$2[]]dnl -[m4_if([$#], [2], [], - [m4_foreach([b4_arg], - m4_dquote(m4_shift(m4_shift($@))), - [[@,]b4_arg])])[@)]])]) - -# b4_error_at(KIND, START, END, FORMAT, [ARG1], [ARG2], ...) -# ---------------------------------------------------------- -# Write @KIND_at(START@,END@,FORMAT@,ARG1@,ARG2@,...@) to stdout. -# -# For example: -# -# b4_error_at([[complain]], [[input.y:2.3]], [[input.y:5.4]], -# [[invalid %s]], [[foo]]) -m4_define([b4_error_at], -[b4_cat([[@]$1[_at(]$2[@,]$3[@,]$4[]]dnl +[b4_cat([[@complain][(]$1[@,]$2[@,]$3[@,]$4[]]dnl [m4_if([$#], [4], [], [m4_foreach([b4_arg], m4_dquote(m4_shift(m4_shift(m4_shift(m4_shift($@))))), @@ -146,21 +149,21 @@ m4_define([b4_error_at], # m4_define([asdf], [ASDF]) # m4_define([fsa], [FSA]) # m4_define([fdsa], [FDSA]) -# b4_warn([[[asdf), asdf]]], [[[fsa), fsa]]], [[[fdsa), fdsa]]]) -# b4_warn([[asdf), asdf]], [[fsa), fsa]], [[fdsa), fdsa]]) -# b4_warn() -# b4_warn(1) -# b4_warn(1, 2) +# b4_warn_at([[[asdf), asdf]]], [[[fsa), fsa]]], [[[fdsa), fdsa]]]) +# b4_warn_at([[asdf), asdf]], [[fsa), fsa]], [[fdsa), fdsa]]) +# b4_warn_at() +# b4_warn_at(1) +# b4_warn_at(1, 2) # # Should produce this without newlines: # -# @warn([asdf), asdf]@,[fsa), fsa]@,[fdsa), fdsa]@) -# @warn(asdf), asdf@,fsa), fsa@,fdsa), fdsa@) +# @warn_at([asdf), asdf]@,@,@,[fsa), fsa]@,[fdsa), fdsa]@) +# @warn(asdf), asdf@,@,@,fsa), fsa@,fdsa), fdsa@) # @warn(@) # @warn(1@) # @warn(1@,2@) m4_define([b4_warn], -[b4_error([[warn]], $@)]) +[b4_error([[warn]], [], [], $@)]) # b4_warn_at(START, END, FORMAT, [ARG1], [ARG2], ...) # --------------------------------------------------- @@ -170,15 +173,15 @@ m4_define([b4_warn], # # b4_warn_at([[input.y:2.3]], [[input.y:5.4]], [[invalid %s]], [[foo]]) m4_define([b4_warn_at], -[b4_error_at([[warn]], $@)]) +[b4_error([[warn]], $@)]) # b4_complain(FORMAT, [ARG1], [ARG2], ...) # ---------------------------------------- -# Write @complain(FORMAT@,ARG1@,ARG2@,...@) to stdout. +# Bounce to b4_complain_at. # # See b4_warn example. m4_define([b4_complain], -[b4_error([[complain]], $@)]) +[b4_error([[complain]], [], [], $@)]) # b4_complain_at(START, END, FORMAT, [ARG1], [ARG2], ...) # ------------------------------------------------------- @@ -186,15 +189,15 @@ m4_define([b4_complain], # # See b4_warn_at example. m4_define([b4_complain_at], -[b4_error_at([[complain]], $@)]) +[b4_error([[complain]], $@)]) # b4_fatal(FORMAT, [ARG1], [ARG2], ...) # ------------------------------------- -# Write @fatal(FORMAT@,ARG1@,ARG2@,...@) to stdout and exit. +# Bounce to b4_fatal_at. # # See b4_warn example. m4_define([b4_fatal], -[b4_error([[fatal]], $@)dnl +[b4_error([[fatal]], [], [], $@)dnl m4_exit(1)]) # b4_fatal_at(START, END, FORMAT, [ARG1], [ARG2], ...) @@ -203,7 +206,7 @@ m4_exit(1)]) # # See b4_warn_at example. m4_define([b4_fatal_at], -[b4_error_at([[fatal]], $@)dnl +[b4_error([[fatal]], $@)dnl m4_exit(1)]) @@ -218,6 +221,87 @@ m4_define([b4_ints_in], [m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])]) +# b4_subtract(LHS, RHS) +# --------------------- +# Evaluate LHS - RHS if they are integer literals, otherwise expand +# to (LHS) - (RHS). +m4_define([b4_subtract], +[m4_bmatch([$1$2], [^[0123456789]*$], + [m4_eval([$1 - $2])], + [($1) - ($2)])]) + +# b4_join(ARG1, ...) +# _b4_join(ARG1, ...) +# ------------------- +# Join with comma, skipping empty arguments. +# b4_join calls itself recursively until it sees the first non-empty +# argument, then calls _b4_join which prepends each non-empty argument +# with a comma. +m4_define([b4_join], +[m4_if([$#$1], + [1], [], + [m4_ifval([$1], + [$1[]_$0(m4_shift($@))], + [$0(m4_shift($@))])])]) + +# _b4_join(ARGS1, ...) +# -------------------- +m4_define([_b4_join], +[m4_if([$#$1], + [1], [], + [m4_ifval([$1], [, $1])[]$0(m4_shift($@))])]) + + + + +# b4_integral_parser_tables_map(MACRO) +# ------------------------------------- +# Map MACRO on all the integral tables. MACRO is expected to have +# the signature MACRO(TABLE-NAME, CONTENT, COMMENT). +m4_define([b4_integral_parser_tables_map], +[$1([pact], [b4_pact], + [[YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing +STATE-NUM.]]) + +$1([defact], [b4_defact], + [[YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. +Performed when YYTABLE does not specify something else to do. Zero +means the default is an error.]]) + +$1([pgoto], [b4_pgoto], [[YYPGOTO[NTERM-NUM].]]) + +$1([defgoto], [b4_defgoto], [[YYDEFGOTO[NTERM-NUM].]]) + +$1([table], [b4_table], + [[YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If +positive, shift that token. If negative, reduce the rule whose +number is the opposite. If YYTABLE_NINF, syntax error.]]) + +$1([check], [b4_check]) + +$1([stos], [b4_stos], + [[YYSTOS[STATE-NUM] -- The (internal number of the) accessing +symbol of state STATE-NUM.]]) + +$1([r1], [b4_r1], + [[YYR1[YYN] -- Symbol number of symbol that rule YYN derives.]]) + +$1([r2], [b4_r2], + [[YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.]]) +]) + + +# b4_parser_tables_declare +# b4_parser_tables_define +# ------------------------ +# Define/declare the (deterministic) parser tables. +m4_define([b4_parser_tables_declare], +[b4_integral_parser_tables_map([b4_integral_parser_table_declare])]) + +m4_define([b4_parser_tables_define], +[b4_integral_parser_tables_map([b4_integral_parser_table_define])]) + + ## ------------------ ## ## Decoding options. ## @@ -229,8 +313,8 @@ m4_define([b4_ints_in], m4_define([b4_flag_if], [m4_case(b4_$1_flag, [0], [$3], - [1], [$2], - [m4_fatal([invalid $1 value: ]$1)])]) + [1], [$2], + [m4_fatal([invalid $1 value: ]b4_$1_flag)])]) # b4_define_flag_if(FLAG) @@ -243,7 +327,7 @@ m4_define([b4_define_flag_if], # _b4_define_flag_if($1, $2, FLAG) # -------------------------------- # Work around the impossibility to define macros inside macros, -# because issuing `[$1]' is not possible in M4. GNU M4 should provide +# because issuing '[$1]' is not possible in M4. GNU M4 should provide # $$1 a la M5/TeX. m4_define([_b4_define_flag_if], [m4_if([$1$2], $[1]$[2], [], @@ -256,15 +340,224 @@ m4_define([b4_$3_if], # ----------------------------- # Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise. b4_define_flag_if([defines]) # Whether headers are requested. -b4_define_flag_if([error_verbose]) # Whether error are verbose. b4_define_flag_if([glr]) # Whether a GLR parser is requested. -b4_define_flag_if([locations]) # Whether locations are tracked. b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled. b4_define_flag_if([token_table]) # Whether yytoken_table is demanded. b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated. -# yytoken_table is needed to support verbose errors. -b4_error_verbose_if([m4_define([b4_token_table_flag], [1])]) + +## --------- ## +## Symbols. ## +## --------- ## + +# In order to unify the handling of the various aspects of symbols +# (tag, type_name, whether terminal, etc.), bison.exe defines one +# macro per (token, field), where field can has_id, id, etc.: see +# src/output.c:prepare_symbols_definitions(). +# +# The various FIELDS are: +# +# - has_id: 0 or 1. +# Whether the symbol has an id. +# - id: string +# If has_id, the id. Guaranteed to be usable as a C identifier. +# Prefixed by api.token.prefix if defined. +# - tag: string. +# A representat of the symbol. Can be 'foo', 'foo.id', '"foo"' etc. +# - user_number: integer +# The assigned (external) number as used by yylex. +# - is_token: 0 or 1 +# Whether this is a terminal symbol. +# - number: integer +# The internalized number (used after yytranslate). +# - has_type: 0, 1 +# Whether has a semantic value. +# - type_tag: string +# When api.value.type=union, the generated name for the union member. +# yytype_INT etc. for symbols that has_id, otherwise yytype_1 etc. +# - type +# If it has a semantic value, its type tag, or, if variant are used, +# its type. +# In the case of api.value.type=union, type is the real type (e.g. int). +# - has_printer: 0, 1 +# - printer: string +# - printer_file: string +# - printer_line: integer +# If the symbol has a printer, everything about it. +# - has_destructor, destructor, destructor_file, destructor_line +# Likewise. +# +# The following macros provide access to these values. + +# b4_symbol_(NUM, FIELD) +# ---------------------- +# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if +# undefined. +m4_define([b4_symbol_], +[m4_indir([b4_symbol($1, $2)])]) + + +# b4_symbol(NUM, FIELD) +# --------------------- +# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if +# undefined. If FIELD = id, prepend the token prefix. +m4_define([b4_symbol], +[m4_case([$2], + [id], [m4_do([b4_percent_define_get([api.token.prefix])], + [b4_symbol_([$1], [id])])], + [b4_symbol_($@)])]) + + +# b4_symbol_if(NUM, FIELD, IF-TRUE, IF-FALSE) +# ------------------------------------------- +# If FIELD about symbol #NUM is 1 expand IF-TRUE, if is 0, expand IF-FALSE. +# Otherwise an error. +m4_define([b4_symbol_if], +[m4_case(b4_symbol([$1], [$2]), + [1], [$3], + [0], [$4], + [m4_fatal([$0: field $2 of $1 is not a Boolean:] b4_symbol([$1], [$2]))])]) + + +# b4_symbol_tag_comment(SYMBOL-NUM) +# --------------------------------- +# Issue a comment giving the tag of symbol NUM. +m4_define([b4_symbol_tag_comment], +[b4_comment([b4_symbol([$1], [tag])]) +]) + + +# b4_symbol_action_location(SYMBOL-NUM, KIND) +# ------------------------------------------- +# Report the location of the KIND action as FILE:LINE. +m4_define([b4_symbol_action_location], +[b4_symbol([$1], [$2_file]):b4_syncline([b4_symbol([$1], [$2_line])])]) + + +# b4_symbol_action(SYMBOL-NUM, KIND) +# ---------------------------------- +# Run the action KIND (destructor or printer) for SYMBOL-NUM. +m4_define([b4_symbol_action], +[b4_symbol_if([$1], [has_$2], +[b4_dollar_pushdef([(*yyvaluep)], + b4_symbol_if([$1], [has_type], + [m4_dquote(b4_symbol([$1], [type]))]), + [(*yylocationp)])dnl + b4_symbol_case_([$1])[]dnl +b4_syncline([b4_symbol([$1], [$2_line])], ["b4_symbol([$1], [$2_file])"]) + b4_symbol([$1], [$2]) +b4_syncline([@oline@], [@ofile@]) + break; + +b4_dollar_popdef[]dnl +])]) + + +# b4_symbol_destructor(SYMBOL-NUM) +# b4_symbol_printer(SYMBOL-NUM) +# -------------------------------- +m4_define([b4_symbol_destructor], [b4_symbol_action([$1], [destructor])]) +m4_define([b4_symbol_printer], [b4_symbol_action([$1], [printer])]) + + +# b4_symbol_actions(KIND, [TYPE = yytype]) +# ---------------------------------------- +# Emit the symbol actions for KIND ("printer" or "destructor"). +# Dispatch on TYPE. +m4_define([b4_symbol_actions], +[m4_pushdef([b4_actions_], m4_expand([b4_symbol_foreach([b4_symbol_$1])]))dnl +m4_ifval(m4_defn([b4_actions_]), +[switch (m4_default([$2], [yytype])) + { + m4_defn([b4_actions_]) + default: + break; + }dnl +], +[YYUSE (m4_default([$2], [yytype]));])dnl +m4_popdef([b4_actions_])dnl +]) + +# b4_symbol_case_(SYMBOL-NUM) +# --------------------------- +# Issue a "case NUM" for SYMBOL-NUM. +m4_define([b4_symbol_case_], +[case b4_symbol([$1], [number]): b4_symbol_tag_comment([$1])]) +]) + + +# b4_symbol_foreach(MACRO) +# ------------------------ +# Invoke MACRO(SYMBOL-NUM) for each SYMBOL-NUM. +m4_define([b4_symbol_foreach], + [m4_map([$1], m4_defn([b4_symbol_numbers]))]) + +# b4_symbol_map(MACRO) +# -------------------- +# Return a list (possibly empty elements) of MACRO invoked for each +# SYMBOL-NUM. +m4_define([b4_symbol_map], +[m4_map_args_sep([$1(], [)], [,], b4_symbol_numbers)]) + + +# b4_token_visible_if(NUM, IF-TRUE, IF-FALSE) +# ------------------------------------------- +# Whether NUM denotes a token that has an exported definition (i.e., +# shows in enum yytokentype). +m4_define([b4_token_visible_if], +[b4_symbol_if([$1], [is_token], + [b4_symbol_if([$1], [has_id], [$2], [$3])], + [$3])]) + +# b4_token_has_definition(NUM) +# ---------------------------- +# 1 if NUM is visible, nothing otherwise. +m4_define([b4_token_has_definition], +[b4_token_visible_if([$1], [1])]) + +# b4_any_token_visible_if([IF-TRUE], [IF-FALSE]) +# ---------------------------------------------- +# Whether there is a token that needs to be defined. +m4_define([b4_any_token_visible_if], +[m4_ifval(b4_symbol_foreach([b4_token_has_definition]), + [$1], [$2])]) + + +# b4_token_format(FORMAT, NUM) +# ---------------------------- +m4_define([b4_token_format], +[b4_token_visible_if([$2], +[m4_quote(m4_format([$1], + [b4_symbol([$2], [id])], + [b4_symbol([$2], [user_number])]))])]) + + +## ------- ## +## Types. ## +## ------- ## + +# b4_type_action_(NUMS) +# --------------------- +# Run actions for the symbol NUMS that all have the same type-name. +# Skip NUMS that have no type-name. +# +# To specify the action to run, define b4_dollar_dollar(NUMBER, +# TAG, TYPE). +m4_define([b4_type_action_], +[b4_symbol_if([$1], [has_type], +[m4_map([ b4_symbol_case_], [$@])[]dnl + b4_dollar_dollar([b4_symbol([$1], [number])], + [b4_symbol([$1], [tag])], + [b4_symbol([$1], [type])]); + break; + +])]) + +# b4_type_foreach(MACRO) +# ---------------------- +# Invoke MACRO(SYMBOL-NUMS) for each set of SYMBOL-NUMS for each type set. +m4_define([b4_type_foreach], + [m4_map([$1], m4_defn([b4_type_names]))]) @@ -284,11 +577,21 @@ m4_define([b4_basename], # ----------------------- m4_define([b4_syncline], [b4_flag_if([synclines], -[b4_sync_end([__line__], [b4_basename(m4_quote(__file__))]) -b4_sync_start([$1], [$2])])]) +[b4_sync_start([$1], [$2]) b4_sync_end([__line__], + [b4_basename(m4_quote(__file__))])[]dnl +])]) + +# b4_sync_start(LINE, FILE) +# ----------------------- +# Syncline for the new place. Typically a directive for the compiler. +m4_define([b4_sync_start], [b4_comment([$2:$1])]) + +# b4_sync_end(LINE, FILE) +# ----------------------- +# Syncline for the current place, which ends. Typically a comment +# left for the reader. +m4_define([b4_sync_end], [b4_comment([$2:$1])]) -m4_define([b4_sync_end], [b4_comment([Line $1 of $2])]) -m4_define([b4_sync_start], [b4_comment([Line $1 of $2])]) # b4_user_code(USER-CODE) # ----------------------- @@ -310,14 +613,14 @@ m4_define([b4_define_user_code], # b4_user_initial_action # b4_user_post_prologue # b4_user_pre_prologue -# b4_user_stype +# b4_user_union_members # ---------------------- # Macros that issue user code, ending with synclines. b4_define_user_code([actions]) b4_define_user_code([initial_action]) b4_define_user_code([post_prologue]) b4_define_user_code([pre_prologue]) -b4_define_user_code([stype]) +b4_define_user_code([union_members]) # b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE) @@ -373,7 +676,6 @@ m4_popdef([b4_end])dnl - ## --------------------- ## ## b4_percent_define_*. ## ## --------------------- ## @@ -399,10 +701,9 @@ m4_define([b4_percent_define_use], # b4_percent_define_get([[foo]]) m4_define([b4_percent_define_get], [b4_percent_define_use([$1])dnl -m4_ifdef([b4_percent_define(]$1[)], - [m4_indir([b4_percent_define(]$1[)])], - [$2])]) - +b4_percent_define_ifdef_([$1], + [m4_indir([b4_percent_define(]$1[)])], + [$2])]) # b4_percent_define_get_loc(VARIABLE) # ----------------------------------- @@ -421,7 +722,21 @@ m4_define([b4_percent_define_get_loc], [m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl b4_loc[]dnl m4_popdef([b4_loc])], - [b4_fatal([[b4_percent_define_get_loc: undefined %%define variable '%s']], [$1])])]) + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) + +# b4_percent_define_get_kind(VARIABLE) +# ------------------------------------ +# Get the kind (code, keyword, string) of VARIABLE, i.e., how its +# value was defined (braces, not delimiters, quotes). +# +# If the %define variable VARIABLE is undefined, complain fatally +# since that's a Bison or skeleton error. Don't record this as a +# Bison usage of VARIABLE as there's no reason to suspect that the +# user-supplied value has yet influenced the output. +m4_define([b4_percent_define_get_kind], +[m4_ifdef([b4_percent_define_kind(]$1[)], + [m4_indir([b4_percent_define_kind(]$1[)])], + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) # b4_percent_define_get_syncline(VARIABLE) # ---------------------------------------- @@ -438,7 +753,20 @@ m4_popdef([b4_loc])], m4_define([b4_percent_define_get_syncline], [m4_ifdef([b4_percent_define_syncline(]$1[)], [m4_indir([b4_percent_define_syncline(]$1[)])], - [b4_fatal([[b4_percent_define_get_syncline: undefined %%define variable '%s']], [$1])])]) + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) + +# b4_percent_define_ifdef_(VARIABLE, IF-TRUE, [IF-FALSE]) +# ------------------------------------------------------ +# If the %define variable VARIABLE is defined, expand IF-TRUE, else expand +# IF-FALSE. Don't record usage of VARIABLE. +# +# For example: +# +# b4_percent_define_ifdef_([[foo]], [[it's defined]], [[it's undefined]]) +m4_define([b4_percent_define_ifdef_], +[m4_ifdef([b4_percent_define(]$1[)], + [$2], + [$3])]) # b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE]) # ------------------------------------------------------ @@ -451,9 +779,15 @@ m4_define([b4_percent_define_get_syncline], # # b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]]) m4_define([b4_percent_define_ifdef], -[m4_ifdef([b4_percent_define(]$1[)], - [m4_define([b4_percent_define_bison_variables(]$1[)])$2], - [$3])]) +[b4_percent_define_ifdef_([$1], + [b4_percent_define_use([$1])$2], + [$3])]) + + +## --------- ## +## Options. ## +## --------- ## + # b4_percent_define_flag_if(VARIABLE, IF-TRUE, [IF-FALSE]) # -------------------------------------------------------- @@ -476,10 +810,11 @@ m4_define([b4_percent_define_flag_if], [[invalid value for %%define Boolean variable '%s']], [$1])], [[b4_percent_define_flag_if($1)]])])], - [b4_fatal([[b4_percent_define_flag_if: undefined %%define variable '%s']], [$1])])]) + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) -# b4_percent_define_default(VARIABLE, DEFAULT) -# -------------------------------------------- + +# b4_percent_define_default(VARIABLE, DEFAULT, [KIND = keyword]) +# -------------------------------------------------------------- # Mimic muscle_percent_define_default in ../src/muscle-tab.h exactly. That is, # if the %define variable VARIABLE is undefined, set its value to DEFAULT. # Don't record this as a Bison usage of VARIABLE as there's no reason to @@ -489,13 +824,45 @@ m4_define([b4_percent_define_flag_if], # # b4_percent_define_default([[foo]], [[default value]]) m4_define([b4_percent_define_default], -[m4_ifndef([b4_percent_define(]$1[)], +[b4_percent_define_ifdef_([$1], [], [m4_define([b4_percent_define(]$1[)], [$2])dnl + m4_define([b4_percent_define_kind(]$1[)], + [m4_default([$3], [keyword])])dnl m4_define([b4_percent_define_loc(]$1[)], [[[[:-1.-1]], [[:-1.-1]]]])dnl m4_define([b4_percent_define_syncline(]$1[)], [[]])])]) + +# b4_percent_define_if_define(NAME, [VARIABLE = NAME]) +# ---------------------------------------------------- +# Define b4_NAME_if that executes its $1 or $2 depending whether +# VARIABLE was %defined. The characters '.' and `-' in VARIABLE are mapped +# to '_'. +m4_define([b4_percent_define_if_define_], +[m4_define(m4_bpatsubst([b4_$1_if], [[-.]], [_]), + [b4_percent_define_flag_if(m4_default([$2], [$1]), + [$3], [$4])])]) +m4_define([b4_percent_define_if_define], +[b4_percent_define_default([m4_default([$2], [$1])], [[false]]) +b4_percent_define_if_define_([$1], [$2], $[1], $[2])]) + + +# b4_percent_define_check_kind(VARIABLE, KIND, [DIAGNOSTIC = complain]) +# --------------------------------------------------------------------- +m4_define([b4_percent_define_check_kind], +[b4_percent_define_ifdef_([$1], + [m4_if(b4_percent_define_get_kind([$1]), [$2], [], + [b4_error([m4_default([$3], [complain])], + b4_percent_define_get_loc([$1]), + [m4_case([$2], + [code], [[%%define variable '%s' requires '{...}' values]], + [keyword], [[%%define variable '%s' requires keyword values]], + [string], [[%%define variable '%s' requires '"..."' values]])], + [$1])])])dnl +]) + + # b4_percent_define_check_values(VALUES) # -------------------------------------- # Mimic muscle_percent_define_check_values in ../src/muscle-tab.h exactly @@ -517,8 +884,9 @@ m4_define([b4_percent_define_check_values], [_b4_percent_define_check_values(b4_sublist)])]) m4_define([_b4_percent_define_check_values], -[m4_ifdef([b4_percent_define(]$1[)], - [m4_pushdef([b4_good_value], [0])dnl +[b4_percent_define_ifdef_([$1], + [b4_percent_define_check_kind(]$1[, [keyword], [deprecated])dnl + m4_pushdef([b4_good_value], [0])dnl m4_if($#, 1, [], [m4_foreach([b4_value], m4_dquote(m4_shift($@)), [m4_if(m4_indir([b4_percent_define(]$1[)]), b4_value, @@ -529,11 +897,11 @@ m4_define([_b4_percent_define_check_values], [$1], m4_dquote(m4_indir([b4_percent_define(]$1[)]))) m4_foreach([b4_value], m4_dquote(m4_shift($@)), - [b4_complain_at(b4_percent_define_get_loc([$1]), + [b4_error([[note]], b4_percent_define_get_loc([$1]), [] [[accepted value: '%s']], m4_dquote(b4_value))])])dnl m4_popdef([b4_good_value])], - [b4_fatal([[b4_percent_define_check_values: undefined %%define variable '%s']], [$1])])]) + [b4_fatal([[$0: undefined %%define variable '%s']], [$1])])]) # b4_percent_code_get([QUALIFIER]) # -------------------------------- @@ -567,7 +935,58 @@ m4_popdef([b4_macro_name])]) m4_define([b4_percent_code_ifdef], [m4_ifdef([b4_percent_code(]$1[)], [m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])$2], - [$3])]) + [$3])]) + + +## ------------------ ## +## Common variables. ## +## ------------------ ## + + +# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT]) +# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT]) +# b4_token_ctor_if([IF-YYLEX-RETURNS-A-TOKEN], [IF-NOT]) +# ---------------------------------------------- +b4_percent_define_if_define([token_ctor], [api.token.constructor]) +b4_percent_define_if_define([locations]) # Whether locations are tracked. +b4_percent_define_if_define([parse.assert]) +b4_percent_define_if_define([parse.trace]) + + +# b4_bison_locations_if([IF-TRUE]) +# -------------------------------- +# Expand IF-TRUE if using locations, and using the default location +# type. +m4_define([b4_bison_locations_if], +[b4_locations_if([b4_percent_define_ifdef([[api.location.type]], [], [$1])])]) + + +# b4_error_verbose_if([IF-ERRORS-ARE-VERBOSE], [IF-NOT]) +# ------------------------------------------------------ +# Map %define parse.error "(simple|verbose)" to b4_error_verbose_if and +# b4_error_verbose_flag. +b4_percent_define_default([[parse.error]], [[simple]]) +b4_percent_define_check_values([[[[parse.error]], + [[simple]], [[verbose]]]]) +m4_define([b4_error_verbose_flag], + [m4_case(b4_percent_define_get([[parse.error]]), + [simple], [[0]], + [verbose], [[1]])]) +b4_define_flag_if([error_verbose]) + +# yytoken_table is needed to support verbose errors. +b4_error_verbose_if([m4_define([b4_token_table_flag], [1])]) + + +# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT]) +# ---------------------------------------------- +b4_percent_define_if_define([variant]) +m4_define([b4_variant_flag], [[0]]) +b4_percent_define_ifdef([[api.value.type]], + [m4_case(b4_percent_define_get_kind([[api.value.type]]), [keyword], + [m4_case(b4_percent_define_get([[api.value.type]]), [variant], + [m4_define([b4_variant_flag], [[1]])])])]) +b4_define_flag_if([variant]) ## ----------------------------------------------------------- ## @@ -601,10 +1020,46 @@ m4_define_default([b4_parse_param], []) m4_define_default([b4_location_initial_column], [1]) m4_define_default([b4_location_initial_line], [1]) -# Sanity checks. + +## --------------- ## +## Sanity checks. ## +## --------------- ## + +# api.location.prefix={...} (Java and C++). +b4_percent_define_check_kind([api.location.type], [code], [deprecated]) + +# api.position.prefix={...} (Java). +b4_percent_define_check_kind([api.position.type], [code], [deprecated]) + +# api.prefix >< %name-prefix. +b4_percent_define_check_kind([api.prefix], [code], [deprecated]) b4_percent_define_ifdef([api.prefix], [m4_ifdef([b4_prefix], [b4_complain_at(b4_percent_define_get_loc([api.prefix]), [['%s' and '%s' cannot be used together]], [%name-prefix], [%define api.prefix])])]) + +# api.token.prefix={...} +# Make it a warning for those who used betas of Bison 3.0. +b4_percent_define_check_kind([api.token.prefix], [code], [deprecated]) + +# api.value.type >< %union. +b4_percent_define_ifdef([api.value.type], +[m4_ifdef([b4_union_members], +[b4_complain_at(b4_percent_define_get_loc([api.value.type]), + [['%s' and '%s' cannot be used together]], + [%union], + [%define api.value.type])])]) + +# api.value.type=union >< %yacc. +b4_percent_define_ifdef([api.value.type], +[m4_if(b4_percent_define_get([api.value.type]), [union], +[b4_yacc_if(dnl +[b4_complain_at(b4_percent_define_get_loc([api.value.type]), + [['%s' and '%s' cannot be used together]], + [%yacc], + [%define api.value.type "union"])])])]) + +# api.value.union.name. +b4_percent_define_check_kind([api.value.union.name], [keyword]) diff --git a/data/c++-skel.m4 b/data/c++-skel.m4 index 06597a8..3cd5678 100644 --- a/data/c++-skel.m4 +++ b/data/c++-skel.m4 @@ -2,7 +2,8 @@ # C++ skeleton dispatching for Bison. -# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2007, 2009-2015, 2018 Free Software Foundation, +# Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/data/c++.m4 b/data/c++.m4 index 429b9e9..2d2a595 100644 --- a/data/c++.m4 +++ b/data/c++.m4 @@ -2,7 +2,7 @@ # C++ skeleton for Bison -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,13 +17,40 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Sanity checks, before defaults installed by c.m4. +b4_percent_define_ifdef([[api.value.union.name]], + [b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]), + [named %union is invalid in C++])]) + m4_include(b4_pkgdatadir/[c.m4]) +# b4_comment(TEXT, [PREFIX]) +# -------------------------- +# Put TEXT in comment. Prefix all the output lines with PREFIX. +m4_define([b4_comment], +[b4_comment_([$1], [$2// ], [$2// ])]) + +# b4_inline(hh|cc) +# ---------------- +# Expand to `inline\n ` if $1 is hh. +m4_define([b4_inline], +[m4_case([$1], + [cc], [], + [hh], [[inline + ]], + [m4_fatal([$0: invalid argument: $1])])]) + +## -------- ## +## Checks. ## +## -------- ## + +b4_percent_define_check_kind([api.namespace], [code], [deprecated]) +b4_percent_define_check_kind([parser_class_name], [code], [deprecated]) + ## ---------------- ## ## Default values. ## ## ---------------- ## -# Default parser class name. b4_percent_define_default([[parser_class_name]], [[parser]]) # Don't do that so that we remember whether we're using a user @@ -32,28 +59,32 @@ b4_percent_define_default([[parser_class_name]], [[parser]]) # b4_percent_define_default([[api.location.type]], [[location]]) b4_percent_define_default([[filename_type]], [[std::string]]) -b4_percent_define_default([[namespace]], m4_defn([b4_prefix])) +# Make it a warning for those who used betas of Bison 3.0. +b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix])) + b4_percent_define_default([[global_tokens_and_yystype]], [[false]]) b4_percent_define_default([[define_location_comparison]], [m4_if(b4_percent_define_get([[filename_type]]), [std::string], [[true]], [[false]])]) + ## ----------- ## ## Namespace. ## ## ----------- ## -m4_define([b4_namespace_ref], [b4_percent_define_get([[namespace]])]) +m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])]) -# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it -# would compile as an absolute reference with `parser' in the global namespace. + +# Don't permit an empty b4_namespace_ref. Any '::parser::foo' appended to it +# would compile as an absolute reference with 'parser' in the global namespace. # b4_namespace_open would open an anonymous namespace and thus establish # internal linkage. This would compile. However, it's cryptic, and internal # linkage for the parser would be specified in all translation units that # include the header, which is always generated. If we ever need to permit # internal linkage somehow, surely we can find a cleaner approach. m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [], -[b4_complain_at(b4_percent_define_get_loc([[namespace]]), +[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]), [[namespace reference is empty]])]) # Instead of assuming the C++ compiler will do it, Bison should reject any @@ -64,36 +95,36 @@ m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [], # Specifically, don't allow empty names as b4_namespace_open would just convert # those into anonymous namespaces, and that might tempt some users. m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [], -[b4_complain_at(b4_percent_define_get_loc([[namespace]]), +[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]), [[namespace reference has consecutive "::"]])]) m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [], -[b4_complain_at(b4_percent_define_get_loc([[namespace]]), +[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]), [[namespace reference has a trailing "::"]])]) m4_define([b4_namespace_open], -[b4_user_code([b4_percent_define_get_syncline([[namespace]]) +[b4_user_code([b4_percent_define_get_syncline([[api.namespace]]) [namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref), [^\(.\)[ ]*::], [\1])), [::], [ { namespace ])[ {]])]) m4_define([b4_namespace_close], -[b4_user_code([b4_percent_define_get_syncline([[namespace]]) +[b4_user_code([b4_percent_define_get_syncline([[api.namespace]]) m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]), [^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*], [\1])), [::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])]) -# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ----------------------------------------------------- +# b4_token_enums +# -------------- # Output the definition of the tokens as enums. m4_define([b4_token_enums], -[/* Tokens. */ - enum yytokentype { -m4_map_sep([ b4_token_enum], [, -], - [$@]) - }; +[[enum yytokentype + { + ]m4_join([, + ], + b4_symbol_map([b4_token_enum]))[ + };]dnl ]) @@ -104,11 +135,343 @@ m4_map_sep([ b4_token_enum], [, ## ----------------- ## + +# b4_value_type_declare +# --------------------- +# Declare semantic_type. +m4_define([b4_value_type_declare], +[b4_value_type_setup[]dnl +[ /// Symbol semantic values. +]m4_bmatch(b4_percent_define_get_kind([[api.value.type]]), +[code], +[[ typedef ]b4_percent_define_get([[api.value.type]])[ semantic_type;]], +[m4_bmatch(b4_percent_define_get([[api.value.type]]), +[union\|union-directive], +[[ union semantic_type + { + ]b4_user_union_members[ + };]])])dnl +]) + + +# b4_public_types_declare +# ----------------------- +# Define the public types: token, semantic value, location, and so forth. +# Depending on %define token_lex, may be output in the header or source file. +m4_define([b4_public_types_declare], +[[#ifndef ]b4_api_PREFIX[STYPE +]b4_value_type_declare[ +#else + typedef ]b4_api_PREFIX[STYPE semantic_type; +#endif]b4_locations_if([ + /// Symbol locations. + typedef b4_percent_define_get([[api.location.type]], + [[location]]) location_type;])[ + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m);]b4_locations_if([ + location_type location;])[ + }; + + /// Tokens. + struct token + { + ]b4_token_enums[ + }; + + /// (External) token type, as returned by yylex. + typedef token::yytokentype token_type; + + /// Symbol type: an internal symbol number. + typedef int symbol_number_type; + + /// The symbol type number to denote an empty symbol. + enum { empty_symbol = -2 }; + + /// Internal symbol number for tokens (subsumed by symbol_number_type). + typedef ]b4_int_type_for([b4_translate])[ token_number_type; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol type + /// via type_get(). + /// + /// Provide access to semantic value]b4_locations_if([ and location])[. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol (); + + /// Copy constructor. + basic_symbol (const basic_symbol& other); +]b4_variant_if([[ + /// Constructor for valueless symbols, and symbols from each type. +]b4_type_foreach([b4_basic_symbol_constructor_declare])], [[ + /// Constructor for valueless symbols. + basic_symbol (typename Base::kind_type t]b4_locations_if([, + const location_type& l])[);]])[ + + /// Constructor for symbols with semantic value. + basic_symbol (typename Base::kind_type t, + const semantic_type& v]b4_locations_if([, + const location_type& l])[); + + /// Destroy the symbol. + ~basic_symbol (); + + /// Destroy contents, and record that is empty. + void clear (); + + /// Whether empty. + bool empty () const; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value;]b4_locations_if([ + + /// The location. + location_type location;])[ + + private: + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& other); + }; + + /// Type access provider for token (enum) based symbols. + struct by_type + { + /// Default constructor. + by_type (); + + /// Copy constructor. + by_type (const by_type& other); + + /// The symbol type as needed by the constructor. + typedef token_type kind_type; + + /// Constructor from (external) token numbers. + by_type (kind_type t); + + /// Record that this symbol is empty. + void clear (); + + /// Steal the symbol type from \a that. + void move (by_type& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_number_type type_get () const; + + /// The token. + token_type token () const; + + /// The symbol type. + /// \a empty_symbol when empty. + /// An int, not token_number_type, to be able to store empty_symbol. + int type; + }; + + /// "External" symbols: returned by the scanner. + typedef basic_symbol symbol_type; + +]b4_symbol_constructor_declare]) + + +# b4_public_types_define(hh|cc) +# ----------------------------- +# Provide the implementation needed by the public types. +m4_define([b4_public_types_define], +[ b4_inline([$1])b4_parser_class_name[::syntax_error::syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m) + : std::runtime_error (m)]b4_locations_if([ + , location (l)])[ + {} + + // basic_symbol. + template + ]b4_parser_class_name[::basic_symbol::basic_symbol () + : value () + {} + + template + ]b4_parser_class_name[::basic_symbol::basic_symbol (const basic_symbol& other) + : Base (other) + , value ()]b4_locations_if([ + , location (other.location)])[ + { + ]b4_variant_if([b4_symbol_variant([other.type_get ()], [value], [copy], + [other.value])], + [value = other.value;])[ + } + + template + ]b4_parser_class_name[::basic_symbol::basic_symbol (]b4_join( + [typename Base::kind_type t], + [const semantic_type& v], + b4_locations_if([const location_type& l]))[) + : Base (t) + , value (]b4_variant_if([], [v])[)]b4_locations_if([ + , location (l)])[ + {]b4_variant_if([[ + (void) v; + ]b4_symbol_variant([this->type_get ()], [value], [copy], [v])])[} + +]b4_variant_if([[ + // Implementation of basic_symbol constructor for each type. +]b4_type_foreach([b4_basic_symbol_constructor_define])], [[ + /// Constructor for valueless symbols. + template + ]b4_parser_class_name[::basic_symbol::basic_symbol (]b4_join( + [typename Base::kind_type t], + b4_locations_if([const location_type& l]))[) + : Base (t) + , value ()]b4_locations_if([ + , location (l)])[ + {}]])[ + + template + ]b4_parser_class_name[::basic_symbol::~basic_symbol () + { + clear (); + } + + template + void + ]b4_parser_class_name[::basic_symbol::clear () + {]b4_variant_if([[ + // User destructor. + symbol_number_type yytype = this->type_get (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yytype) + { +]b4_symbol_foreach([b4_symbol_destructor])dnl +[ default: + break; + } + + // Type destructor. + ]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[ + Base::clear (); + } + + template + bool + ]b4_parser_class_name[::basic_symbol::empty () const + { + return Base::type_get () == empty_symbol; + } + + template + void + ]b4_parser_class_name[::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + ]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [move], + [s.value])], + [value = s.value;])[]b4_locations_if([ + location = s.location;])[ + } + + // by_type. + ]b4_inline([$1])b4_parser_class_name[::by_type::by_type () + : type (empty_symbol) + {} + + ]b4_inline([$1])b4_parser_class_name[::by_type::by_type (const by_type& other) + : type (other.type) + {} + + ]b4_inline([$1])b4_parser_class_name[::by_type::by_type (token_type t) + : type (yytranslate_ (t)) + {} + + ]b4_inline([$1])[void + ]b4_parser_class_name[::by_type::clear () + { + type = empty_symbol; + } + + ]b4_inline([$1])[void + ]b4_parser_class_name[::by_type::move (by_type& that) + { + type = that.type; + that.clear (); + } + + ]b4_inline([$1])[int + ]b4_parser_class_name[::by_type::type_get () const + { + return type; + } +]b4_token_ctor_if([[ + ]b4_inline([$1])b4_parser_class_name[::token_type + ]b4_parser_class_name[::by_type::token () const + { + // YYTOKNUM[NUM] -- (External) token number corresponding to the + // (internal) symbol number NUM (which must be that of a token). */ + static + const ]b4_int_type_for([b4_toknum])[ + yytoken_number_[] = + { + ]b4_toknum[ + }; + return static_cast (yytoken_number_[type]); + } +]])[]dnl +b4_symbol_constructor_define]) + + +# b4_symbol_constructor_declare +# b4_symbol_constructor_define +# ----------------------------- +# Declare/define symbol constructors for all the value types. +# Use at class-level. Redefined in variant.hh. +m4_define([b4_symbol_constructor_declare], []) +m4_define([b4_symbol_constructor_define], []) + + +# b4_yytranslate_define(cc|hh) +# ---------------------------- +# Define yytranslate_. Sometimes used in the header file ($1=hh), +# sometimes in the cc file. +m4_define([b4_yytranslate_define], +[[ // Symbol number corresponding to token number t. + ]b4_inline([$1])b4_parser_class_name[::token_number_type + ]b4_parser_class_name[::yytranslate_ (]b4_token_ctor_if([token_type], + [int])[ t) + { + static + const token_number_type + translate_table[] = + { +]b4_translate[ + }; + const unsigned user_token_number_max_ = ]b4_user_token_number_max[; + const token_number_type undef_token_ = ]b4_undef_token_number[; + + if (static_cast (t) <= yyeof_) + return yyeof_; + else if (static_cast (t) <= user_token_number_max_) + return translate_table[t]; + else + return undef_token_; + } +]]) + + # b4_lhs_value([TYPE]) # -------------------- # Expansion of $$. m4_define([b4_lhs_value], -[(yyval[]m4_ifval([$1], [.$1]))]) +[b4_symbol_value([yyval], [$1])]) # b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) @@ -116,7 +479,8 @@ m4_define([b4_lhs_value], # Expansion of $NUM, where the current rule has RULE-LENGTH # symbols on RHS. m4_define([b4_rhs_value], -[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))]) +[b4_symbol_value([yysemantic_stack_@{($1) - ($2)@}], [$3])]) + # b4_lhs_location() # ----------------- @@ -153,27 +517,27 @@ m4_define([b4_parse_param_decl_1], # Extra initialisations of the constructor. m4_define([b4_parse_param_cons], [m4_ifset([b4_parse_param], - [ + [ b4_cc_constructor_calls(b4_parse_param)])]) m4_define([b4_cc_constructor_calls], - [m4_map_sep([b4_cc_constructor_call], [, + [m4_map_sep([b4_cc_constructor_call], [, ], [$@])]) m4_define([b4_cc_constructor_call], - [$2 ($2_yyarg)]) + [$2 ($2_yyarg)]) # b4_parse_param_vars # ------------------- # Extra instance variables. m4_define([b4_parse_param_vars], [m4_ifset([b4_parse_param], - [ - /* User arguments. */ + [ + // User arguments. b4_cc_var_decls(b4_parse_param)])]) m4_define([b4_cc_var_decls], - [m4_map_sep([b4_cc_var_decl], [ + [m4_map_sep([b4_cc_var_decl], [ ], [$@])]) m4_define([b4_cc_var_decl], - [ $1;]) + [ $1;]) ## ---------## @@ -203,3 +567,13 @@ m4_define([b4_yylloc_default_define], while (/*CONSTCOND*/ false) # endif ]]) + +## -------- ## +## Checks. ## +## -------- ## + +b4_token_ctor_if([b4_variant_if([], + [b4_fatal_at(b4_percent_define_get_loc(api.token.constructor), + [cannot use '%s' without '%s'], + [%define api.token.constructor], + [%define api.value.type variant]))])]) diff --git a/data/c-like.m4 b/data/c-like.m4 index 4ee310d..26bab42 100644 --- a/data/c-like.m4 +++ b/data/c-like.m4 @@ -2,7 +2,7 @@ # Common code for C-like languages (C, C++, Java, etc.) -# Copyright (C) 2012-2013 Free Software Foundation, Inc. +# Copyright (C) 2012-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,16 +17,37 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# b4_comment_(TEXT, OPEN, CONTINUE, END) +# -------------------------------------- +# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines. +# Avoid adding indentation to the first line, as the indentation comes +# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]). +# +# Prefix all the output lines with PREFIX. +m4_define([b4_comment_], +[$2[]m4_bpatsubst(m4_expand([[$1]]), [ +\(.\)], [ +$3\1])$4]) + + +# b4_comment(TEXT, [PREFIX]) +# -------------------------- +# Put TEXT in comment. Prefix all the output lines with PREFIX. +m4_define([b4_comment], +[b4_comment_([$1], [$2/* ], [$2 ], [ */])]) + + + + # b4_dollar_dollar_(VALUE, FIELD, DEFAULT-FIELD) # ---------------------------------------------- # If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD", # otherwise just VALUE. Be sure to pass "(VALUE)" is VALUE is a # pointer. m4_define([b4_dollar_dollar_], -[m4_if([$2], [[]], - [m4_ifval([$3], [($1.$3)], - [$1])], - [($1.$2)])]) +[b4_symbol_value([$1], + m4_if([$2], [[]], + [[$3]], [[$2]]))]) # b4_dollar_pushdef(VALUE-POINTER, DEFAULT-FIELD, LOCATION) # b4_dollar_popdef diff --git a/data/c-skel.m4 b/data/c-skel.m4 index 36904aa..cb9a7a2 100644 --- a/data/c-skel.m4 +++ b/data/c-skel.m4 @@ -2,7 +2,8 @@ # C skeleton dispatching for Bison. -# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2007, 2009-2015, 2018 Free Software Foundation, +# Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/data/c.m4 b/data/c.m4 index b1b6e28..f2006b3 100644 --- a/data/c.m4 +++ b/data/c.m4 @@ -2,7 +2,7 @@ # C M4 Macros for Bison. -# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2002, 2004-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,12 +51,6 @@ m4_define([b4_cpp_guard_close], ## Identification. ## ## ---------------- ## -# b4_comment(TEXT) -# ---------------- -m4_define([b4_comment], [/* m4_bpatsubst([$1], [ -], [ - ]) */]) - # b4_identification # ----------------- # Depends on individual skeletons to define b4_pure_flag, b4_push_flag, or @@ -103,17 +97,35 @@ m4_define([b4_api_PREFIX], m4_define_default([b4_prefix], [b4_api_prefix]) # If the %union is not named, its name is YYSTYPE. -m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE]) +b4_percent_define_default([[api.value.union.name]], + [b4_api_PREFIX[][STYPE]]) ## ------------------------ ## ## Pure/impure interfaces. ## ## ------------------------ ## +# b4_lex_formals +# -------------- +# All the yylex formal arguments. +# b4_lex_param arrives quoted twice, but we want to keep only one level. +m4_define([b4_lex_formals], +[b4_pure_if([[[[YYSTYPE *yylvalp]], [[&yylval]]][]dnl +b4_locations_if([, [[YYLTYPE *yyllocp], [&yylloc]]])])dnl +m4_ifdef([b4_lex_param], [, ]b4_lex_param)]) + + +# b4_lex +# ------ +# Call yylex. +m4_define([b4_lex], +[b4_function_call([yylex], [int], b4_lex_formals)]) + + # b4_user_args # ------------ m4_define([b4_user_args], -[m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])]) +[m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])]) # b4_parse_param @@ -137,11 +149,13 @@ m4_popdef([$2])dnl m4_popdef([$1])dnl ])]) -# b4_parse_param_use -# ------------------ -# `YYUSE' all the parse-params. +# b4_parse_param_use([VAL], [LOC]) +# -------------------------------- +# 'YYUSE' VAL, LOC if locations are enabled, and all the parse-params. m4_define([b4_parse_param_use], -[b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal); +[m4_ifvaln([$1], [ YYUSE ([$1]);])dnl +b4_locations_if([m4_ifvaln([$2], [ YYUSE ([$2]);])])dnl +b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal); ])dnl ]) @@ -169,7 +183,7 @@ m4_define([b4_int_type], # b4_int_type_for(NAME) # --------------------- # Return the smallest int type able to handle numbers ranging from -# `NAME_min' to `NAME_max' (included). +# 'NAME_min' to 'NAME_max' (included). m4_define([b4_int_type_for], [b4_int_type($1_min, $1_max)]) @@ -178,12 +192,11 @@ m4_define([b4_int_type_for], # -------------------------------------------- # Without inducing a comparison warning from the compiler, check if the # literal value LITERAL equals VALUE from table TABLE, which must have -# TABLE_min and TABLE_max defined. YYID must be defined as an identity -# function that suppresses warnings about constant conditions. +# TABLE_min and TABLE_max defined. m4_define([b4_table_value_equals], [m4_if(m4_eval($3 < m4_indir([b4_]$1[_min]) || m4_indir([b4_]$1[_max]) < $3), [1], - [[YYID (0)]], + [[0]], [(!!(($2) == ($3)))])]) @@ -193,13 +206,32 @@ m4_define([b4_table_value_equals], # b4_attribute_define # ------------------- -# Provide portability for __attribute__. +# Provide portable compiler "attributes". m4_define([b4_attribute_define], -[#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ +[#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif @@ -209,19 +241,43 @@ m4_define([b4_attribute_define], #else # define YYUSE(E) /* empty */ #endif + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif ]) +## ---------## +## Values. ## +## ---------## + + # b4_null_define # -------------- -# Portability issues: define a YY_NULL appropriate for the current +# Portability issues: define a YY_NULLPTR appropriate for the current # language (C, C++98, or C++11). m4_define([b4_null_define], -[# ifndef YY_NULL +[# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif[]dnl ]) @@ -230,193 +286,150 @@ m4_define([b4_null_define], # b4_null # ------- # Return a null pointer constant. -m4_define([b4_null], [YY_NULL]) +m4_define([b4_null], [YY_NULLPTR]) +# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT) +# ------------------------------------------------------------- +# Define "yy" whose contents is CONTENT. +m4_define([b4_integral_parser_table_define], +[m4_ifvaln([$3], [b4_comment([$3], [ ])])dnl +static const b4_int_type_for([$2]) yy$1[[]] = +{ + $2 +};dnl +]) ## ------------------------- ## ## Assigning token numbers. ## ## ------------------------- ## -# b4_token_define(TOKEN-NAME, TOKEN-NUMBER) -# ----------------------------------------- +# b4_token_define(TOKEN-NUM) +# -------------------------- # Output the definition of this token as #define. m4_define([b4_token_define], -[#define $1 $2 -]) +[b4_token_format([#define %s %s], [$1])]) - -# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ------------------------------------------------------- -# Output the definition of the tokens (if there are) as #defines. +# b4_token_defines +# ---------------- +# Output the definition of the tokens. m4_define([b4_token_defines], -[m4_if([$#$1], [1], [], -[/* Tokens. */ -m4_map([b4_token_define], [$@])]) -]) +[b4_any_token_visible_if([/* Tokens. */ +m4_join([ +], b4_symbol_map([b4_token_define])) +])]) -# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER) -# --------------------------------------- +# b4_token_enum(TOKEN-NUM) +# ------------------------ # Output the definition of this token as an enum. m4_define([b4_token_enum], -[$1 = $2]) +[b4_token_format([%s = %s], [$1])]) -# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ----------------------------------------------------- +# b4_token_enums +# -------------- # Output the definition of the tokens (if there are) as enums. m4_define([b4_token_enums], -[m4_if([$#$1], [1], [], -[[/* Tokens. */ +[b4_any_token_visible_if([[/* Token type. */ #ifndef ]b4_api_PREFIX[TOKENTYPE # define ]b4_api_PREFIX[TOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum ]b4_api_prefix[tokentype { -]m4_map_sep([ b4_token_enum], [, -], - [$@])[ - }; + enum ]b4_api_prefix[tokentype + { + ]m4_join([, + ], + b4_symbol_map([b4_token_enum]))[ + }; #endif ]])]) -# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ------------------------------------------------------------- -# Output the definition of the tokens (if there are any) as enums and, if POSIX -# Yacc is enabled, as #defines. +# b4_token_enums_defines +# ---------------------- +# Output the definition of the tokens (if there are any) as enums and, +# if POSIX Yacc is enabled, as #defines. m4_define([b4_token_enums_defines], -[b4_token_enums($@)b4_yacc_if([b4_token_defines($@)], []) -]) +[b4_token_enums[]b4_yacc_if([b4_token_defines])]) +## ----------------- ## +## Semantic Values. ## +## ----------------- ## -## --------------------------------------------- ## -## Defining C functions in both K&R and ANSI-C. ## -## --------------------------------------------- ## +# b4_symbol_value(VAL, [TYPE]) +# ---------------------------- +# Given a semantic value VAL ($$, $1 etc.), extract its value of type +# TYPE if TYPE is given, otherwise just return VAL. The result can be +# used safetly, it is put in parens to avoid nasty precedence issues. +# TYPE is *not* put in braces, provide some if needed. +m4_define([b4_symbol_value], +[($1[]m4_ifval([$2], [.$2]))]) -# b4_modern_c -# ----------- -# A predicate useful in #if to determine whether C is ancient or modern. -# -# If __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run -# as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic -# reasons, but it defines __C99__FUNC__ so check that as well. -# Microsoft C normally doesn't define these macros, but it defines _MSC_VER. -# Consider a C++ compiler to be modern if it defines __cplusplus. -# -m4_define([b4_c_modern], - [[(defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER)]]) -# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# ---------------------------------------------------------- -# Declare the function NAME. -m4_define([b4_c_function_def], -[#if b4_c_modern -b4_c_ansi_function_def($@) -#else -$2 -$1 (b4_c_knr_formal_names(m4_shift2($@))) -b4_c_knr_formal_decls(m4_shift2($@)) -#endif[]dnl -]) + +## ---------------------- ## +## Defining C functions. ## +## ---------------------- ## -# b4_c_ansi_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# --------------------------------------------------------------- -# Declare the function NAME in ANSI. -m4_define([b4_c_ansi_function_def], +# b4_function_define(NAME, RETURN-VALUE, [DECL1, NAME1], ...) +# ----------------------------------------------------------- +# Declare the function NAME in C. +m4_define([b4_function_define], [$2 -$1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl +$1 (b4_formals(m4_shift2($@)))[]dnl ]) -# b4_c_ansi_formals([DECL1, NAME1], ...) -# -------------------------------------- -# Output the arguments ANSI-C definition. -m4_define([b4_c_ansi_formals], +# b4_formals([DECL1, NAME1], ...) +# ------------------------------- +# The formal arguments of a C function definition. +m4_define([b4_formals], [m4_if([$#], [0], [void], [$#$1], [1], [void], - [m4_map_sep([b4_c_ansi_formal], [, ], [$@])])]) + [m4_map_sep([b4_formal], [, ], [$@])])]) -m4_define([b4_c_ansi_formal], +m4_define([b4_formal], [$1]) -# b4_c_knr_formal_names([DECL1, NAME1], ...) -# ------------------------------------------ -# Output the argument names. -m4_define([b4_c_knr_formal_names], -[m4_map_sep([b4_c_knr_formal_name], [, ], [$@])]) -m4_define([b4_c_knr_formal_name], -[$2]) +## ----------------------- ## +## Declaring C functions. ## +## ----------------------- ## -# b4_c_knr_formal_decls([DECL1, NAME1], ...) -# ------------------------------------------ -# Output the K&R argument declarations. -m4_define([b4_c_knr_formal_decls], -[m4_map_sep([b4_c_knr_formal_decl], - [ -], - [$@])]) - -m4_define([b4_c_knr_formal_decl], -[ $1;]) - - - -## ------------------------------------------------------------ ## -## Declaring (prototyping) C functions in both K&R and ANSI-C. ## -## ------------------------------------------------------------ ## - - -# b4_c_ansi_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# ---------------------------------------------------------------- -# Declare the function NAME ANSI C style. -m4_define([b4_c_ansi_function_decl], -[$2 $1 (b4_c_ansi_formals(m4_shift2($@)));[]dnl +# b4_function_declare(NAME, RETURN-VALUE, [DECL1, NAME1], ...) +# ------------------------------------------------------------ +# Declare the function NAME. +m4_define([b4_function_declare], +[$2 $1 (b4_formals(m4_shift2($@)));[]dnl ]) -# b4_c_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...) -# ----------------------------------------------------------- -# Declare the function NAME in both K&R and ANSI C. -m4_define([b4_c_function_decl], -[#if defined __STDC__ || defined __cplusplus -b4_c_ansi_function_decl($@) -#else -$2 $1 (); -#endif[]dnl -]) - - ## --------------------- ## ## Calling C functions. ## ## --------------------- ## -# b4_c_function_call(NAME, RETURN-VALUE, [DECL1, NAME1], ...) +# b4_function_call(NAME, RETURN-VALUE, [DECL1, NAME1], ...) # ----------------------------------------------------------- # Call the function NAME with arguments NAME1, NAME2 etc. -m4_define([b4_c_function_call], -[$1 (b4_c_args(m4_shift2($@)))[]dnl +m4_define([b4_function_call], +[$1 (b4_args(m4_shift2($@)))[]dnl ]) -# b4_c_args([DECL1, NAME1], ...) -# ------------------------------ +# b4_args([DECL1, NAME1], ...) +# ---------------------------- # Output the arguments NAME1, NAME2... -m4_define([b4_c_args], -[m4_map_sep([b4_c_arg], [, ], [$@])]) +m4_define([b4_args], +[m4_map_sep([b4_arg], [, ], [$@])]) -m4_define([b4_c_arg], +m4_define([b4_arg], [$2]) @@ -438,53 +451,28 @@ m4_define([b4_sync_start], [[#]line $1 $2]) m4_define([b4_case], [ case $1: $2 +b4_syncline([@oline@], [@ofile@]) break;]) -# _b4_symbol_actions(FILENAME, LINENO, -# SYMBOL-TAG, SYMBOL-NUM, -# SYMBOL-ACTION, SYMBOL-TYPENAME) -# -------------------------------------------------- -# Issue the code for a symbol action (e.g., %printer). -# -# Define b4_dollar_dollar([TYPE-NAME]), and b4_at_dollar, which are -# invoked where $$ and @$ were specified by the user. -m4_define([_b4_symbol_actions], -[b4_dollar_pushdef([(*yyvaluep)], [$6], [(*yylocationp)])dnl - case $4: /* $3 */ -b4_syncline([$2], [$1]) - $5; + +# b4_predicate_case(LABEL, CONDITIONS) +# ------------------------------------ +m4_define([b4_predicate_case], +[ case $1: + if (! ($2)) YYERROR; b4_syncline([@oline@], [@ofile@]) - break; -b4_dollar_popdef[]dnl -]) + break;]) -# b4_symbol_actions(KIND) -# ----------------------- -# Emit the symbol actions for KIND ("printers" or "destructors"). -# Dispatch on "yytype". -m4_define([b4_symbol_actions], -[m4_ifval(m4_defn([b4_symbol_$1]), -[[switch (yytype) - { -]m4_map([_b4_symbol_actions], m4_defn([b4_symbol_$1]))[ - default: - break; - }]], -[YYUSE (yytype);])]) - - -# b4_yydestruct_generate(FUNCTION-DECLARATOR) -# ------------------------------------------- -# Generate the "yydestruct" function, which declaration is issued using -# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C -# or "b4_c_function_def" for K&R. -m4_define_default([b4_yydestruct_generate], + +# b4_yydestruct_define +# -------------------- +# Define the "yydestruct" function. +m4_define_default([b4_yydestruct_define], [[/*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -]$1([yydestruct], +]b4_function_define([yydestruct], [static void], [[const char *yymsg], [yymsg]], [[int yytype], [yytype]], @@ -492,33 +480,28 @@ m4_define_default([b4_yydestruct_generate], b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl m4_ifset([b4_parse_param], [, b4_parse_param]))[ { - YYUSE (yyvaluep); -]b4_locations_if([ YYUSE (yylocationp); -])dnl -b4_parse_param_use[]dnl -[ - if (!yymsg) +]b4_parse_param_use([yyvaluep], [yylocationp])dnl +[ if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - ]b4_symbol_actions([destructors])[ + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + ]b4_symbol_actions([destructor])[ + YY_IGNORE_MAYBE_UNINITIALIZED_END }]dnl ]) -# b4_yy_symbol_print_generate(FUNCTION-DECLARATOR) -# ------------------------------------------------ -# Generate the "yy_symbol_print" function, which declaration is issued using -# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C -# or "b4_c_function_def" for K&R. -m4_define_default([b4_yy_symbol_print_generate], +# b4_yy_symbol_print_define +# ------------------------- +# Define the "yy_symbol_print" function. +m4_define_default([b4_yy_symbol_print_define], [[ -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -]$1([yy_symbol_value_print], +]b4_function_define([yy_symbol_value_print], [static void], [[FILE *yyoutput], [yyoutput]], [[int yytype], [yytype]], @@ -527,19 +510,17 @@ b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl m4_ifset([b4_parse_param], [, b4_parse_param]))[ { FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; -]b4_locations_if([ YYUSE (yylocationp); -])dnl -b4_parse_param_use[]dnl -[# ifdef YYPRINT +]b4_parse_param_use([yyo], [yylocationp])dnl +[ if (!yyvaluep) + return;] +dnl glr.c does not feature yytoknum. +m4_if(b4_skeleton, ["yacc.c"], +[[# ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - ]b4_symbol_actions([printers])[ +]])dnl + b4_symbol_actions([printer])[ } @@ -547,7 +528,7 @@ b4_parse_param_use[]dnl | Print this symbol on YYOUTPUT. | `--------------------------------*/ -]$1([yy_symbol_print], +]b4_function_define([yy_symbol_print], [static void], [[FILE *yyoutput], [yyoutput]], [[int yytype], [yytype]], @@ -555,10 +536,8 @@ b4_parse_param_use[]dnl b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl m4_ifset([b4_parse_param], [, b4_parse_param]))[ { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); ]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); @@ -569,63 +548,206 @@ b4_locations_if([, yylocationp])[]b4_user_args[); }]dnl ]) + +## ---------------- ## +## api.value.type. ## +## ---------------- ## + + +# ---------------------- # +# api.value.type=union. # +# ---------------------- # + +# b4_symbol_type_register(SYMBOL-NUM) +# ----------------------------------- +# Symbol SYMBOL-NUM has a type (for variant) instead of a type-tag. +# Extend the definition of %union's body (b4_union_members) with a +# field of that type, and extend the symbol's "type" field to point to +# the field name, instead of the type name. +m4_define([b4_symbol_type_register], +[m4_define([b4_symbol($1, type_tag)], + [b4_symbol_if([$1], [has_id], + [b4_symbol([$1], [id])], + [yytype_[]b4_symbol([$1], [number])])])dnl +m4_append([b4_union_members], +m4_expand([ + b4_symbol_tag_comment([$1])dnl + b4_symbol([$1], [type]) b4_symbol([$1], [type_tag]);])) +]) + + +# b4_type_define_tag(SYMBOL1-NUM, ...) +# ------------------------------------ +# For the batch of symbols SYMBOL1-NUM... (which all have the same +# type), enhance the %union definition for each of them, and set +# there "type" field to the field tag name, instead of the type name. +m4_define([b4_type_define_tag], +[b4_symbol_if([$1], [has_type], + [m4_map([b4_symbol_type_register], [$@])]) +]) + + +# b4_symbol_value_union(VAL, [TYPE]) +# ---------------------------------- +# Same of b4_symbol_value, but when api.value.type=union. +m4_define([b4_symbol_value_union], +[m4_ifval([$2], + [(*($2*)(&$1))], + [$1])]) +]) + + +# b4_value_type_setup_union +# ------------------------- +# Setup support for api.value.type=union. Symbols are defined with a +# type instead of a union member name: build the corresponding union, +# and give the symbols their tag. +m4_define([b4_value_type_setup_union], +[m4_define([b4_union_members]) +b4_type_foreach([b4_type_define_tag]) +m4_copy_force([b4_symbol_value_union], [b4_symbol_value]) +]) + + +# -------------------------- # +# api.value.type = variant. # +# -------------------------- # + +# b4_value_type_setup_variant +# --------------------------- +# Setup support for api.value.type=variant. By default, fail, specialized +# by other skeletons. +m4_define([b4_value_type_setup_variant], +[b4_complain_at(b4_percent_define_get_loc([[api.value.type]]), + [['%s' does not support '%s']], + [b4_skeleton], + [%define api.value.type variant])]) + + +# _b4_value_type_setup_keyword +# ---------------------------- +# api.value.type is defined with a keyword/string syntax. Check if +# that is properly defined, and prepare its use. +m4_define([_b4_value_type_setup_keyword], +[b4_percent_define_check_values([[[[api.value.type]], + [[none]], + [[union]], + [[union-directive]], + [[variant]], + [[yystype]]]])dnl +m4_case(b4_percent_define_get([[api.value.type]]), + [union], [b4_value_type_setup_union], + [variant], [b4_value_type_setup_variant])]) + + +# b4_value_type_setup +# ------------------- +# Check if api.value.type is properly defined, and possibly prepare +# its use. +b4_define_silent([b4_value_type_setup], +[# Define default value. +b4_percent_define_ifdef([[api.value.type]], [], +[# %union => api.value.type=union-directive +m4_ifdef([b4_union_members], +[m4_define([b4_percent_define_kind(api.value.type)], [keyword]) +m4_define([b4_percent_define(api.value.type)], [union-directive])], +[# no tag seen => api.value.type={int} +m4_if(b4_tag_seen_flag, 0, +[m4_define([b4_percent_define_kind(api.value.type)], [code]) +m4_define([b4_percent_define(api.value.type)], [int])], +[# otherwise api.value.type=yystype +m4_define([b4_percent_define_kind(api.value.type)], [keyword]) +m4_define([b4_percent_define(api.value.type)], [yystype])])])]) + +# Set up. +m4_bmatch(b4_percent_define_get_kind([[api.value.type]]), + [keyword\|string], [_b4_value_type_setup_keyword]) +]) + + ## -------------- ## ## Declarations. ## ## -------------- ## -# b4_declare_yylstype -# ------------------- -# Declarations that might either go into the header (if --defines) or -# in the parser body. Declare YYSTYPE/YYLTYPE, and yylval/yylloc. -m4_define([b4_declare_yylstype], + +# b4_value_type_define +# -------------------- +m4_define([b4_value_type_define], +[b4_value_type_setup[]dnl +/* Value type. */ +m4_bmatch(b4_percent_define_get_kind([[api.value.type]]), +[code], +[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED +typedef ]b4_percent_define_get([[api.value.type]])[ ]b4_api_PREFIX[STYPE; +# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1 +# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1 +#endif +]], +[m4_bmatch(b4_percent_define_get([[api.value.type]]), +[union\|union-directive], [[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED -]m4_ifdef([b4_stype], -[[typedef union ]b4_union_name[ +]b4_percent_define_get_syncline([[api.value.union.name]])[ +union ]b4_percent_define_get([[api.value.union.name]])[ { -]b4_user_stype[ -} ]b4_api_PREFIX[STYPE; -# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]], -[m4_if(b4_tag_seen_flag, 0, -[[typedef int ]b4_api_PREFIX[STYPE; -# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]])])[ -# define ]b4_api_prefix[stype ]b4_api_PREFIX[STYPE /* obsolescent; will be withdrawn */ +]b4_user_union_members[ +}; +]b4_percent_define_get_syncline([[api.value.union.name]])[ +typedef union ]b4_percent_define_get([[api.value.union.name]])[ ]b4_api_PREFIX[STYPE; +# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1 # define ]b4_api_PREFIX[STYPE_IS_DECLARED 1 -#endif]b4_locations_if([[ +#endif +]])])]) + +# b4_location_type_define +# ----------------------- +m4_define([b4_location_type_define], +[[/* Location type. */ #if ! defined ]b4_api_PREFIX[LTYPE && ! defined ]b4_api_PREFIX[LTYPE_IS_DECLARED -typedef struct ]b4_api_PREFIX[LTYPE +typedef struct ]b4_api_PREFIX[LTYPE ]b4_api_PREFIX[LTYPE; +struct ]b4_api_PREFIX[LTYPE { int first_line; int first_column; int last_line; int last_column; -} ]b4_api_PREFIX[LTYPE; -# define ]b4_api_prefix[ltype ]b4_api_PREFIX[LTYPE /* obsolescent; will be withdrawn */ +}; # define ]b4_api_PREFIX[LTYPE_IS_DECLARED 1 # define ]b4_api_PREFIX[LTYPE_IS_TRIVIAL 1 -#endif]]) +#endif +]]) + + +# b4_declare_yylstype +# ------------------- +# Declarations that might either go into the header (if --defines) or +# in the parser body. Declare YYSTYPE/YYLTYPE, and yylval/yylloc. +m4_define([b4_declare_yylstype], +[b4_value_type_define[]b4_locations_if([ +b4_location_type_define]) b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval; ]b4_locations_if([[extern ]b4_api_PREFIX[LTYPE ]b4_prefix[lloc;]])])[]dnl ]) + # b4_YYDEBUG_define -# ------------------ +# ----------------- m4_define([b4_YYDEBUG_define], -[[/* Enabling traces. */ +[[/* Debug traces. */ ]m4_if(b4_api_prefix, [yy], [[#ifndef YYDEBUG -# define YYDEBUG ]b4_debug_flag[ +# define YYDEBUG ]b4_parse_trace_if([1], [0])[ #endif]], [[#ifndef ]b4_api_PREFIX[DEBUG # if defined YYDEBUG -# if YYDEBUG +#if YYDEBUG # define ]b4_api_PREFIX[DEBUG 1 # else # define ]b4_api_PREFIX[DEBUG 0 # endif # else /* ! defined YYDEBUG */ -# define ]b4_api_PREFIX[DEBUG ]b4_debug_flag[ +# define ]b4_api_PREFIX[DEBUG ]b4_parse_trace_if([1], [0])[ # endif /* ! defined YYDEBUG */ #endif /* ! defined ]b4_api_PREFIX[DEBUG */]])[]dnl ]) @@ -650,7 +772,7 @@ m4_define([b4_yylloc_default_define], #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -664,7 +786,7 @@ m4_define([b4_yylloc_default_define], (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif ]]) @@ -682,8 +804,8 @@ m4_define([b4_yy_location_print_define], /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ -__attribute__((__unused__)) -]b4_c_function_def([yy_location_print_], +YY_ATTRIBUTE_UNUSED +]b4_function_define([yy_location_print_], [static unsigned], [[FILE *yyo], [yyo]], [[YYLTYPE const * const yylocp], [yylocp]])[ @@ -692,20 +814,20 @@ __attribute__((__unused__)) int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { - res += fprintf (yyo, "%d", yylocp->first_line); + res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { - res += fprintf (yyo, "-%d", yylocp->last_line); + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); + res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); + res += YYFPRINTF (yyo, "-%d", end_col); } return res; } diff --git a/data/glr.c b/data/glr.c index 1a2e6ba..06adde6 100644 --- a/data/glr.c +++ b/data/glr.c @@ -2,7 +2,7 @@ # GLR skeleton for Bison -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -52,17 +52,7 @@ m4_ifndef([b4_pure_flag], # This is not shared with yacc.c in c.m4 because GLR relies on ISO C # formal argument declarations. m4_define([b4_user_formals], -[m4_ifset([b4_parse_param], [, b4_c_ansi_formals(b4_parse_param)])]) - - -# b4_lex_param -# ------------ -# Accumule in b4_lex_param all the yylex arguments. -# Yes, this is quite ugly... -m4_define([b4_lex_param], -m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl -b4_locations_if([, [[YYLTYPE *], [&yylloc]]])])dnl -m4_ifdef([b4_lex_param], [, ]b4_lex_param))) +[m4_ifset([b4_parse_param], [, b4_formals(b4_parse_param)])]) # b4_yyerror_args @@ -71,7 +61,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))) # a trailing comma. m4_define([b4_yyerror_args], [b4_pure_if([b4_locations_if([yylocp, ])])dnl -m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])]) +m4_ifset([b4_parse_param], [b4_args(b4_parse_param), ])]) # b4_lyyerror_args @@ -79,7 +69,7 @@ m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])]) # Same as above, but on the lookahead, hence &yylloc instead of yylocp. m4_define([b4_lyyerror_args], [b4_pure_if([b4_locations_if([&yylloc, ])])dnl -m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])]) +m4_ifset([b4_parse_param], [b4_args(b4_parse_param), ])]) # b4_pure_args @@ -126,7 +116,15 @@ m4_define([b4_locuser_args], # -------------------- # Expansion of $$. m4_define([b4_lhs_value], -[((*yyvalp)[]m4_ifval([$1], [.$1]))]) +[b4_symbol_value([(*yyvalp)], [$1])]) + + +# b4_rhs_data(RULE-LENGTH, NUM) +# ----------------------------- +# Expand to the semantic stack place that contains value and location +# of symbol number NUM in a rule of length RULE-LENGTH. +m4_define([b4_rhs_data], +[((yyGLRStackItem const *)yyvsp)@{YYFILL (b4_subtract([$2], [$1]))@}.yystate]) # b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) @@ -134,7 +132,7 @@ m4_define([b4_lhs_value], # Expansion of $NUM, where the current rule has RULE-LENGTH # symbols on RHS. m4_define([b4_rhs_value], -[(((yyGLRStackItem const *)yyvsp)@{YYFILL (($2) - ($1))@}.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3]))]) +[b4_symbol_value([b4_rhs_data([$1], [$2]).yysemantics.yysval], [$3])]) @@ -154,7 +152,7 @@ m4_define([b4_lhs_location], # Expansion of @NUM, where the current rule has RULE-LENGTH symbols # on RHS. m4_define([b4_rhs_location], -[(((yyGLRStackItem const *)yyvsp)@{YYFILL (($2) - ($1))@}.yystate.yyloc)]) +[(b4_rhs_data([$1], [$2]).yyloc)]) ## -------------- ## @@ -164,24 +162,58 @@ m4_define([b4_rhs_location], # b4_shared_declarations # ---------------------- # Declaration that might either go into the header (if --defines) -# or open coded in the parser body. -m4_define([b4_shared_declarations], +# or open coded in the parser body. glr.cc has its own definition. +m4_if(b4_skeleton, ["glr.c"], +[m4_define([b4_shared_declarations], [b4_declare_yydebug[ ]b4_percent_code_get([[requires]])[ -]b4_token_enums(b4_tokens)[ +]b4_token_enums[ ]b4_declare_yylstype[ -]b4_c_ansi_function_decl(b4_prefix[parse], [int], b4_parse_param)[ +]b4_function_declare(b4_prefix[parse], [int], b4_parse_param)[ ]b4_percent_code_get([[provides]])[]dnl ]) - +]) ## -------------- ## ## Output files. ## ## -------------- ## +# Unfortunately the order of generation between the header and the +# implementation file matters (for glr.c) because of the current +# implementation of api.value.type=union. In that case we still use a +# union for YYSTYPE, but we generate the contents of this union when +# setting up YYSTYPE. This is needed for other aspects, such as +# defining yy_symbol_value_print, since we need to now the name of the +# members of this union. +# +# To avoid this issue, just generate the header before the +# implementation file. But we should also make them more independant. + +# ----------------- # +# The header file. # +# ----------------- # + +# glr.cc produces its own header. +m4_if(b4_skeleton, ["glr.c"], +[b4_defines_if( +[b4_output_begin([b4_spec_defines_file]) +b4_copyright([Skeleton interface for Bison GLR parsers in C], + [2002-2015, 2018])[ + +]b4_cpp_guard_open([b4_spec_defines_file])[ +]b4_shared_declarations[ +]b4_cpp_guard_close([b4_spec_defines_file])[ +]b4_output_end() +])]) + + +# ------------------------- # +# The implementation file. # +# ------------------------- # + b4_output_begin([b4_parser_file_name]) b4_copyright([Skeleton implementation for Bison GLR parsers in C], - [2002-2013])[ + [2002-2015, 2018])[ /* C GLR parser skeleton written by Paul Hilfinger. */ @@ -197,13 +229,14 @@ b4_percent_code_get([[top]])[ #define yyparse ]b4_prefix[parse #define yylex ]b4_prefix[lex #define yyerror ]b4_prefix[error +#define yydebug ]b4_prefix[debug +]]b4_pure_if([], [[ #define yylval ]b4_prefix[lval #define yychar ]b4_prefix[char -#define yydebug ]b4_prefix[debug #define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ -#define yylloc ]b4_prefix[lloc]])])[ +#define yylloc ]b4_prefix[lloc]])]))[ -/* Copy the first part of user declarations. */ +/* First part of user declarations. */ ]b4_user_pre_prologue[ ]b4_null_define[ @@ -216,7 +249,7 @@ b4_percent_code_get([[top]])[ # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else -# define YYERROR_VERBOSE ]b4_error_verbose_flag[ +# define YYERROR_VERBOSE ]b4_error_verbose_if([1], [0])[ #endif /* Default (constant) value used for initialization for null @@ -246,16 +279,6 @@ b4_percent_code_get[]dnl # endif #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -]b4_c_function_def([YYID], [static int], [[int i], [i]])[ -{ - return i; -} -#endif - #ifndef YYFREE # define YYFREE free #endif @@ -323,19 +346,6 @@ static const ]b4_int_type_for([b4_translate])[ yytranslate[] = }; #if ]b4_api_PREFIX[DEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const ]b4_int_type_for([b4_prhs])[ yyprhs[] = -{ - ]b4_prhs[ -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const ]b4_int_type_for([b4_rhs])[ yyrhs[] = -{ - ]b4_rhs[ -}; - /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const ]b4_int_type_for([b4_rline])[ yyrline[] = { @@ -352,17 +362,10 @@ static const char *const yytname[] = }; #endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const ]b4_int_type_for([b4_r1])[ yyr1[] = -{ - ]b4_r1[ -}; +#define YYPACT_NINF ]b4_pact_ninf[ +#define YYTABLE_NINF ]b4_table_ninf[ -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const ]b4_int_type_for([b4_r2])[ yyr2[] = -{ - ]b4_r2[ -}; +]b4_parser_tables_define[ /* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none). */ static const ]b4_int_type_for([b4_dprec])[ yydprec[] = @@ -376,41 +379,11 @@ static const ]b4_int_type_for([b4_merger])[ yymerger[] = ]b4_merger[ }; -/* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the default - is an error. */ -static const ]b4_int_type_for([b4_defact])[ yydefact[] = -{ - ]b4_defact[ -}; - -/* YYPDEFGOTO[NTERM-NUM]. */ -static const ]b4_int_type_for([b4_defgoto])[ yydefgoto[] = -{ - ]b4_defgoto[ -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF ]b4_pact_ninf[ -static const ]b4_int_type_for([b4_pact])[ yypact[] = -{ - ]b4_pact[ -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] = -{ - ]b4_pgoto[ -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF ]b4_table_ninf[ -static const ]b4_int_type_for([b4_table])[ yytable[] = +/* YYIMMEDIATE[RULE-NUM] -- True iff rule #RULE-NUM is not to be deferred, as + in the case of predicates. */ +static const yybool yyimmediate[] = { - ]b4_table[ + ]b4_immediate[ }; /* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of @@ -425,25 +398,13 @@ static const ]b4_int_type_for([b4_conflict_list_heads])[ yyconflp[] = /* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by 0, pointed into by YYCONFLP. */ ]dnl Do not use b4_int_type_for here, since there are places where -dnl pointers onto yyconfl are taken, which type is "short int *". +dnl pointers onto yyconfl are taken, whose type is "short int *". dnl We probably ought to introduce a type for confl. [static const short int yyconfl[] = { ]b4_conflicting_rules[ }; -static const ]b4_int_type_for([b4_check])[ yycheck[] = -{ - ]b4_check[ -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const ]b4_int_type_for([b4_stos])[ yystos[] = -{ - ]b4_stos[ -}; - /* Error token number */ #define YYTERROR 1 @@ -451,10 +412,6 @@ static const ]b4_int_type_for([b4_stos])[ yystos[] = ]b4_yylloc_default_define[ # define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc) ]])[ -]b4_yy_location_print_define[ - -/* YYLEX -- calling `yylex' with the right arguments. */ -#define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[ ]b4_pure_if( [ @@ -482,9 +439,12 @@ static const int YYEMPTY = -2; typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG; -#define YYCHK(YYE) \ - do { YYRESULTTAG yyflag = YYE; if (yyflag != yyok) return yyflag; } \ - while (YYID (0)) +#define YYCHK(YYE) \ + do { \ + YYRESULTTAG yychk_flag = YYE; \ + if (yychk_flag != yyok) \ + return yychk_flag; \ + } while (0) #if ]b4_api_PREFIX[DEBUG @@ -492,28 +452,36 @@ typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG; # define YYFPRINTF fprintf # endif +]b4_yy_location_print_define[ + # define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -]b4_yy_symbol_print_generate([b4_c_ansi_function_def])[ - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) + do { \ + if (yydebug) \ + YYFPRINTF Args; \ + } while (0) + +]b4_yy_symbol_print_define[ + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \ + YYFPRINTF (stderr, "\n"); \ + } \ + } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; +struct yyGLRStack; +static void yypstack (struct yyGLRStack* yystackp, size_t yyk) + YY_ATTRIBUTE_UNUSED; +static void yypdumpstack (struct yyGLRStack* yystackp) + YY_ATTRIBUTE_UNUSED; + #else /* !]b4_api_PREFIX[DEBUG */ # define YYDPRINTF(Args) @@ -545,13 +513,7 @@ int yydebug; #define YYHEADROOM 2 #ifndef YYSTACKEXPANDABLE -# if (! defined __cplusplus \ - || (]b4_locations_if([[defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL \ - && ]])[defined ]b4_api_PREFIX[STYPE_IS_TRIVIAL && ]b4_api_PREFIX[STYPE_IS_TRIVIAL)) # define YYSTACKEXPANDABLE 1 -# else -# define YYSTACKEXPANDABLE 0 -# endif #endif #if YYSTACKEXPANDABLE @@ -559,13 +521,13 @@ int yydebug; do { \ if (Yystack->yyspaceLeft < YYHEADROOM) \ yyexpandGLRStack (Yystack); \ - } while (YYID (0)) + } while (0) #else # define YY_RESERVE_GLRSTACK(Yystack) \ do { \ if (Yystack->yyspaceLeft < YYHEADROOM) \ yyMemoryExhausted (Yystack); \ - } while (YYID (0)) + } while (0) #endif @@ -648,7 +610,7 @@ typedef int yyStateNum; typedef int yyRuleNum; /** Grammar symbol */ -typedef short int yySymbol; +typedef int yySymbol; /** Item references, as in LALR(1) machine */ typedef short int yyItemNum; @@ -669,7 +631,7 @@ struct yyGLRState { yyStateNum yylrState; /** Preceding state in this stack */ yyGLRState* yypred; - /** Source position of the first token produced by my symbol */ + /** Source position of the last token produced by my symbol */ size_t yyposn; union { /** First in a chain of alternative reductions producing the @@ -740,19 +702,15 @@ struct yyGLRStack { static void yyexpandGLRStack (yyGLRStack* yystackp); #endif -static void yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg) - __attribute__ ((__noreturn__)); -static void +static _Noreturn void yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg) { - if (yymsg != YY_NULL) + if (yymsg != YY_NULLPTR) yyerror (]b4_yyerror_args[yymsg); YYLONGJMP (yystackp->yyexception_buffer, 1); } -static void yyMemoryExhausted (yyGLRStack* yystackp) - __attribute__ ((__noreturn__)); -static void +static _Noreturn void yyMemoryExhausted (yyGLRStack* yystackp) { YYLONGJMP (yystackp->yyexception_buffer, 2); @@ -773,7 +731,7 @@ yytokenName (yySymbol yytoken) /** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting * at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred * containing the pointer to the next state in the chain. */ -static void yyfillin (yyGLRStackItem *, int, int) __attribute__ ((__unused__)); +static void yyfillin (yyGLRStackItem *, int, int) YY_ATTRIBUTE_UNUSED; static void yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1) { @@ -781,9 +739,16 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1) yyGLRState *s = yyvsp[yylow0].yystate.yypred; for (i = yylow0-1; i >= yylow1; i -= 1) { - YYASSERT (s->yyresolved); - yyvsp[i].yystate.yyresolved = yytrue; - yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;]b4_locations_if([[ +#if ]b4_api_PREFIX[DEBUG + yyvsp[i].yystate.yylrState = s->yylrState; +#endif + yyvsp[i].yystate.yyresolved = s->yyresolved; + if (s->yyresolved) + yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval; + else + /* The effect of using yysval or yyloc (in an immediate rule) is + * undefined. */ + yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULLPTR;]b4_locations_if([[ yyvsp[i].yystate.yyloc = s->yyloc;]])[ s = yyvsp[i].yystate.yypred = s->yypred; } @@ -793,7 +758,7 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1) * YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1. * For convenience, always return YYLOW1. */ static inline int yyfill (yyGLRStackItem *, int *, int, yybool) - __attribute__ ((__unused__)); + YY_ATTRIBUTE_UNUSED; static inline int yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal) { @@ -810,16 +775,16 @@ yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal) * value ($$), and yylocp points to place for location information * (@@$). Returns yyok for normal return, yyaccept for YYACCEPT, * yyerr for YYERROR, yyabort for YYABORT. */ -/*ARGSUSED*/ static YYRESULTTAG -yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp, +static YYRESULTTAG +yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp, yyGLRStack* yystackp, YYSTYPE* yyvalp]b4_locuser_formals[) { - yybool yynormal __attribute__ ((__unused__)) = - (yystackp->yysplitPoint == YY_NULL); + yybool yynormal YY_ATTRIBUTE_UNUSED = (yystackp->yysplitPoint == YY_NULLPTR); int yylow; -]b4_parse_param_use[]dnl -[# undef yyerrok +]b4_parse_param_use([yyvalp], [yylocp])dnl +[ YYUSE (yyrhslen); +# undef yyerrok # define yyerrok (yystackp->yyerrState = 0) # undef YYACCEPT # define YYACCEPT return yyaccept @@ -843,6 +808,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp, *yyvalp = yyval_default; else *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;]b4_locations_if([[ + /* Default location. */ YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen); yystackp->yyerror_range[1].yystate.yyloc = *yylocp; ]])[ @@ -861,9 +827,9 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp, # undef yyclearin # undef YYRECOVERING } - -/*ARGSUSED*/ static void + +static void yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1) { YYUSE (yy0); @@ -871,14 +837,14 @@ yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1) switch (yyn) { - ]b4_mergers[ +]b4_mergers[ default: break; } } /* Bison grammar-table manipulation. */ -]b4_yydestruct_generate([b4_c_ansi_function_def])[ +]b4_yydestruct_define[ /** Number of symbols composing the right hand side of rule #RULE. */ static inline int @@ -899,12 +865,10 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[) if (yydebug) { if (yys->yysemantics.yyfirstVal) - YYFPRINTF (stderr, "%s unresolved ", yymsg); + YYFPRINTF (stderr, "%s unresolved", yymsg); else - YYFPRINTF (stderr, "%s incomplete ", yymsg); - yy_symbol_print (stderr, yystos[yys->yylrState], - YY_NULL]b4_locuser_args([&yys->yyloc])[); - YYFPRINTF (stderr, "\n"); + YYFPRINTF (stderr, "%s incomplete", yymsg); + YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc); } #endif @@ -921,7 +885,7 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[) } } -/** Left-hand-side symbol for rule #RULE. */ +/** Left-hand-side symbol for rule #YYRULE. */ static inline yySymbol yylhsNonterm (yyRuleNum yyrule) { @@ -931,7 +895,7 @@ yylhsNonterm (yyRuleNum yyrule) #define yypact_value_is_default(Yystate) \ ]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[ -/** True iff LR state STATE has only a default reduction (regardless +/** True iff LR state YYSTATE has only a default reduction (regardless * of token). */ static inline yybool yyisDefaultedState (yyStateNum yystate) @@ -939,7 +903,7 @@ yyisDefaultedState (yyStateNum yystate) return yypact_value_is_default (yypact[yystate]); } -/** The default reduction for STATE, assuming it has one. */ +/** The default reduction for YYSTATE, assuming it has one. */ static inline yyRuleNum yydefaultAction (yyStateNum yystate) { @@ -954,8 +918,8 @@ yydefaultAction (yyStateNum yystate) * R < 0: Reduce on rule -R. * R = 0: Error. * R > 0: Shift to state R. - * Set *CONFLICTS to a pointer into yyconfl to 0-terminated list of - * conflicting reductions. + * Set *YYCONFLICTS to a pointer into yyconfl to a 0-terminated list + * of conflicting reductions. */ static inline void yygetLRActions (yyStateNum yystate, int yytoken, @@ -980,15 +944,18 @@ yygetLRActions (yyStateNum yystate, int yytoken, } } +/** Compute post-reduction state. + * \param yystate the current state + * \param yysym the nonterminal to push on the stack + */ static inline yyStateNum -yyLRgotoState (yyStateNum yystate, yySymbol yylhs) +yyLRgotoState (yyStateNum yystate, yySymbol yysym) { - int yyr; - yyr = yypgoto[yylhs - YYNTOKENS] + yystate; + int yyr = yypgoto[yysym - YYNTOKENS] + yystate; if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate) return yytable[yyr]; else - return yydefgoto[yylhs - YYNTOKENS]; + return yydefgoto[yysym - YYNTOKENS]; } static inline yybool @@ -1005,9 +972,10 @@ yyisErrorAction (int yyaction) /* GLRStates */ -/** Return a fresh GLRStackItem. Callers should call - * YY_RESERVE_GLRSTACK afterwards to make sure there is sufficient - * headroom. */ +/** Return a fresh GLRStackItem in YYSTACKP. The item is an LR state + * if YYISSTATE, and otherwise a semantic option. Callers should call + * YY_RESERVE_GLRSTACK afterwards to make sure there is sufficient + * headroom. */ static inline yyGLRStackItem* yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState) @@ -1020,16 +988,17 @@ yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState) } /** Add a new semantic action that will execute the action for rule - * RULENUM on the semantic values in RHS to the list of - * alternative actions for STATE. Assumes that RHS comes from - * stack #K of *STACKP. */ + * YYRULE on the semantic values in YYRHS to the list of + * alternative actions for YYSTATE. Assumes that YYRHS comes from + * stack #YYK of *YYSTACKP. */ static void yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate, - yyGLRState* rhs, yyRuleNum yyrule) + yyGLRState* yyrhs, yyRuleNum yyrule) { yySemanticOption* yynewOption = &yynewGLRStackItem (yystackp, yyfalse)->yyoption; - yynewOption->yystate = rhs; + YYASSERT (!yynewOption->yyisState); + yynewOption->yystate = yyrhs; yynewOption->yyrule = yyrule; if (yystackp->yytops.yylookaheadNeeds[yyk]) { @@ -1047,7 +1016,7 @@ yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate, /* GLRStacks */ -/** Initialize SET to a singleton set containing an empty stack. */ +/** Initialize YYSET to a singleton set containing an empty stack. */ static yybool yyinitStateSet (yyGLRStateSet* yyset) { @@ -1056,7 +1025,7 @@ yyinitStateSet (yyGLRStateSet* yyset) yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]); if (! yyset->yystates) return yyfalse; - yyset->yystates[0] = YY_NULL; + yyset->yystates[0] = YY_NULLPTR; yyset->yylookaheadNeeds = (yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]); if (! yyset->yylookaheadNeeds) @@ -1073,8 +1042,8 @@ static void yyfreeStateSet (yyGLRStateSet* yyset) YYFREE (yyset->yylookaheadNeeds); } -/** Initialize STACK to a single empty stack, with total maximum - * capacity for all stacks of SIZE. */ +/** Initialize *YYSTACKP to a single empty stack, with total maximum + * capacity for all stacks of YYSIZE. */ static yybool yyinitGLRStack (yyGLRStack* yystackp, size_t yysize) { @@ -1086,8 +1055,8 @@ yyinitGLRStack (yyGLRStack* yystackp, size_t yysize) if (!yystackp->yyitems) return yyfalse; yystackp->yynextFree = yystackp->yyitems; - yystackp->yysplitPoint = YY_NULL; - yystackp->yylastDeleted = YY_NULL; + yystackp->yysplitPoint = YY_NULLPTR; + yystackp->yylastDeleted = YY_NULLPTR; return yyinitStateSet (&yystackp->yytops); } @@ -1096,7 +1065,7 @@ yyinitGLRStack (yyGLRStack* yystackp, size_t yysize) # define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \ &((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE -/** If STACK is expandable, extend it. WARNING: Pointers into the +/** If *YYSTACKP is expandable, extend it. WARNING: Pointers into the stack from outside should be considered invalid after this call. We always expand when there are 1 or fewer items left AFTER an allocation, so that we can avoid having external pointers exist @@ -1126,10 +1095,10 @@ yyexpandGLRStack (yyGLRStack* yystackp) { yyGLRState* yys0 = &yyp0->yystate; yyGLRState* yys1 = &yyp1->yystate; - if (yys0->yypred != YY_NULL) + if (yys0->yypred != YY_NULLPTR) yys1->yypred = YYRELOC (yyp0, yyp1, yys0->yypred, yystate); - if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULL) + if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULLPTR) yys1->yysemantics.yyfirstVal = YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption); } @@ -1137,18 +1106,18 @@ yyexpandGLRStack (yyGLRStack* yystackp) { yySemanticOption* yyv0 = &yyp0->yyoption; yySemanticOption* yyv1 = &yyp1->yyoption; - if (yyv0->yystate != YY_NULL) + if (yyv0->yystate != YY_NULLPTR) yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate); - if (yyv0->yynext != YY_NULL) + if (yyv0->yynext != YY_NULLPTR) yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption); } } - if (yystackp->yysplitPoint != YY_NULL) + if (yystackp->yysplitPoint != YY_NULLPTR) yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems, - yystackp->yysplitPoint, yystate); + yystackp->yysplitPoint, yystate); for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1) - if (yystackp->yytops.yystates[yyn] != YY_NULL) + if (yystackp->yytops.yystates[yyn] != YY_NULLPTR) yystackp->yytops.yystates[yyn] = YYRELOC (yystackp->yyitems, yynewItems, yystackp->yytops.yystates[yyn], yystate); @@ -1166,37 +1135,37 @@ yyfreeGLRStack (yyGLRStack* yystackp) yyfreeStateSet (&yystackp->yytops); } -/** Assuming that S is a GLRState somewhere on STACK, update the - * splitpoint of STACK, if needed, so that it is at least as deep as - * S. */ +/** Assuming that YYS is a GLRState somewhere on *YYSTACKP, update the + * splitpoint of *YYSTACKP, if needed, so that it is at least as deep as + * YYS. */ static inline void yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys) { - if (yystackp->yysplitPoint != YY_NULL && yystackp->yysplitPoint > yys) + if (yystackp->yysplitPoint != YY_NULLPTR && yystackp->yysplitPoint > yys) yystackp->yysplitPoint = yys; } -/** Invalidate stack #K in STACK. */ +/** Invalidate stack #YYK in *YYSTACKP. */ static inline void yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk) { - if (yystackp->yytops.yystates[yyk] != YY_NULL) + if (yystackp->yytops.yystates[yyk] != YY_NULLPTR) yystackp->yylastDeleted = yystackp->yytops.yystates[yyk]; - yystackp->yytops.yystates[yyk] = YY_NULL; + yystackp->yytops.yystates[yyk] = YY_NULLPTR; } -/** Undelete the last stack that was marked as deleted. Can only be - done once after a deletion, and only when all other stacks have +/** Undelete the last stack in *YYSTACKP that was marked as deleted. Can + only be done once after a deletion, and only when all other stacks have been deleted. */ static void yyundeleteLastStack (yyGLRStack* yystackp) { - if (yystackp->yylastDeleted == YY_NULL || yystackp->yytops.yysize != 0) + if (yystackp->yylastDeleted == YY_NULLPTR || yystackp->yytops.yysize != 0) return; yystackp->yytops.yystates[0] = yystackp->yylastDeleted; yystackp->yytops.yysize = 1; YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n")); - yystackp->yylastDeleted = YY_NULL; + yystackp->yylastDeleted = YY_NULLPTR; } static inline void @@ -1206,7 +1175,7 @@ yyremoveDeletes (yyGLRStack* yystackp) yyi = yyj = 0; while (yyj < yystackp->yytops.yysize) { - if (yystackp->yytops.yystates[yyi] == YY_NULL) + if (yystackp->yytops.yystates[yyi] == YY_NULLPTR) { if (yyi == yyj) { @@ -1235,8 +1204,9 @@ yyremoveDeletes (yyGLRStack* yystackp) } } -/** Shift to a new state on stack #K of STACK, corresponding to LR state - * LRSTATE, at input position POSN, with (resolved) semantic value SVAL. */ +/** Shift to a new state on stack #YYK of *YYSTACKP, corresponding to LR + * state YYLRSTATE, at input position YYPOSN, with (resolved) semantic + * value *YYVALP and source location *YYLOCP. */ static inline void yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, size_t yyposn, @@ -1255,31 +1225,73 @@ yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, YY_RESERVE_GLRSTACK (yystackp); } -/** Shift stack #K of YYSTACK, to a new state corresponding to LR +/** Shift stack #YYK of *YYSTACKP, to a new state corresponding to LR * state YYLRSTATE, at input position YYPOSN, with the (unresolved) * semantic value of YYRHS under the action for YYRULE. */ static inline void yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState, - size_t yyposn, yyGLRState* rhs, yyRuleNum yyrule) + size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule) { yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate; + YYASSERT (yynewState->yyisState); yynewState->yylrState = yylrState; yynewState->yyposn = yyposn; yynewState->yyresolved = yyfalse; yynewState->yypred = yystackp->yytops.yystates[yyk]; - yynewState->yysemantics.yyfirstVal = YY_NULL; + yynewState->yysemantics.yyfirstVal = YY_NULLPTR; yystackp->yytops.yystates[yyk] = yynewState; /* Invokes YY_RESERVE_GLRSTACK. */ - yyaddDeferredAction (yystackp, yyk, yynewState, rhs, yyrule); + yyaddDeferredAction (yystackp, yyk, yynewState, yyrhs, yyrule); } -/** Pop the symbols consumed by reduction #RULE from the top of stack - * #K of STACK, and perform the appropriate semantic action on their +#if !]b4_api_PREFIX[DEBUG +# define YY_REDUCE_PRINT(Args) +#else +# define YY_REDUCE_PRINT(Args) \ +do { \ + if (yydebug) \ + yy_reduce_print Args; \ +} while (0) + +/*----------------------------------------------------------------------. +| Report that stack #YYK of *YYSTACKP is going to be reduced by YYRULE. | +`----------------------------------------------------------------------*/ + +static inline void +yy_reduce_print (int yynormal, yyGLRStackItem* yyvsp, size_t yyk, + yyRuleNum yyrule]b4_user_formals[) +{ + int yynrhs = yyrhsLength (yyrule);]b4_locations_if([ + int yylow = 1;])[ + int yyi; + YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n", + (unsigned long int) yyk, yyrule - 1, + (unsigned long int) yyrline[yyrule]); + if (! yynormal) + yyfillin (yyvsp, 1, -yynrhs); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyvsp[yyi - yynrhs + 1].yystate.yylrState], + &yyvsp[yyi - yynrhs + 1].yystate.yysemantics.yysval + ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl + b4_user_args[); + if (!yyvsp[yyi - yynrhs + 1].yystate.yyresolved) + YYFPRINTF (stderr, " (unresolved)"); + YYFPRINTF (stderr, "\n"); + } +} +#endif + +/** Pop the symbols consumed by reduction #YYRULE from the top of stack + * #YYK of *YYSTACKP, and perform the appropriate semantic action on their * semantic values. Assumes that all ambiguities in semantic values - * have been previously resolved. Set *VALP to the resulting value, - * and *LOCP to the computed location (if any). Return value is as + * have been previously resolved. Set *YYVALP to the resulting value, + * and *YYLOCP to the computed location (if any). Return value is as * for userAction. */ static inline YYRESULTTAG yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, @@ -1287,23 +1299,20 @@ yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, { int yynrhs = yyrhsLength (yyrule); - if (yystackp->yysplitPoint == YY_NULL) + if (yystackp->yysplitPoint == YY_NULLPTR) { /* Standard special case: single stack. */ - yyGLRStackItem* rhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; + yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; YYASSERT (yyk == 0); yystackp->yynextFree -= yynrhs; yystackp->yyspaceLeft += yynrhs; yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate; - return yyuserAction (yyrule, yynrhs, rhs, yystackp, + YY_REDUCE_PRINT ((1, yyrhs, yyk, yyrule]b4_user_args[)); + return yyuserAction (yyrule, yynrhs, yyrhs, yystackp, yyvalp]b4_locuser_args[); } else { - /* At present, doAction is never called in nondeterministic - * mode, so this branch is never taken. It is here in - * anticipation of a future feature that will allow immediate - * evaluation of selected actions in nondeterministic mode. */ int yyi; yyGLRState* yys; yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1]; @@ -1319,62 +1328,21 @@ yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, } yyupdateSplit (yystackp, yys); yystackp->yytops.yystates[yyk] = yys; + YY_REDUCE_PRINT ((0, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, yyk, yyrule]b4_user_args[)); return yyuserAction (yyrule, yynrhs, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, yystackp, yyvalp]b4_locuser_args[); } } -#if !]b4_api_PREFIX[DEBUG -# define YY_REDUCE_PRINT(Args) -#else -# define YY_REDUCE_PRINT(Args) \ -do { \ - if (yydebug) \ - yy_reduce_print Args; \ -} while (YYID (0)) - -/*----------------------------------------------------------. -| Report that the RULE is going to be reduced on stack #K. | -`----------------------------------------------------------*/ - -/*ARGSUSED*/ static inline void -yy_reduce_print (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, - YYSTYPE* yyvalp]b4_locuser_formals[) -{ - int yynrhs = yyrhsLength (yyrule); - yybool yynormal __attribute__ ((__unused__)) = - (yystackp->yysplitPoint == YY_NULL); - yyGLRStackItem* yyvsp = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; - int yylow = 1; - int yyi; - YYUSE (yyvalp);]b4_locations_if([ - YYUSE (yylocp);])[ -]b4_parse_param_use[]dnl -[ YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n", - (unsigned long int) yyk, yyrule - 1, - (unsigned long int) yyrline[yyrule]); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &]b4_rhs_value(yynrhs, yyi + 1)[ - ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl - b4_user_args[); - YYFPRINTF (stderr, "\n"); - } -} -#endif - -/** Pop items off stack #K of STACK according to grammar rule RULE, +/** Pop items off stack #YYK of *YYSTACKP according to grammar rule YYRULE, * and push back on the resulting nonterminal symbol. Perform the - * semantic action associated with RULE and store its value with the - * newly pushed state, if FORCEEVAL or if STACK is currently + * semantic action associated with YYRULE and store its value with the + * newly pushed state, if YYFORCEEVAL or if *YYSTACKP is currently * unambiguous. Otherwise, store the deferred semantic action with * the new state. If the new state would have an identical input * position, LR state, and predecessor to an existing state on the stack, - * it is identified with that existing state, eliminating stack #K from - * the STACK. In this case, the (necessarily deferred) semantic value is + * it is identified with that existing state, eliminating stack #YYK from + * *YYSTACKP. In this case, the semantic value is * added to the options for the existing state's semantic value. */ static inline YYRESULTTAG @@ -1383,13 +1351,19 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, { size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn; - if (yyforceEval || yystackp->yysplitPoint == YY_NULL) + if (yyforceEval || yystackp->yysplitPoint == YY_NULLPTR) { - YYSTYPE yysval;]b4_locations_if([ - YYLTYPE yyloc;])[ + YYSTYPE yysval;]b4_locations_if([[ + YYLTYPE yyloc;]])[ - YY_REDUCE_PRINT ((yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[)); - YYCHK (yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[)); + YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[); + if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR) + { + YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n", + (unsigned long int) yyk, yyrule - 1)); + } + if (yyflag != yyok) + return yyflag; YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc); yyglrShift (yystackp, yyk, yyLRgotoState (yystackp->yytops.yystates[yyk]->yylrState, @@ -1412,10 +1386,11 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, yyupdateSplit (yystackp, yys); yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule)); YYDPRINTF ((stderr, - "Reduced stack %lu by rule #%d; action deferred. Now in state %d.\n", + "Reduced stack %lu by rule #%d; action deferred. " + "Now in state %d.\n", (unsigned long int) yyk, yyrule - 1, yynewLRState)); for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) - if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULL) + if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR) { yyGLRState *yysplit = yystackp->yysplitPoint; yyGLRState *yyp = yystackp->yytops.yystates[yyi]; @@ -1442,7 +1417,7 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule, static size_t yysplitStack (yyGLRStack* yystackp, size_t yyk) { - if (yystackp->yysplitPoint == YY_NULL) + if (yystackp->yysplitPoint == YY_NULLPTR) { YYASSERT (yyk == 0); yystackp->yysplitPoint = yystackp->yytops.yystates[yyk]; @@ -1452,7 +1427,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk) yyGLRState** yynewStates; yybool* yynewLookaheadNeeds; - yynewStates = YY_NULL; + yynewStates = YY_NULLPTR; if (yystackp->yytops.yycapacity > (YYSIZEMAX / (2 * sizeof yynewStates[0]))) @@ -1463,7 +1438,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk) (yyGLRState**) YYREALLOC (yystackp->yytops.yystates, (yystackp->yytops.yycapacity * sizeof yynewStates[0])); - if (yynewStates == YY_NULL) + if (yynewStates == YY_NULLPTR) yyMemoryExhausted (yystackp); yystackp->yytops.yystates = yynewStates; @@ -1471,7 +1446,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk) (yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds, (yystackp->yytops.yycapacity * sizeof yynewLookaheadNeeds[0])); - if (yynewLookaheadNeeds == YY_NULL) + if (yynewLookaheadNeeds == YY_NULLPTR) yyMemoryExhausted (yystackp); yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds; } @@ -1483,7 +1458,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk) return yystackp->yytops.yysize-1; } -/** True iff Y0 and Y1 represent identical options at the top level. +/** True iff YYY0 and YYY1 represent identical options at the top level. * That is, they represent the same rule applied to RHS symbols * that produce the same terminal symbols. */ static yybool @@ -1505,8 +1480,8 @@ yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1) return yyfalse; } -/** Assuming identicalOptions (Y0,Y1), destructively merge the - * alternative semantic values for the RHS-symbols of Y1 and Y0. */ +/** Assuming identicalOptions (YYY0,YYY1), destructively merge the + * alternative semantic values for the RHS-symbols of YYY1 and YYY0. */ static void yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1) { @@ -1533,11 +1508,11 @@ yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1) { yySemanticOption** yyz0p = &yys0->yysemantics.yyfirstVal; yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal; - while (YYID (yytrue)) + while (yytrue) { - if (yyz1 == *yyz0p || yyz1 == YY_NULL) + if (yyz1 == *yyz0p || yyz1 == YY_NULLPTR) break; - else if (*yyz0p == YY_NULL) + else if (*yyz0p == YY_NULLPTR) { *yyz0p = yyz1; break; @@ -1585,11 +1560,11 @@ static YYRESULTTAG yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[); -/** Resolve the previous N states starting at and including state S. If result - * != yyok, some states may have been left unresolved possibly with empty - * semantic option chains. Regardless of whether result = yyok, each state - * has been left with consistent data so that yydestroyGLRState can be invoked - * if necessary. */ +/** Resolve the previous YYN states starting at and including state YYS + * on *YYSTACKP. If result != yyok, some states may have been left + * unresolved possibly with empty semantic option chains. Regardless + * of whether result = yyok, each state has been left with consistent + * data so that yydestroyGLRState can be invoked if necessary. */ static YYRESULTTAG yyresolveStates (yyGLRState* yys, int yyn, yyGLRStack* yystackp]b4_user_formals[) @@ -1604,9 +1579,10 @@ yyresolveStates (yyGLRState* yys, int yyn, return yyok; } -/** Resolve the states for the RHS of OPT, perform its user action, and return - * the semantic value and location. Regardless of whether result = yyok, all - * RHS states have been destroyed (assuming the user action destroys all RHS +/** Resolve the states for the RHS of YYOPT on *YYSTACKP, perform its + * user action, and return the semantic value and location in *YYVALP + * and *YYLOCP. Regardless of whether result = yyok, all RHS states + * have been destroyed (assuming the user action destroys all RHS * semantic values if invoked). */ static YYRESULTTAG yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystackp, @@ -1657,7 +1633,7 @@ yyreportTree (yySemanticOption* yyx, int yyindent) for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred) yystates[yyi] = yys; - if (yys == YY_NULL) + if (yys == YY_NULLPTR) { yyleftmost_state.yyposn = 0; yystates[0] = &yyleftmost_state; @@ -1680,11 +1656,11 @@ yyreportTree (yySemanticOption* yyx, int yyindent) { if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn) YYFPRINTF (stderr, "%*s%s \n", yyindent+2, "", - yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1])); + yytokenName (yystos[yystates[yyi]->yylrState])); else YYFPRINTF (stderr, "%*s%s \n", yyindent+2, "", - yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]), - (unsigned long int) (yystates[yyi - 1]->yyposn + 1), + yytokenName (yystos[yystates[yyi]->yylrState]), + (unsigned long int) (yystates[yyi-1]->yyposn + 1), (unsigned long int) yystates[yyi]->yyposn); } else @@ -1693,7 +1669,7 @@ yyreportTree (yySemanticOption* yyx, int yyindent) } #endif -/*ARGSUSED*/ static YYRESULTTAG +static YYRESULTTAG yyreportAmbiguity (yySemanticOption* yyx0, yySemanticOption* yyx1]b4_pure_formals[) { @@ -1713,9 +1689,9 @@ yyreportAmbiguity (yySemanticOption* yyx0, return yyabort; }]b4_locations_if([[ -/** Starting at and including state S1, resolve the location for each of the - * previous N1 states that is unresolved. The first semantic option of a state - * is always chosen. */ +/** Resolve the locations for each of the YYN1 states in *YYSTACKP, + * ending at YYS1. Has no effect on previously resolved states. + * The first semantic option of a state is always chosen. */ static void yyresolveLocations (yyGLRState* yys1, int yyn1, yyGLRStack *yystackp]b4_user_formals[) @@ -1728,7 +1704,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1, yyGLRStackItem yyrhsloc[1 + YYMAXRHS]; int yynrhs; yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal; - YYASSERT (yyoption != YY_NULL); + YYASSERT (yyoption != YY_NULLPTR); yynrhs = yyrhsLength (yyoption->yyrule); if (yynrhs > 0) { @@ -1769,11 +1745,12 @@ yyresolveLocations (yyGLRState* yys1, int yyn1, } }]])[ -/** Resolve the ambiguity represented in state S, perform the indicated - * actions, and set the semantic value of S. If result != yyok, the chain of - * semantic options in S has been cleared instead or it has been left - * unmodified except that redundant options may have been removed. Regardless - * of whether result = yyok, S has been left with consistent data so that +/** Resolve the ambiguity represented in state YYS in *YYSTACKP, + * perform the indicated actions, and set the semantic value of YYS. + * If result != yyok, the chain of semantic options in YYS has been + * cleared instead or it has been left unmodified except that + * redundant options may have been removed. Regardless of whether + * result = yyok, YYS has been left with consistent data so that * yydestroyGLRState can be invoked if necessary. */ static YYRESULTTAG yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[) @@ -1786,7 +1763,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[) YYRESULTTAG yyflag;]b4_locations_if([ YYLTYPE *yylocp = &yys->yyloc;])[ - for (yypp = &yyoptionList->yynext; *yypp != YY_NULL; ) + for (yypp = &yyoptionList->yynext; *yypp != YY_NULLPTR; ) { yySemanticOption* yyp = *yypp; @@ -1828,7 +1805,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[) int yyprec = yydprec[yybest->yyrule]; yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[); if (yyflag == yyok) - for (yyp = yybest->yynext; yyp != YY_NULL; yyp = yyp->yynext) + for (yyp = yybest->yynext; yyp != YY_NULLPTR; yyp = yyp->yynext) { if (yyprec == yydprec[yyp->yyrule]) { @@ -1855,14 +1832,14 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[) yys->yysemantics.yysval = yysval; } else - yys->yysemantics.yyfirstVal = YY_NULL; + yys->yysemantics.yyfirstVal = YY_NULLPTR; return yyflag; } static YYRESULTTAG yyresolveStack (yyGLRStack* yystackp]b4_user_formals[) { - if (yystackp->yysplitPoint != YY_NULL) + if (yystackp->yysplitPoint != YY_NULLPTR) { yyGLRState* yys; int yyn; @@ -1882,10 +1859,10 @@ yycompressStack (yyGLRStack* yystackp) { yyGLRState* yyp, *yyq, *yyr; - if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULL) + if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULLPTR) return; - for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULL; + for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULLPTR; yyp != yystackp->yysplitPoint; yyr = yyp, yyp = yyq, yyq = yyp->yypred) yyp->yypred = yyr; @@ -1893,10 +1870,10 @@ yycompressStack (yyGLRStack* yystackp) yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems; yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1; yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems; - yystackp->yysplitPoint = YY_NULL; - yystackp->yylastDeleted = YY_NULL; + yystackp->yysplitPoint = YY_NULLPTR; + yystackp->yylastDeleted = YY_NULLPTR; - while (yyr != YY_NULL) + while (yyr != YY_NULLPTR) { yystackp->yynextFree->yystate = *yyr; yyr = yyr->yypred; @@ -1911,11 +1888,7 @@ static YYRESULTTAG yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, size_t yyposn]b4_pure_formals[) { - int yyaction; - const short int* yyconflicts; - yyRuleNum yyrule; - - while (yystackp->yytops.yystates[yyk] != YY_NULL) + while (yystackp->yytops.yystates[yyk] != YY_NULLPTR) { yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState; YYDPRINTF ((stderr, "Stack %lu Entering state %d\n", @@ -1925,7 +1898,8 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, if (yyisDefaultedState (yystate)) { - yyrule = yydefaultAction (yystate); + YYRESULTTAG yyflag; + yyRuleNum yyrule = yydefaultAction (yystate); if (yyrule == 0) { YYDPRINTF ((stderr, "Stack %lu dies.\n", @@ -1933,16 +1907,30 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, yymarkStackDeleted (yystackp, yyk); return yyok; } - YYCHK (yyglrReduce (yystackp, yyk, yyrule, yyfalse]b4_user_args[)); + yyflag = yyglrReduce (yystackp, yyk, yyrule, yyimmediate[yyrule]]b4_user_args[); + if (yyflag == yyerr) + { + YYDPRINTF ((stderr, + "Stack %lu dies " + "(predicate failure or explicit user error).\n", + (unsigned long int) yyk)); + yymarkStackDeleted (yystackp, yyk); + return yyok; + } + if (yyflag != yyok) + return yyflag; } else { yySymbol yytoken; + int yyaction; + const short int* yyconflicts; + yystackp->yytops.yylookaheadNeeds[yyk] = yytrue; if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = ]b4_lex[; } if (yychar <= YYEOF) @@ -1960,14 +1948,25 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, while (*yyconflicts != 0) { + YYRESULTTAG yyflag; size_t yynewStack = yysplitStack (yystackp, yyk); YYDPRINTF ((stderr, "Splitting off stack %lu from %lu.\n", (unsigned long int) yynewStack, (unsigned long int) yyk)); - YYCHK (yyglrReduce (yystackp, yynewStack, - *yyconflicts, yyfalse]b4_user_args[)); - YYCHK (yyprocessOneStack (yystackp, yynewStack, - yyposn]b4_pure_args[)); + yyflag = yyglrReduce (yystackp, yynewStack, + *yyconflicts, + yyimmediate[*yyconflicts]]b4_user_args[); + if (yyflag == yyok) + YYCHK (yyprocessOneStack (yystackp, yynewStack, + yyposn]b4_pure_args[)); + else if (yyflag == yyerr) + { + YYDPRINTF ((stderr, "Stack %lu dies.\n", + (unsigned long int) yynewStack)); + yymarkStackDeleted (yystackp, yynewStack); + } + else + return yyflag; yyconflicts += 1; } @@ -1981,14 +1980,27 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, break; } else - YYCHK (yyglrReduce (yystackp, yyk, -yyaction, - yyfalse]b4_user_args[)); + { + YYRESULTTAG yyflag = yyglrReduce (yystackp, yyk, -yyaction, + yyimmediate[-yyaction]]b4_user_args[); + if (yyflag == yyerr) + { + YYDPRINTF ((stderr, + "Stack %lu dies " + "(predicate failure or explicit user error).\n", + (unsigned long int) yyk)); + yymarkStackDeleted (yystackp, yyk); + break; + } + else if (yyflag != yyok) + return yyflag; + } } } return yyok; } -/*ARGSUSED*/ static void +static void yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) { if (yystackp->yyerrState != 0) @@ -1998,13 +2010,13 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) #else { yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken)); + size_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken)); size_t yysize = yysize0; yybool yysize_overflow = yyfalse; - char* yymsg = YY_NULL; + char* yymsg = YY_NULLPTR; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -2060,7 +2072,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) } yyarg[yycount++] = yytokenName (yyx); { - size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName (yyx)); + size_t yysz = yysize + yytnamerr (YY_NULLPTR, yytokenName (yyx)); yysize_overflow |= yysz < yysize; yysize = yysz; } @@ -2074,6 +2086,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) case N: \ yyformat = S; \ break + default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); @@ -2125,7 +2138,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) /* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP, yylval, and yylloc are the syntactic category, semantic value, and location of the lookahead. */ -/*ARGSUSED*/ static void +static void yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) { size_t yyk; @@ -2134,11 +2147,11 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) if (yystackp->yyerrState == 3) /* We just shifted the error token and (perhaps) took some reductions. Skip tokens until we can proceed. */ - while (YYID (yytrue)) + while (yytrue) { yySymbol yytoken; if (yychar == YYEOF) - yyFail (yystackp][]b4_lpure_args[, YY_NULL); + yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR); if (yychar != YYEMPTY) {]b4_locations_if([[ /* We throw away the lookahead, but the error range @@ -2153,7 +2166,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) yytoken, &yylval]b4_locuser_args([&yylloc])[); } YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = ]b4_lex[; if (yychar <= YYEOF) { yychar = yytoken = YYEOF; @@ -2179,10 +2192,10 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) /* Reduce to one stack. */ for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1) - if (yystackp->yytops.yystates[yyk] != YY_NULL) + if (yystackp->yytops.yystates[yyk] != YY_NULLPTR) break; if (yyk >= yystackp->yytops.yysize) - yyFail (yystackp][]b4_lpure_args[, YY_NULL); + yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR); for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1) yymarkStackDeleted (yystackp, yyk); yyremoveDeletes (yystackp); @@ -2190,7 +2203,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) /* Now pop stack until we find a state that shifts the error token. */ yystackp->yyerrState = 3; - while (yystackp->yytops.yystates[0] != YY_NULL) + while (yystackp->yytops.yystates[0] != YY_NULLPTR) { yyGLRState *yys = yystackp->yytops.yystates[0]; yyj = yypact[yys->yylrState]; @@ -2214,14 +2227,14 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) } }]b4_locations_if([[ yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[ - if (yys->yypred != YY_NULL) + if (yys->yypred != YY_NULLPTR) yydestroyGLRState ("Error: popping", yys]b4_user_args[); yystackp->yytops.yystates[0] = yys->yypred; yystackp->yynextFree -= 1; yystackp->yyspaceLeft += 1; } - if (yystackp->yytops.yystates[0] == YY_NULL) - yyFail (yystackp][]b4_lpure_args[, YY_NULL); + if (yystackp->yytops.yystates[0] == YY_NULLPTR) + yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR); } #define YYCHK1(YYE) \ @@ -2238,14 +2251,13 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) default: \ goto yybuglab; \ } \ - } while (YYID (0)) - + } while (0) /*----------. | yyparse. | `----------*/ -]b4_c_ansi_function_def([yyparse], [int], b4_parse_param)[ +]b4_function_define([yyparse], [int], b4_parse_param)[ { int yyresult; yyGLRStack yystack; @@ -2259,8 +2271,8 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) yylloc = yyloc_default;])[ ]m4_ifdef([b4_initial_action], [ b4_dollar_pushdef([yylval], [], [yylloc])dnl -/* User initialization code. */ -b4_user_initial_action + /* User initialization code. */ + b4_user_initial_action b4_dollar_popdef])[]dnl [ if (! yyinitGLRStack (yystackp, YYINITDEPTH)) @@ -2275,13 +2287,13 @@ b4_dollar_popdef])[]dnl yyglrShift (&yystack, 0, 0, 0, &yylval]b4_locations_if([, &yylloc])[); yyposn = 0; - while (YYID (yytrue)) + while (yytrue) { /* For efficiency, we have two loops, the first of which is specialized to deterministic operation (single stack, no potential ambiguity). */ /* Standard mode */ - while (YYID (yytrue)) + while (yytrue) { yyRuleNum yyrule; int yyaction; @@ -2295,8 +2307,8 @@ b4_dollar_popdef])[]dnl { yyrule = yydefaultAction (yystate); if (yyrule == 0) - { -]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ + {]b4_locations_if([[ + yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ yyreportSyntaxError (&yystack]b4_user_args[); goto yyuser_error; } @@ -2308,7 +2320,7 @@ b4_dollar_popdef])[]dnl if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = ]b4_lex[; } if (yychar <= YYEOF) @@ -2335,8 +2347,8 @@ b4_dollar_popdef])[]dnl yystack.yyerrState -= 1; } else if (yyisErrorAction (yyaction)) - { -]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ + {]b4_locations_if([[ + yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ yyreportSyntaxError (&yystack]b4_user_args[); goto yyuser_error; } @@ -2345,7 +2357,7 @@ b4_dollar_popdef])[]dnl } } - while (YYID (yytrue)) + while (yytrue) { yySymbol yytoken_to_shift; size_t yys; @@ -2381,8 +2393,8 @@ b4_dollar_popdef])[]dnl if (yystack.yytops.yysize == 0) yyFail (&yystack][]b4_lpure_args[, YY_("syntax error")); YYCHK1 (yyresolveStack (&yystack]b4_user_args[)); - YYDPRINTF ((stderr, "Returning to deterministic operation.\n")); -]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ + YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));]b4_locations_if([[ + yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[ yyreportSyntaxError (&yystack]b4_user_args[); goto yyuser_error; } @@ -2463,9 +2475,9 @@ b4_dollar_popdef])[]dnl { while (yystates[yyk]) { - yyGLRState *yys = yystates[yyk]; -]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]] -)[ if (yys->yypred != YY_NULL) + yyGLRState *yys = yystates[yyk];]b4_locations_if([[ + yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]])[ + if (yys->yypred != YY_NULLPTR) yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[); yystates[yyk] = yys->yypred; yystack.yynextFree -= 1; @@ -2477,16 +2489,11 @@ b4_dollar_popdef])[]dnl yyfreeGLRStack (&yystack); } - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } /* DEBUGGING ONLY */ #if ]b4_api_PREFIX[DEBUG -static void yypstack (yyGLRStack* yystackp, size_t yyk) - __attribute__ ((__unused__)); -static void yypdumpstack (yyGLRStack* yystackp) __attribute__ ((__unused__)); - static void yy_yypstack (yyGLRState* yys) { @@ -2502,7 +2509,7 @@ yy_yypstack (yyGLRState* yys) static void yypstates (yyGLRState* yyst) { - if (yyst == YY_NULL) + if (yyst == YY_NULLPTR) YYFPRINTF (stderr, ""); else yy_yypstack (yyst); @@ -2516,7 +2523,7 @@ yypstack (yyGLRStack* yystackp, size_t yyk) } #define YYINDEX(YYX) \ - ((YYX) == YY_NULL ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems) + ((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems) static void @@ -2530,6 +2537,8 @@ yypdumpstack (yyGLRStack* yystackp) (unsigned long int) (yyp - yystackp->yyitems)); if (*(yybool *) yyp) { + YYASSERT (yyp->yystate.yyisState); + YYASSERT (yyp->yyoption.yyisState); YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld", yyp->yystate.yyresolved, yyp->yystate.yylrState, (unsigned long int) yyp->yystate.yyposn, @@ -2541,6 +2550,8 @@ yypdumpstack (yyGLRStack* yystackp) } else { + YYASSERT (!yyp->yystate.yyisState); + YYASSERT (!yyp->yyoption.yyisState); YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld", yyp->yyoption.yyrule - 1, (long int) YYINDEX (yyp->yyoption.yystate), @@ -2555,18 +2566,22 @@ yypdumpstack (yyGLRStack* yystackp) YYFPRINTF (stderr, "\n"); } #endif -]b4_epilogue[]dnl -b4_output_end() -# glr.cc produces its own header. -m4_if(b4_skeleton, ["glr.c"], -[b4_defines_if( -[b4_output_begin([b4_spec_defines_file]) -b4_copyright([Skeleton interface for Bison GLR parsers in C], - [2002-2013])[ +#undef yylval +#undef yychar +#undef yynerrs]b4_locations_if([ +#undef yylloc]) -]b4_cpp_guard_open([b4_spec_defines_file])[ -]b4_shared_declarations[ -]b4_cpp_guard_close([b4_spec_defines_file])[ -]b4_output_end() -])]) +m4_if(b4_prefix, [yy], [], +[[/* Substitute the variable and function names. */ +#define yyparse ]b4_prefix[parse +#define yylex ]b4_prefix[lex +#define yyerror ]b4_prefix[error +#define yylval ]b4_prefix[lval +#define yychar ]b4_prefix[char +#define yydebug ]b4_prefix[debug +#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ +#define yylloc ]b4_prefix[lloc]])])[ + +]b4_epilogue[]dnl +b4_output_end() diff --git a/data/glr.cc b/data/glr.cc index bb0234a..2ce14bc 100644 --- a/data/glr.cc +++ b/data/glr.cc @@ -1,8 +1,6 @@ - -*- C -*- - # C++ GLR skeleton for Bison -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,7 +27,7 @@ # # The additional arguments are stored as members of the parser # object, yyparser. The C routines need to carry yyparser -# throughout the C parser; that easy: just let yyparser become an +# throughout the C parser; that's easy: make yyparser an # additional parse-param. But because the C++ skeleton needs to # know the "real" original parse-param, we save them # (b4_parse_param_orig). Note that b4_parse_param is overquoted @@ -39,23 +37,17 @@ # The locations # # We use location.cc just like lalr1.cc, but because glr.c stores -# the locations in a (C++) union, the position and location classes +# the locations in a union, the position and location classes # must not have a constructor. Therefore, contrary to lalr1.cc, we # must not define "b4_location_constructors". As a consequence the # user must initialize the first positions (in particular the # filename member). -# We require a pure interface using locations. -m4_define([b4_locations_flag], [1]) +# We require a pure interface. m4_define([b4_pure_flag], [1]) -# The header is mandatory. -b4_defines_if([], - [b4_fatal([b4_skeleton[: using %%defines is mandatory]])]) - m4_include(b4_pkgdatadir/[c++.m4]) -b4_percent_define_ifdef([[api.location.type]], [], - [m4_include(b4_pkgdatadir/[location.cc])]) +b4_bison_locations_if([m4_include(b4_pkgdatadir/[location.cc])]) m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])]) @@ -63,25 +55,37 @@ m4_define([b4_parser_class_name], # Save the parse parameters. m4_define([b4_parse_param_orig], m4_defn([b4_parse_param])) +# b4_parse_param_wrap +# ------------------- +# New ones. +m4_ifset([b4_parse_param], +[m4_define([b4_parse_param_wrap], + [[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],] +m4_defn([b4_parse_param]))], +[m4_define([b4_parse_param_wrap], + [[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]]) +]) + -# b4_yy_symbol_print_generate -# --------------------------- +# b4_yy_symbol_print_define +# ------------------------- # Bypass the default implementation to generate the "yy_symbol_print" # and "yy_symbol_value_print" functions. -m4_define([b4_yy_symbol_print_generate], +m4_define([b4_yy_symbol_print_define], [[ /*--------------------. | Print this symbol. | `--------------------*/ -]b4_c_ansi_function_def([yy_symbol_print], +]b4_function_define([yy_symbol_print], [static void], - [[FILE *], []], - [[int yytype], [yytype]], + [[FILE *], []], + [[int yytype], [yytype]], [[const ]b4_namespace_ref::b4_parser_class_name[::semantic_type *yyvaluep], - [yyvaluep]], + [yyvaluep]][]dnl +b4_locations_if([, [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], - [yylocationp]], + [yylocationp]]]), b4_parse_param)[ { ]b4_parse_param_use[]dnl @@ -90,10 +94,9 @@ m4_define([b4_yy_symbol_print_generate], ]])[ # Hijack the initial action to initialize the locations. -]b4_locations_if([b4_percent_define_ifdef([[api.location.type]], [], -[m4_define([b4_initial_action], +]b4_bison_locations_if([m4_define([b4_initial_action], [yylloc.initialize ();]m4_ifdef([b4_initial_action], [ -m4_defn([b4_initial_action])]))])])[ +m4_defn([b4_initial_action])]))])[ # Hijack the post prologue to insert early definition of YYLLOC_DEFAULT # and declaration of yyerror. @@ -101,43 +104,60 @@ m4_defn([b4_initial_action])]))])])[ [b4_syncline([@oline@], [@ofile@])[ ]b4_yylloc_default_define[ #define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc) -]b4_c_ansi_function_decl([yyerror], - [static void], +]b4_function_declare([yyerror], + [static void],b4_locations_if([ [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], - [yylocationp]], + [yylocationp]],]) b4_parse_param, [[const char* msg], [msg]])]) +#undef yynerrs +#undef yychar +#undef yylval]b4_locations_if([ +#undef yylloc]) + +m4_if(b4_prefix, [yy], [], +[[/* Substitute the variable and function names. */ +#define yyparse ]b4_prefix[parse +#define yylex ]b4_prefix[lex +#define yyerror ]b4_prefix[error +#define yydebug ]b4_prefix[debug +]]b4_pure_if([], [[ +#define yylval ]b4_prefix[lval +#define yychar ]b4_prefix[char +#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ +#define yylloc ]b4_prefix[lloc]])])) + # Hijack the epilogue to define implementations (yyerror, parser member # functions etc.). m4_append([b4_epilogue], [b4_syncline([@oline@], [@ofile@])[ + /*------------------. | Report an error. | `------------------*/ -]b4_c_ansi_function_def([yyerror], - [static void], +]b4_function_define([yyerror], + [static void],b4_locations_if([ [[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], - [yylocationp]], + [yylocationp]],]) b4_parse_param, [[const char* msg], [msg]])[ { ]b4_parse_param_use[]dnl -[ yyparser.error (*yylocationp, msg); +[ yyparser.error (]b4_locations_if([[*yylocationp, ]])[msg); } ]b4_namespace_open[ -]dnl In this section, the parse param are the original parse_params. +]dnl In this section, the parse params are the original parse_params. m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl [ /// Build a parser object. ]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ :])[ #if ]b4_api_PREFIX[DEBUG - ]m4_ifset([b4_parse_param], [ ], [ :])[ - yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ + ]m4_ifset([b4_parse_param], [ ], [ :])[yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ #endif]b4_parse_param_cons[ { } @@ -157,29 +177,29 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl | Print this symbol. | `--------------------*/ - inline void + void ]b4_parser_class_name[::yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp) - { - YYUSE (yylocationp); + const semantic_type* yyvaluep]b4_locations_if([[, + const location_type* yylocationp]])[) + {]b4_locations_if([[ + YYUSE (yylocationp);]])[ YYUSE (yyvaluep); std::ostream& yyoutput = debug_stream (); std::ostream& yyo = yyoutput; YYUSE (yyo); - ]b4_symbol_actions([printers])[ + ]b4_symbol_actions([printer])[ } void ]b4_parser_class_name[::yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp) + const semantic_type* yyvaluep]b4_locations_if([[, + const location_type* yylocationp]])[) { *yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm") - << ' ' << yytname[yytype] << " (" - << *yylocationp << ": "; - yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); + << ' ' << yytname[yytype] << " ("]b4_locations_if([[ + << *yylocationp << ": "]])[; + yy_symbol_value_print_ (yytype, yyvaluep]b4_locations_if([[, yylocationp]])[); *yycdebug_ << ')'; } @@ -214,63 +234,31 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl b4_namespace_close ]) +# b4_shared_declarations +# ---------------------- +# Declaration that might either go into the header (if --defines) +# or open coded in the parser body. +m4_define([b4_shared_declarations], +[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl +b4_percent_code_get([[requires]])[ -# Let glr.c believe that the user arguments include the parser itself. -m4_ifset([b4_parse_param], -[m4_pushdef([b4_parse_param], - [[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],] -m4_defn([b4_parse_param]))], -[m4_pushdef([b4_parse_param], - [[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]]) -]) -m4_include(b4_pkgdatadir/[glr.c]) -m4_popdef([b4_parse_param]) - -b4_output_begin([b4_spec_defines_file]) -b4_copyright([Skeleton interface for Bison GLR parsers in C++], - [2002-2006, 2009-2013])[ - -/* C++ GLR parser skeleton written by Akim Demaille. */ - -]b4_cpp_guard_open([b4_spec_defines_file])[ - -]b4_percent_code_get([[requires]])[ - -# include -# include -]b4_percent_define_ifdef([[api.location.type]], [], - [[# include "location.hh"]])[ +#include +#include +#include ]b4_defines_if([ +b4_bison_locations_if([[#include "location.hh"]])])[ ]b4_YYDEBUG_define[ ]b4_namespace_open[ +]b4_defines_if([], +[b4_bison_locations_if([b4_position_define +b4_location_define])])[ + /// A Bison parser. class ]b4_parser_class_name[ { public: - /// Symbol semantic values. -# ifndef ]b4_api_PREFIX[STYPE -]m4_ifdef([b4_stype], -[ union semantic_type - { -b4_user_stype - };], -[m4_if(b4_tag_seen_flag, 0, -[[ typedef int semantic_type;]], -[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])[ -# else - typedef ]b4_api_PREFIX[STYPE semantic_type; -# endif - /// Symbol locations. - typedef ]b4_percent_define_get([[api.location.type]], - [[location]])[ location_type; - /// Tokens. - struct token - { - ]b4_token_enums(b4_tokens)[ - }; - /// Token type. - typedef token::yytokentype token_type; +]b4_public_types_declare[ /// Build a parser object. ]b4_parser_class_name[ (]b4_parse_param_decl[); @@ -292,42 +280,39 @@ b4_user_stype /// Set the current debugging level. void set_debug_level (debug_level_type l); - private: - public: - /// Report a syntax error. - /// \param loc where the syntax error is found. + /// Report a syntax error.]b4_locations_if([[ + /// \param loc where the syntax error is found.]])[ /// \param msg a description of the syntax error. - virtual void error (const location_type& loc, const std::string& msg); - private: + virtual void error (]b4_locations_if([[const location_type& loc, ]])[const std::string& msg); # if ]b4_api_PREFIX[DEBUG public: /// \brief Report a symbol value on the debug stream. /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. + /// \param yyvaluep Its semantic value.]b4_locations_if([[ + /// \param yylocationp Its location.]])[ virtual void yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); + const semantic_type* yyvaluep]b4_locations_if([[, + const location_type* yylocationp]])[); /// \brief Report a symbol on the debug stream. /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. + /// \param yyvaluep Its semantic value.]b4_locations_if([[ + /// \param yylocationp Its location.]])[ virtual void yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); + const semantic_type* yyvaluep]b4_locations_if([[, + const location_type* yylocationp]])[); private: - /* Debugging. */ + // Debugging. std::ostream* yycdebug_; -# endif +#endif ]b4_parse_param_vars[ }; ]dnl Redirections for glr.c. b4_percent_define_flag_if([[global_tokens_and_yystype]], -[b4_token_defines(b4_tokens)]) +[b4_token_defines]) [ #ifndef ]b4_api_PREFIX[STYPE # define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type @@ -338,5 +323,23 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]], ]b4_namespace_close[ ]b4_percent_code_get([[provides]])[ +]m4_popdef([b4_parse_param])dnl +]) + +b4_defines_if( +[b4_output_begin([b4_spec_defines_file]) +b4_copyright([Skeleton interface for Bison GLR parsers in C++], + [2002-2015, 2018])[ + +// C++ GLR parser skeleton written by Akim Demaille. + +]b4_cpp_guard_open([b4_spec_defines_file])[ +]b4_shared_declarations[ ]b4_cpp_guard_close([b4_spec_defines_file])[ -]b4_output_end() +]b4_output_end()]) + +# Let glr.c (and b4_shared_declarations) believe that the user +# arguments include the parser itself. +m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_wrap])) +m4_include(b4_pkgdatadir/[glr.c]) +m4_popdef([b4_parse_param]) diff --git a/data/java-skel.m4 b/data/java-skel.m4 index 384a637..79c3f53 100644 --- a/data/java-skel.m4 +++ b/data/java-skel.m4 @@ -2,7 +2,7 @@ # Java skeleton dispatching for Bison. -# Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/data/java.m4 b/data/java.m4 index 7c2cfef..5ac145c 100644 --- a/data/java.m4 +++ b/data/java.m4 @@ -2,7 +2,7 @@ # Java language support for Bison -# Copyright (C) 2007-2013 Free Software Foundation, Inc. +# Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,18 +19,12 @@ m4_include(b4_pkgdatadir/[c-like.m4]) -# b4_comment(TEXT) -# ---------------- -m4_define([b4_comment], [/* m4_bpatsubst([$1], [ -], [ - ]) */]) - # b4_list2(LIST1, LIST2) -# -------------------------- +# ---------------------- # Join two lists with a comma if necessary. m4_define([b4_list2], - [$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2]) + [$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2]) # b4_percent_define_get3(DEF, PRE, POST, NOT) @@ -38,8 +32,8 @@ m4_define([b4_list2], # Expand to the value of DEF surrounded by PRE and POST if it's %define'ed, # otherwise NOT. m4_define([b4_percent_define_get3], - [m4_ifval(m4_quote(b4_percent_define_get([$1])), - [$2[]b4_percent_define_get([$1])[]$3], [$4])]) + [m4_ifval(m4_quote(b4_percent_define_get([$1])), + [$2[]b4_percent_define_get([$1])[]$3], [$4])]) @@ -104,12 +98,12 @@ m4_define([b4_identification], m4_define([b4_int_type], [m4_if(b4_ints_in($@, [-128], [127]), [1], [byte], b4_ints_in($@, [-32768], [32767]), [1], [short], - [int])]) + [int])]) # b4_int_type_for(NAME) # --------------------- # Return the smallest int type able to handle numbers ranging from -# `NAME_min' to `NAME_max' (included). +# 'NAME_min' to 'NAME_max' (included). m4_define([b4_int_type_for], [b4_int_type($1_min, $1_max)]) @@ -118,27 +112,45 @@ m4_define([b4_int_type_for], m4_define([b4_null], [null]) +# b4_typed_parser_table_define(TYPE, NAME, DATA, COMMENT) +# ------------------------------------------------------- +m4_define([b4_typed_parser_table_define], +[m4_ifval([$4], [b4_comment([$4]) + ])dnl +[private static final ]$1[ yy$2_[] = yy$2_init(); + private static final ]$1[[] yy$2_init() + { + return new ]$1[[] + { + ]$3[ + }; + }]]) + + +# b4_integral_parser_table_define(NAME, DATA, COMMENT) +#----------------------------------------------------- +m4_define([b4_integral_parser_table_define], +[b4_typed_parser_table_define([b4_int_type_for([$2])], [$1], [$2], [$3])]) + + ## ------------------------- ## ## Assigning token numbers. ## ## ------------------------- ## -# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER) -# --------------------------------------- +# b4_token_enum(TOKEN-NUM) +# ------------------------ # Output the definition of this token as an enum. m4_define([b4_token_enum], -[ /** Token number, to be returned by the scanner. */ - public static final int $1 = $2; -]) - +[b4_token_format([ /** Token number, to be returned by the scanner. */ + static final int %s = %s; +], [$1])]) -# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) -# ----------------------------------------------------- +# b4_token_enums +# -------------- # Output the definition of the tokens (if there are) as enums. m4_define([b4_token_enums], -[m4_if([$#$1], [1], [], -[/* Tokens. */ -m4_map([b4_token_enum], [$@])]) -]) +[b4_any_token_visible_if([/* Tokens. */ +b4_symbol_foreach([b4_token_enum])])]) # b4-case(ID, CODE) # ----------------- @@ -149,13 +161,36 @@ m4_define([b4_case], [ case $1: break; ]) +# b4_predicate_case(LABEL, CONDITIONS) +# ------------------------------------ +m4_define([b4_predicate_case], [ case $1: + if (! ($2)) YYERROR; + break; + ]) + + +## -------- ## +## Checks. ## +## -------- ## + +b4_percent_define_check_kind([[api.value.type]], [code], [deprecated]) + +b4_percent_define_check_kind([[annotations]], [code], [deprecated]) +b4_percent_define_check_kind([[extends]], [code], [deprecated]) +b4_percent_define_check_kind([[implements]], [code], [deprecated]) +b4_percent_define_check_kind([[init_throws]], [code], [deprecated]) +b4_percent_define_check_kind([[lex_throws]], [code], [deprecated]) +b4_percent_define_check_kind([[parser_class_name]], [code], [deprecated]) +b4_percent_define_check_kind([[throws]], [code], [deprecated]) + + ## ---------------- ## ## Default values. ## ## ---------------- ## -m4_define([b4_yystype], [b4_percent_define_get([[stype]])]) -b4_percent_define_default([[stype]], [[Object]]) +m4_define([b4_yystype], [b4_percent_define_get([[api.value.type]])]) +b4_percent_define_default([[api.value.type]], [[Object]]) # %name-prefix m4_define_default([b4_prefix], [[YY]]) @@ -169,6 +204,9 @@ m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])]) b4_percent_define_default([[throws]], []) m4_define([b4_throws], [b4_percent_define_get([[throws]])]) +b4_percent_define_default([[init_throws]], []) +m4_define([b4_init_throws], [b4_percent_define_get([[init_throws]])]) + b4_percent_define_default([[api.location.type]], [Location]) m4_define([b4_location_type], [b4_percent_define_get([[api.location.type]])]) @@ -224,16 +262,16 @@ m4_define([b4_lex_param], b4_lex_param) m4_define([b4_parse_param], b4_parse_param) # b4_lex_param_decl -# ------------------- +# ----------------- # Extra formal arguments of the constructor. m4_define([b4_lex_param_decl], [m4_ifset([b4_lex_param], [b4_remove_comma([$1], - b4_param_decls(b4_lex_param))], - [$1])]) + b4_param_decls(b4_lex_param))], + [$1])]) m4_define([b4_param_decls], - [m4_map([b4_param_decl], [$@])]) + [m4_map([b4_param_decl], [$@])]) m4_define([b4_param_decl], [, $1]) m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)]) @@ -246,21 +284,21 @@ m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)]) m4_define([b4_parse_param_decl], [m4_ifset([b4_parse_param], [b4_remove_comma([$1], - b4_param_decls(b4_parse_param))], - [$1])]) + b4_param_decls(b4_parse_param))], + [$1])]) # b4_lex_param_call -# ------------------- +# ----------------- # Delegating the lexer parameters to the lexer constructor. m4_define([b4_lex_param_call], [m4_ifset([b4_lex_param], - [b4_remove_comma([$1], - b4_param_calls(b4_lex_param))], - [$1])]) + [b4_remove_comma([$1], + b4_param_calls(b4_lex_param))], + [$1])]) m4_define([b4_param_calls], - [m4_map([b4_param_call], [$@])]) + [m4_map([b4_param_call], [$@])]) m4_define([b4_param_call], [, $2]) @@ -270,13 +308,13 @@ m4_define([b4_param_call], [, $2]) # Extra initialisations of the constructor. m4_define([b4_parse_param_cons], [m4_ifset([b4_parse_param], - [b4_constructor_calls(b4_parse_param)])]) + [b4_constructor_calls(b4_parse_param)])]) m4_define([b4_constructor_calls], - [m4_map([b4_constructor_call], [$@])]) + [m4_map([b4_constructor_call], [$@])]) m4_define([b4_constructor_call], - [this.$2 = $2; - ]) + [this.$2 = $2; + ]) @@ -285,15 +323,15 @@ m4_define([b4_constructor_call], # Extra instance variables. m4_define([b4_parse_param_vars], [m4_ifset([b4_parse_param], - [ + [ /* User arguments. */ b4_var_decls(b4_parse_param)])]) m4_define([b4_var_decls], - [m4_map_sep([b4_var_decl], [ + [m4_map_sep([b4_var_decl], [ ], [$@])]) m4_define([b4_var_decl], - [ protected final $1;]) + [ protected final $1;]) @@ -301,4 +339,4 @@ m4_define([b4_var_decl], # ----------------------- # Expand to either an empty string or "throws THROWS". m4_define([b4_maybe_throws], - [m4_ifval($1, [throws $1])]) + [m4_ifval($1, [throws $1])]) diff --git a/data/lalr1.cc b/data/lalr1.cc index f656869..afebda5 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -1,6 +1,6 @@ # C++ skeleton for Bison -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,73 +17,164 @@ m4_include(b4_pkgdatadir/[c++.m4]) -m4_define([b4_parser_class_name], - [b4_percent_define_get([[parser_class_name]])]) +# api.value.type=variant is valid. +m4_define([b4_value_type_setup_variant]) -# The header is mandatory. -b4_defines_if([], - [b4_fatal([b4_skeleton[: using %%defines is mandatory]])]) +# b4_integral_parser_table_declare(TABLE-NAME, CONTENT, COMMENT) +# -------------------------------------------------------------- +# Declare "parser::yy_" whose contents is CONTENT. +m4_define([b4_integral_parser_table_declare], +[m4_ifval([$3], [b4_comment([$3], [ ]) +])dnl + static const b4_int_type_for([$2]) yy$1_[[]];dnl +]) -b4_percent_define_ifdef([[api.location.type]], [], - [# Backward compatibility. - m4_define([b4_location_constructors]) - m4_include(b4_pkgdatadir/[location.cc])]) -m4_include(b4_pkgdatadir/[stack.hh]) +# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT) +# ------------------------------------------------------------- +# Define "parser::yy_" whose contents is CONTENT. +m4_define([b4_integral_parser_table_define], +[ const b4_int_type_for([$2]) + b4_parser_class_name::yy$1_[[]] = + { + $2 + };dnl +]) -b4_defines_if( -[b4_output_begin([b4_spec_defines_file]) -b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++], - [2002-2013]) -[ -/** - ** \file ]b4_spec_defines_file[ - ** Define the ]b4_namespace_ref[::parser class. - */ +# b4_symbol_value_template(VAL, [TYPE]) +# ------------------------------------- +# Same as b4_symbol_value, but used in a template method. It makes +# a difference when using variants. Note that b4_value_type_setup_union +# overrides b4_symbol_value, so we must override it again. +m4_copy([b4_symbol_value], [b4_symbol_value_template]) +m4_append([b4_value_type_setup_union], + [m4_copy_force([b4_symbol_value_union], [b4_symbol_value_template])]) + +# b4_lhs_value([TYPE]) +# -------------------- +# Expansion of $$. +m4_define([b4_lhs_value], + [b4_symbol_value([yylhs.value], [$1])]) + + +# b4_lhs_location() +# ----------------- +# Expansion of @$. +m4_define([b4_lhs_location], + [yylhs.location]) + + +# b4_rhs_data(RULE-LENGTH, NUM) +# ----------------------------- +# Return the data corresponding to the symbol #NUM, where the current +# rule has RULE-LENGTH symbols on RHS. +m4_define([b4_rhs_data], + [yystack_@{b4_subtract($@)@}]) + + +# b4_rhs_state(RULE-LENGTH, NUM) +# ------------------------------ +# The state corresponding to the symbol #NUM, where the current +# rule has RULE-LENGTH symbols on RHS. +m4_define([b4_rhs_state], + [b4_rhs_data([$1], [$2]).state]) + + +# b4_rhs_value(RULE-LENGTH, NUM, [TYPE]) +# -------------------------------------- +# Expansion of $NUM, where the current rule has RULE-LENGTH +# symbols on RHS. +m4_define([b4_rhs_value], + [b4_symbol_value([b4_rhs_data([$1], [$2]).value], [$3])]) + + +# b4_rhs_location(RULE-LENGTH, NUM) +# --------------------------------- +# Expansion of @NUM, where the current rule has RULE-LENGTH symbols +# on RHS. +m4_define([b4_rhs_location], + [b4_rhs_data([$1], [$2]).location]) + + +# b4_symbol_action(SYMBOL-NUM, KIND) +# ---------------------------------- +# Run the action KIND (destructor or printer) for SYMBOL-NUM. +# Same as in C, but using references instead of pointers. +m4_define([b4_symbol_action], +[b4_symbol_if([$1], [has_$2], +[m4_pushdef([b4_symbol_value], m4_defn([b4_symbol_value_template]))[]dnl +b4_dollar_pushdef([yysym.value], + b4_symbol_if([$1], [has_type], + [m4_dquote(b4_symbol([$1], [type]))]), + [yysym.location])dnl + b4_symbol_case_([$1]) +b4_syncline([b4_symbol([$1], [$2_line])], ["b4_symbol([$1], [$2_file])"]) + b4_symbol([$1], [$2]) +b4_syncline([@oline@], [@ofile@]) + break; -/* C++ LALR(1) parser skeleton written by Akim Demaille. */ +m4_popdef([b4_symbol_value])[]dnl +b4_dollar_popdef[]dnl +])]) -]b4_cpp_guard_open([b4_spec_defines_file])[ -]b4_percent_code_get([[requires]])[ +# b4_lex +# ------ +# Call yylex. +m4_define([b4_lex], +[b4_token_ctor_if( +[b4_function_call([yylex], + [symbol_type], m4_ifdef([b4_lex_param], b4_lex_param))], +[b4_function_call([yylex], [int], + [b4_api_PREFIX[STYPE*], [&yyla.value]][]dnl +b4_locations_if([, [[location*], [&yyla.location]]])dnl +m4_ifdef([b4_lex_param], [, ]b4_lex_param))])]) + -#include -#include -#include "stack.hh" -]b4_percent_define_ifdef([[api.location.type]], [], - [[#include "location.hh"]])[ +m4_pushdef([b4_copyright_years], + [2002-2015, 2018]) +m4_define([b4_parser_class_name], + [b4_percent_define_get([[parser_class_name]])]) + +b4_bison_locations_if([# Backward compatibility. + m4_define([b4_location_constructors]) + m4_include(b4_pkgdatadir/[location.cc])]) +m4_include(b4_pkgdatadir/[stack.hh]) +b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])]) + +# b4_shared_declarations(hh|cc) +# ----------------------------- +# Declaration that might either go into the header (if --defines, $1 = hh) +# or open coded in the parser body. +m4_define([b4_shared_declarations], +[b4_percent_code_get([[requires]])[ +]b4_parse_assert_if([# include ])[ +# include // std::abort +# include +# include +# include +# include ]b4_defines_if([[ +# include "stack.hh" +]b4_bison_locations_if([[# include "location.hh"]])])[ +]b4_variant_if([b4_variant_includes])[ + +]b4_attribute_define[ ]b4_YYDEBUG_define[ ]b4_namespace_open[ +]b4_defines_if([], +[b4_stack_define +b4_bison_locations_if([b4_position_define +b4_location_define])])[ + +]b4_variant_if([b4_variant_define])[ + /// A Bison parser. class ]b4_parser_class_name[ { public: - /// Symbol semantic values. -#ifndef ]b4_api_PREFIX[STYPE -]m4_ifdef([b4_stype], -[ union semantic_type - { -b4_user_stype - };], -[m4_if(b4_tag_seen_flag, 0, -[[ typedef int semantic_type;]], -[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])[ -#else - typedef ]b4_api_PREFIX[STYPE semantic_type; -#endif - /// Symbol locations. - typedef ]b4_percent_define_get([[api.location.type]], - [[location]])[ location_type; - /// Tokens. - struct token - { - ]b4_token_enums(b4_tokens)[ - }; - /// Token type. - typedef token::yytokentype token_type; - +]b4_public_types_declare[ /// Build a parser object. ]b4_parser_class_name[ (]b4_parse_param_decl[); virtual ~]b4_parser_class_name[ (); @@ -94,66 +185,44 @@ b4_user_stype #if ]b4_api_PREFIX[DEBUG /// The current debugging stream. - std::ostream& debug_stream () const; + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; /// Set the current debugging stream. void set_debug_stream (std::ostream &); /// Type for debugging levels. typedef int debug_level_type; /// The current debugging level. - debug_level_type debug_level () const; + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; /// Set the current debugging level. void set_debug_level (debug_level_type l); #endif + /// Report a syntax error.]b4_locations_if([[ + /// \param loc where the syntax error is found.]])[ + /// \param msg a description of the syntax error. + virtual void error (]b4_locations_if([[const location_type& loc, ]])[const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + private: /// This class is not copyable. ]b4_parser_class_name[ (const ]b4_parser_class_name[&); ]b4_parser_class_name[& operator= (const ]b4_parser_class_name[&); - /// Report a syntax error. - /// \param loc where the syntax error is found. - /// \param msg a description of the syntax error. - virtual void error (const location_type& loc, const std::string& msg); + /// State numbers. + typedef int state_type; /// Generate an error message. - /// \param state the state where the error occurred. - /// \param tok the lookahead token. - virtual std::string yysyntax_error_ (int yystate, int tok); - -#if ]b4_api_PREFIX[DEBUG - /// \brief Report a symbol value on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); - /// \brief Report a symbol on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); -#endif + /// \param yystate the state where the error occurred. + /// \param yyla the lookahead token. + virtual std::string yysyntax_error_ (state_type yystate, + const symbol_type& yyla) const; - - /// State numbers. - typedef int state_type; - /// State stack type. - typedef stack state_stack_type; - /// Semantic value stack type. - typedef stack semantic_stack_type; - /// location stack type. - typedef stack location_stack_type; - - /// The state stack. - state_stack_type yystate_stack_; - /// The semantic value stack. - semantic_stack_type yysemantic_stack_; - /// The location stack. - location_stack_type yylocation_stack_; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + state_type yy_lr_goto_state_ (state_type yystate, int yysym); /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check @@ -163,38 +232,14 @@ b4_user_stype /// \param yyvalue the value to check static bool yy_table_value_is_error_ (int yyvalue); - /// Internal symbol numbers. - typedef ]b4_int_type_for([b4_translate])[ token_number_type; - /* Tables. */ - /// For a state, the index in \a yytable_ of its portion. - static const ]b4_int_type_for([b4_pact])[ yypact_[]; static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_; - - /// For a state, default reduction number. - /// Unless\a yytable_ specifies something else to do. - /// Zero means the default is an error. - static const ]b4_int_type_for([b4_defact])[ yydefact_[]; - - static const ]b4_int_type_for([b4_pgoto])[ yypgoto_[]; - static const ]b4_int_type_for([b4_defgoto])[ yydefgoto_[]; - - /// What to do in a state. - /// \a yytable_[yypact_[s]]: what to do in state \a s. - /// - if positive, shift that token. - /// - if negative, reduce the rule which number is the opposite. - /// - if zero, do what YYDEFACT says. - static const ]b4_int_type_for([b4_table])[ yytable_[]; static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_; - static const ]b4_int_type_for([b4_check])[ yycheck_[]; - - /// For a state, its accessing symbol. - static const ]b4_int_type_for([b4_stos])[ yystos_[]; + /// Convert a scanner token number \a t to a symbol number. + static token_number_type yytranslate_ (]b4_token_ctor_if([token_type], [int])[ t); - /// For a rule, its LHS. - static const ]b4_int_type_for([b4_r1])[ yyr1_[]; - /// For a rule, its RHS length. - static const ]b4_int_type_for([b4_r2])[ yyr2_[]; ]b4_error_verbose_if([ + // Tables. +]b4_parser_tables_declare[]b4_error_verbose_if([ /// Convert the symbol name \a n to a form suitable for a diagnostic. static std::string yytnamerr_ (const char *n);])[ @@ -203,98 +248,176 @@ b4_user_stype /// For a symbol, its name in clear. static const char* const yytname_[]; ]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[ - /// A type to store symbol numbers and -1. - typedef ]b4_int_type_for([b4_rhs])[ rhs_number_type; - /// A `-1'-separated list of the rules' RHS. - static const rhs_number_type yyrhs_[]; - /// For each rule, the index of the first RHS symbol in \a yyrhs_. - static const ]b4_int_type_for([b4_prhs])[ yyprhs_[]; - /// For each rule, its source line number. - static const ]b4_int_type_for([b4_rline])[ yyrline_[]; - /// For each scanner token number, its symbol number. - static const ]b4_int_type_for([b4_toknum])[ yytoken_number_[]; +]b4_integral_parser_table_declare([rline], [b4_rline], + [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[ /// Report on the debug stream that the rule \a r is going to be reduced. virtual void yy_reduce_print_ (int r); /// Print the state stack on the debug stream. virtual void yystack_print_ (); - /* Debugging. */ + // Debugging. int yydebug_; std::ostream* yycdebug_; -#endif - /// Convert a scanner token number \a t to a symbol number. - token_number_type yytranslate_ (int t); + /// \brief Display a symbol type, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif /// \brief Reclaim the memory associated to a symbol. - /// \param yymsg Why this token is reclaimed. - /// If null, do not display the symbol, just free it. - /// \param yytype The symbol type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - inline void yydestruct_ (const char* yymsg, - int yytype, - semantic_type* yyvaluep, - location_type* yylocationp); + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state (); + + /// The symbol type as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s); + + /// Copy constructor. + by_state (const by_state& other); + + /// Record that this symbol is empty. + void clear (); + + /// Steal the symbol type from \a that. + void move (by_state& that); + + /// The (internal) type number (corresponding to \a state). + /// \a empty_symbol when empty. + symbol_number_type type_get () const; + + /// The state number used to denote an empty symbol. + enum { empty_state = -1 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Copy construct. + stack_symbol_type (const stack_symbol_type& that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, symbol_type& sym); + /// Assignment, needed by push_back. + stack_symbol_type& operator= (const stack_symbol_type& that); + }; + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, stack_symbol_type& s); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, state_type s, symbol_type& sym); /// Pop \a n symbols the three stacks. - inline void yypop_ (unsigned int n = 1); - - /* Constants. */ - static const int yyeof_; - /* LAST_ -- Last index in TABLE_. */ - static const int yylast_; - static const int yynnts_; - static const int yyempty_; - static const int yyfinal_; - static const int yyterror_; - static const int yyerrcode_; - static const int yyntokens_; - static const unsigned int yyuser_token_number_max_; - static const token_number_type yyundef_token_; + void yypop_ (unsigned n = 1); + + /// Constants. + enum + { + yyeof_ = 0, + yylast_ = ]b4_last[, ///< Last index in yytable_. + yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols. + yyfinal_ = ]b4_final_state_number[, ///< Termination state number. + yyterror_ = 1, + yyerrcode_ = 256, + yyntokens_ = ]b4_tokens_number[ ///< Number of tokens. + }; + ]b4_parse_param_vars[ }; + +]b4_token_ctor_if([b4_yytranslate_define([$1])[ +]b4_public_types_define([$1])])[ ]b4_namespace_close[ ]b4_percent_define_flag_if([[global_tokens_and_yystype]], -[b4_token_defines(b4_tokens) +[b4_token_defines #ifndef ]b4_api_PREFIX[STYPE - /* Redirection for backward compatibility. */ + // Redirection for backward compatibility. # define ]b4_api_PREFIX[STYPE b4_namespace_ref::b4_parser_class_name::semantic_type #endif ])[ ]b4_percent_code_get([[provides]])[ +]]) + +b4_defines_if( +[b4_output_begin([b4_spec_defines_file]) +b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++]) +[ +/** + ** \file ]b4_spec_defines_file[ + ** Define the ]b4_namespace_ref[::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +]b4_cpp_guard_open([b4_spec_defines_file])[ +]b4_shared_declarations(hh)[ ]b4_cpp_guard_close([b4_spec_defines_file]) b4_output_end() ]) b4_output_begin([b4_parser_file_name]) -b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++], - [2002-2013]) +b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++]) b4_percent_code_get([[top]])[]dnl m4_if(b4_prefix, [yy], [], [ // Take the name prefix into account. #define yylex b4_prefix[]lex])[ -/* First part of user declarations. */ +// First part of user declarations. ]b4_user_pre_prologue[ -]b4_defines_if([[ -#include "@basename(]b4_spec_defines_file[@)"]])[ +]b4_null_define[ -/* User implementation prologue. */ +]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]], + [b4_shared_declarations([cc])])[ + +// User implementation prologue. ]b4_user_post_prologue[ ]b4_percent_code_get[ -]b4_null_define[ - #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS -# include /* FIXME: INFRINGES ON USER NAME SPACE */ +# include // FIXME: INFRINGES ON USER NAME SPACE. # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif @@ -303,55 +426,56 @@ m4_if(b4_prefix, [yy], [], # endif #endif -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -]b4_yylloc_default_define[ +]b4_locations_if([dnl +[#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +]b4_yylloc_default_define])[ -/* Suppress unused-variable warnings by "using" E. */ -#define YYUSE(e) ((void) (e)) +// Suppress unused-variable warnings by "using" E. +#define YYUSE(E) ((void) (E)) -/* Enable debugging if requested. */ +// Enable debugging if requested. #if ]b4_api_PREFIX[DEBUG -/* A pseudo ostream that takes yydebug_ into account. */ +// A pseudo ostream that takes yydebug_ into account. # define YYCDEBUG if (yydebug_) (*yycdebug_) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug_) \ - { \ - *yycdebug_ << Title << ' '; \ - yy_symbol_print_ ((Type), (Value), (Location)); \ - *yycdebug_ << std::endl; \ - } \ -} while (false) - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug_) \ - yy_reduce_print_ (Rule); \ -} while (false) - -# define YY_STACK_PRINT() \ -do { \ - if (yydebug_) \ - yystack_print_ (); \ -} while (false) - -#else /* !]b4_api_PREFIX[DEBUG */ +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yystack_print_ (); \ + } while (false) + +#else // !]b4_api_PREFIX[DEBUG # define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type) -# define YY_REDUCE_PRINT(Rule) static_cast(0) -# define YY_STACK_PRINT() static_cast(0) +# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) -#endif /* !]b4_api_PREFIX[DEBUG */ +#endif // !]b4_api_PREFIX[DEBUG -#define yyerrok (yyerrstatus_ = 0) -#define yyclearin (yychar = yyempty_) +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus_) ]b4_namespace_open[]b4_error_verbose_if([[ @@ -379,7 +503,7 @@ do { \ case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; - /* Fall through. */ + // Fall through. default: yyr += *yyp; break; @@ -401,63 +525,137 @@ do { \ ]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false), yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ #endif]b4_parse_param_cons[ + {} + + ]b4_parser_class_name::~b4_parser_class_name[ () + {} + + + /*---------------. + | Symbol types. | + `---------------*/ + +]b4_token_ctor_if([], [b4_public_types_define([cc])])[ + + // by_state. + ]b4_parser_class_name[::by_state::by_state () + : state (empty_state) + {} + + ]b4_parser_class_name[::by_state::by_state (const by_state& other) + : state (other.state) + {} + + void + ]b4_parser_class_name[::by_state::clear () { + state = empty_state; } - ]b4_parser_class_name::~b4_parser_class_name[ () + void + ]b4_parser_class_name[::by_state::move (by_state& that) { + state = that.state; + that.clear (); } -#if ]b4_api_PREFIX[DEBUG - /*--------------------------------. - | Print this symbol on YYOUTPUT. | - `--------------------------------*/ + ]b4_parser_class_name[::by_state::by_state (state_type s) + : state (s) + {} - inline void - ]b4_parser_class_name[::yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, const location_type* yylocationp) + ]b4_parser_class_name[::symbol_number_type + ]b4_parser_class_name[::by_state::type_get () const { - YYUSE (yylocationp); - YYUSE (yyvaluep); - std::ostream& yyo = debug_stream (); - std::ostream& yyoutput = yyo; - YYUSE (yyoutput); - ]b4_symbol_actions([printers])[ + if (state == empty_state) + return empty_symbol; + else + return yystos_[state]; } + ]b4_parser_class_name[::stack_symbol_type::stack_symbol_type () + {} + + ]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that) + : super_type (that.state]b4_locations_if([, that.location])[) + { + ]b4_variant_if([b4_symbol_variant([that.type_get ()], + [value], [copy], [that.value])], + [[value = that.value;]])[ + } + ]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that) + : super_type (s]b4_locations_if([, that.location])[) + { + ]b4_variant_if([b4_symbol_variant([that.type_get ()], + [value], [move], [that.value])], + [[value = that.value;]])[ + // that is emptied. + that.type = empty_symbol; + } + + ]b4_parser_class_name[::stack_symbol_type& + ]b4_parser_class_name[::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + ]b4_variant_if([b4_symbol_variant([that.type_get ()], + [value], [copy], [that.value])], + [[value = that.value;]])[]b4_locations_if([ + location = that.location;])[ + return *this; + } + + + template void - ]b4_parser_class_name[::yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, const location_type* yylocationp) + ]b4_parser_class_name[::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const { - *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") - << ' ' << yytname_[yytype] << " (" - << *yylocationp << ": "; - yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); - *yycdebug_ << ')'; + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym);]b4_variant_if([], [ + + // User destructor. + b4_symbol_actions([destructor], [yysym.type_get ()])])[ } -#endif +#if ]b4_api_PREFIX[DEBUG + template void - ]b4_parser_class_name[::yydestruct_ (const char* yymsg, - int yytype, semantic_type* yyvaluep, location_type* yylocationp) + ]b4_parser_class_name[::yy_print_ (std::ostream& yyo, + const basic_symbol& yysym) const { - YYUSE (yylocationp); - YYUSE (yymsg); - YYUSE (yyvaluep); + std::ostream& yyoutput = yyo; + YYUSE (yyoutput); + symbol_number_type yytype = yysym.type_get (); + // Avoid a (spurious) G++ 4.8 warning about "array subscript is + // below array bounds". + if (yysym.empty ()) + std::abort (); + yyo << (yytype < yyntokens_ ? "token" : "nterm") + << ' ' << yytname_[yytype] << " ("]b4_locations_if([ + << yysym.location << ": "])[; + ]b4_symbol_actions([printer])[ + yyo << ')'; + } +#endif - if (yymsg) - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + void + ]b4_parser_class_name[::yypush_ (const char* m, state_type s, symbol_type& sym) + { + stack_symbol_type t (s, sym); + yypush_ (m, t); + } - ]b4_symbol_actions([destructors])[ + void + ]b4_parser_class_name[::yypush_ (const char* m, stack_symbol_type& s) + { + if (m) + YY_SYMBOL_PRINT (m, s); + yystack_.push (s); } void - ]b4_parser_class_name[::yypop_ (unsigned int n) + ]b4_parser_class_name[::yypop_ (unsigned n) { - yystate_stack_.pop (n); - yysemantic_stack_.pop (n); - yylocation_stack_.pop (n); + yystack_.pop (n); } #if ]b4_api_PREFIX[DEBUG @@ -485,15 +683,25 @@ do { \ { yydebug_ = l; } -#endif +#endif // ]b4_api_PREFIX[DEBUG + + ]b4_parser_class_name[::state_type + ]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - yyntokens_] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - yyntokens_]; + } - inline bool + bool ]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue) { return yyvalue == yypact_ninf_; } - inline bool + bool ]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue) { return yyvalue == yytable_ninf_; @@ -502,135 +710,108 @@ do { \ int ]b4_parser_class_name[::parse () { - /// Lookahead and lookahead in internal form. - int yychar = yyempty_; - int yytoken = 0; - // State. int yyn; + /// Length of the RHS of the rule being reduced. int yylen = 0; - int yystate = 0; // Error handling. int yynerrs_ = 0; int yyerrstatus_ = 0; - /// Semantic value of the lookahead. - static semantic_type yyval_default; - semantic_type yylval = yyval_default; - /// Location of the lookahead. - location_type yylloc; - /// The locations where the error started and ended. - location_type yyerror_range[3]; + /// The lookahead symbol. + symbol_type yyla;]b4_locations_if([[ - /// $$. - semantic_type yyval; - /// @@$. - location_type yyloc; + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3];]])[ + /// The return value of parse (). int yyresult; // FIXME: This shoud be completely indented. It is not yet to // avoid gratuitous conflicts when merging into the master branch. try { - YYCDEBUG << "Starting parse" << std::endl; + YYCDEBUG << "Starting parse\n"; ]m4_ifdef([b4_initial_action], [ -b4_dollar_pushdef([yylval], [], [yylloc])dnl -/* User initialization code. */ -b4_user_initial_action +b4_dollar_pushdef([yyla.value], [], [yyla.location])dnl + // User initialization code. + b4_user_initial_action b4_dollar_popdef])[]dnl - [ /* Initialize the stacks. The initial state will be pushed in + [ /* Initialize the stack. The initial state will be set in yynewstate, since the latter expects the semantical and the location values to have been already stored, initialize these stacks with a primary value. */ - yystate_stack_.clear (); - yysemantic_stack_.clear (); - yylocation_stack_.clear (); - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yylloc); + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, yyla); - /* New state. */ + // A new symbol was pushed on the stack. yynewstate: - yystate_stack_.push (yystate); - YYCDEBUG << "Entering state " << yystate << std::endl; + YYCDEBUG << "Entering state " << yystack_[0].state << '\n'; - /* Accept? */ - if (yystate == yyfinal_) + // Accept? + if (yystack_[0].state == yyfinal_) goto yyacceptlab; goto yybackup; - /* Backup. */ + // Backup. yybackup: - /* Try to take a decision without lookahead. */ - yyn = yypact_[yystate]; + // Try to take a decision without lookahead. + yyn = yypact_[yystack_[0].state]; if (yy_pact_value_is_default_ (yyn)) goto yydefault; - /* Read a lookahead token. */ - if (yychar == yyempty_) + // Read a lookahead token. + if (yyla.empty ()) { YYCDEBUG << "Reading a token: "; - yychar = ]b4_c_function_call([yylex], [int], - [b4_api_PREFIX[STYPE*], [&yylval]][]dnl -b4_locations_if([, [[location*], [&yylloc]]])dnl -m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; - } - - /* Convert token to internal form. */ - if (yychar <= yyeof_) - { - yychar = yytoken = yyeof_; - YYCDEBUG << "Now at end of input." << std::endl; - } - else - { - yytoken = yytranslate_ (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + try + {]b4_token_ctor_if([[ + symbol_type yylookahead (]b4_lex[); + yyla.move (yylookahead);]], [[ + yyla.type = yytranslate_ (]b4_lex[);]])[ + } + catch (const syntax_error& yyexc) + { + error (yyexc); + goto yyerrlab1; + } } + YY_SYMBOL_PRINT ("Next token is", yyla); - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.type_get (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ()) goto yydefault; - /* Reduce or error. */ + // Reduce or error. yyn = yytable_[yyn]; if (yyn <= 0) { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; } - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted. */ - yychar = yyempty_; - - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yylloc); - - /* Count tokens shifted since error; after three, turn off error - status. */ + // Count tokens shifted since error; after three, turn off error status. if (yyerrstatus_) --yyerrstatus_; - yystate = yyn; + // Shift the lookahead token. + yypush_ ("Shifting", yyn, yyla); goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: - yyn = yydefact_[yystate]; + yyn = yydefact_[yystack_[0].state]; if (yyn == 0) goto yyerrlab; goto yyreduce; @@ -640,99 +821,88 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; `-----------------------------*/ yyreduce: yylen = yyr2_[yyn]; - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. Otherwise, use the top of the stack. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. */ - if (yylen) - yyval = yysemantic_stack_[yylen - 1]; - else - yyval = yysemantic_stack_[0]; - - // Compute the default @@$. { - slice slice (yylocation_stack_, yylen); - YYLLOC_DEFAULT (yyloc, slice, yylen); - } - - // Perform the reduction. - YY_REDUCE_PRINT (yyn); - switch (yyn) + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([ + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [build])], [ + /* If YYLEN is nonzero, implement the default value of the + action: '$$ = $1'. Otherwise, use the top of the stack. + + Otherwise, the following line sets YYLHS.VALUE to garbage. + This behavior is undocumented and Bison users should not rely + upon it. */ + if (yylen) + yylhs.value = yystack_@{yylen - 1@}.value; + else + yylhs.value = yystack_@{0@}.value;])[ +]b4_locations_if([dnl +[ + // Default location. { - ]b4_user_actions[ - default: - break; - } - - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action - invokes YYABORT, YYACCEPT, or YYERROR immediately after altering - yychar. In the case of YYABORT or YYACCEPT, an incorrect - destructor might then be invoked immediately. In the case of - YYERROR, subsequent parser actions might lead to an incorrect - destructor call or verbose syntax error message before the - lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); - - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - - yysemantic_stack_.push (yyval); - yylocation_stack_.push (yyloc); + slice slice (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, slice, yylen); + yyerror_range[1].location = yylhs.location; + }]])[ + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); + try + { + switch (yyn) + { +]b4_user_actions[ + default: + break; + } + } + catch (const syntax_error& yyexc) + { + error (yyexc); + YYERROR; + } + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); - /* Shift the result of the reduction. */ - yyn = yyr1_[yyn]; - yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; - if (0 <= yystate && yystate <= yylast_ - && yycheck_[yystate] == yystate_stack_[0]) - yystate = yytable_[yystate]; - else - yystate = yydefgoto_[yyn - yyntokens_]; + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, yylhs); + } goto yynewstate; - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - - /* If not already recovering from an error, report this error. */ + // If not already recovering from an error, report this error. if (!yyerrstatus_) { - ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; - error (yylloc, yysyntax_error_ (yystate, yytoken)); + ++yynerrs_; + error (]b4_join(b4_locations_if([yyla.location]), + [[yysyntax_error_ (yystack_[0].state, yyla)]])[); } - yyerror_range[1] = yylloc; +]b4_locations_if([[ + yyerror_range[1].location = yyla.location;]])[ if (yyerrstatus_ == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ - if (yychar <= yyeof_) - { - /* Return failure if at end of input. */ - if (yychar == yyeof_) - YYABORT; - } - else + + // Return failure if at end of input. + if (yyla.type_get () == yyeof_) + YYABORT; + else if (!yyla.empty ()) { - yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); - yychar = yyempty_; + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); } } - /* Else will try to reuse lookahead token after shifting the error - token. */ + // Else will try to reuse lookahead token after shifting the error token. goto yyerrlab1; @@ -746,130 +916,107 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; code. */ if (false) goto yyerrorlab; - - yyerror_range[1] = yylocation_stack_[yylen - 1]; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ yypop_ (yylen); yylen = 0; - yystate = yystate_stack_[0]; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus_ = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yystate_stack_.height () == 1) - YYABORT; - - yyerror_range[1] = yylocation_stack_[0]; - yydestruct_ ("Error: popping", - yystos_[yystate], - &yysemantic_stack_[0], &yylocation_stack_[0]); - yypop_ (); - yystate = yystate_stack_[0]; - YY_STACK_PRINT (); - } - - yyerror_range[2] = yylloc; - // Using YYLLOC is tempting, but would change the location of - // the lookahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yyloc); + yyerrstatus_ = 3; // Each real token shifted decrements this. + { + stack_symbol_type error_token; + for (;;) + { + yyn = yypact_[yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += yyterror_; + if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], - &yysemantic_stack_[0], &yylocation_stack_[0]); + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; +]b4_locations_if([[ + yyerror_range[1].location = yystack_[0].location;]])[ + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } +]b4_locations_if([[ + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);]])[ - yystate = yyn; + // Shift the error token. + error_token.state = yyn; + yypush_ ("Shifting", error_token); + } goto yynewstate; - /* Accept. */ + // Accept. yyacceptlab: yyresult = 0; goto yyreturn; - /* Abort. */ + // Abort. yyabortlab: yyresult = 1; goto yyreturn; yyreturn: - if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See comments - at user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, - &yylloc); - } + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ yypop_ (yylen); - while (1 < yystate_stack_.height ()) + while (1 < yystack_.size ()) { - yydestruct_ ("Cleanup: popping", - yystos_[yystate_stack_[0]], - &yysemantic_stack_[0], - &yylocation_stack_[0]); + yy_destroy_ ("Cleanup: popping", yystack_[0]); yypop_ (); } return yyresult; - } + } catch (...) { - YYCDEBUG << "Exception caught: cleaning lookahead and stack" - << std::endl; + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; // Do not try to display the values of the reclaimed symbols, // as their printer might throw an exception. - if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See - comments at user semantic actions for why this is - necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ (YY_NULL, yytoken, &yylval, &yylloc); - } + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); - while (1 < yystate_stack_.height ()) + while (1 < yystack_.size ()) { - yydestruct_ (YY_NULL, - yystos_[yystate_stack_[0]], - &yysemantic_stack_[0], - &yylocation_stack_[0]); + yy_destroy_ (YY_NULLPTR, yystack_[0]); yypop_ (); } throw; } } + void + ]b4_parser_class_name[::error (const syntax_error& yyexc) + { + error (]b4_join(b4_locations_if([yyexc.location]), + [[yyexc.what ()]])[); + } + // Generate an error message. std::string ]b4_parser_class_name[::yysyntax_error_ (]dnl -b4_error_verbose_if([int yystate, int yytoken], - [int, int])[) +b4_error_verbose_if([state_type yystate, const symbol_type& yyla], + [state_type, const symbol_type&])[) const {]b4_error_verbose_if([[ - std::string yyres; // Number of reported tokens (one for the "unexpected", one per // "expected"). size_t yycount = 0; @@ -883,7 +1030,7 @@ b4_error_verbose_if([int yystate, int yytoken], the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - - The only way there can be no lookahead present (in yytoken) is + - The only way there can be no lookahead present (in yyla) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to @@ -892,7 +1039,7 @@ b4_error_verbose_if([int yystate, int yytoken], a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated - yychar. + yyla. (However, yyla is currently not documented for users.) - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the @@ -903,8 +1050,9 @@ b4_error_verbose_if([int yystate, int yytoken], token that will not be accepted due to an error action in a later state. */ - if (yytoken != yyempty_) + if (!yyla.empty ()) { + int yytoken = yyla.type_get (); yyarg[yycount++] = yytname_[yytoken]; int yyn = yypact_[yystate]; if (!yy_pact_value_is_default_ (yyn)) @@ -913,7 +1061,7 @@ b4_error_verbose_if([int yystate, int yytoken], YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ + // Stay within bounds of both yycheck and yytname. int yychecklim = yylast_ - yyn + 1; int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) @@ -931,22 +1079,24 @@ b4_error_verbose_if([int yystate, int yytoken], } } - char const* yyformat = YY_NULL; + char const* yyformat = YY_NULLPTR; switch (yycount) { #define YYCASE_(N, S) \ case N: \ yyformat = S; \ break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); #undef YYCASE_ } + std::string yyres; // Argument number. size_t yyi = 0; for (char const* yyp = yyformat; *yyp; ++yyp) @@ -962,176 +1112,57 @@ b4_error_verbose_if([int yystate, int yytoken], } - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ const ]b4_int_type(b4_pact_ninf, b4_pact_ninf) b4_parser_class_name::yypact_ninf_ = b4_pact_ninf[; - const ]b4_int_type_for([b4_pact])[ - ]b4_parser_class_name[::yypact_[] = - { - ]b4_pact[ - }; - - /* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the - default is an error. */ - const ]b4_int_type_for([b4_defact])[ - ]b4_parser_class_name[::yydefact_[] = - { - ]b4_defact[ - }; - /* YYPGOTO[NTERM-NUM]. */ - const ]b4_int_type_for([b4_pgoto])[ - ]b4_parser_class_name[::yypgoto_[] = - { - ]b4_pgoto[ - }; - - /* YYDEFGOTO[NTERM-NUM]. */ - const ]b4_int_type_for([b4_defgoto])[ - ]b4_parser_class_name[::yydefgoto_[] = - { - ]b4_defgoto[ - }; - - /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF_, syntax error. */ const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[; - const ]b4_int_type_for([b4_table])[ - ]b4_parser_class_name[::yytable_[] = - { - ]b4_table[ - }; - - /* YYCHECK. */ - const ]b4_int_type_for([b4_check])[ - ]b4_parser_class_name[::yycheck_[] = - { - ]b4_check[ - }; - /* STOS_[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ - const ]b4_int_type_for([b4_stos])[ - ]b4_parser_class_name[::yystos_[] = - { - ]b4_stos[ - }; - -#if ]b4_api_PREFIX[DEBUG - /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding - to YYLEX-NUM. */ - const ]b4_int_type_for([b4_toknum])[ - ]b4_parser_class_name[::yytoken_number_[] = - { - ]b4_toknum[ - }; -#endif - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ - const ]b4_int_type_for([b4_r1])[ - ]b4_parser_class_name[::yyr1_[] = - { - ]b4_r1[ - }; - - /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ - const ]b4_int_type_for([b4_r2])[ - ]b4_parser_class_name[::yyr2_[] = - { - ]b4_r2[ - }; +]b4_parser_tables_define[ ]b4_token_table_if([], [[#if ]b4_api_PREFIX[DEBUG]])[ - /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at \a yyntokens_, nonterminals. */ + // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + // First, the terminals, then, starting at \a yyntokens_, nonterminals. const char* const ]b4_parser_class_name[::yytname_[] = { - ]b4_tname[ + ]b4_tname[ }; ]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[ - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ - const ]b4_parser_class_name[::rhs_number_type - ]b4_parser_class_name[::yyrhs_[] = - { - ]b4_rhs[ - }; - - /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ - const ]b4_int_type_for([b4_prhs])[ - ]b4_parser_class_name[::yyprhs_[] = - { - ]b4_prhs[ - }; - - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ - const ]b4_int_type_for([b4_rline])[ - ]b4_parser_class_name[::yyrline_[] = - { - ]b4_rline[ - }; +]b4_integral_parser_table_define([rline], [b4_rline])[ // Print the state stack on the debug stream. void ]b4_parser_class_name[::yystack_print_ () { *yycdebug_ << "Stack now"; - for (state_stack_type::const_iterator i = yystate_stack_.begin (); - i != yystate_stack_.end (); ++i) - *yycdebug_ << ' ' << *i; - *yycdebug_ << std::endl; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << i->state; + *yycdebug_ << '\n'; } // Report on the debug stream that the rule \a yyrule is going to be reduced. void ]b4_parser_class_name[::yy_reduce_print_ (int yyrule) { - unsigned int yylno = yyrline_[yyrule]; + unsigned yylno = yyrline_[yyrule]; int yynrhs = yyr2_[yyrule]; - /* Print the symbols being reduced, and their result. */ + // Print the symbols being reduced, and their result. *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "):" << std::endl; - /* The symbols being reduced. */ + << " (line " << yylno << "):\n"; + // The symbols being reduced. for (int yyi = 0; yyi < yynrhs; yyi++) YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", - yyrhs_[yyprhs_[yyrule] + yyi], - &]b4_rhs_value(yynrhs, yyi + 1)[, - &]b4_rhs_location(yynrhs, yyi + 1)[); + ]b4_rhs_data(yynrhs, yyi + 1)[); } #endif // ]b4_api_PREFIX[DEBUG - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ - ]b4_parser_class_name[::token_number_type - ]b4_parser_class_name[::yytranslate_ (int t) - { - static - const token_number_type - translate_table[] = - { - ]b4_translate[ - }; - if ((unsigned int) t <= yyuser_token_number_max_) - return translate_table[t]; - else - return yyundef_token_; - } - - const int ]b4_parser_class_name[::yyeof_ = 0; - const int ]b4_parser_class_name[::yylast_ = ]b4_last[; - const int ]b4_parser_class_name[::yynnts_ = ]b4_nterms_number[; - const int ]b4_parser_class_name[::yyempty_ = -2; - const int ]b4_parser_class_name[::yyfinal_ = ]b4_final_state_number[; - const int ]b4_parser_class_name[::yyterror_ = 1; - const int ]b4_parser_class_name[::yyerrcode_ = 256; - const int ]b4_parser_class_name[::yyntokens_ = ]b4_tokens_number[; - - const unsigned int ]b4_parser_class_name[::yyuser_token_number_max_ = ]b4_user_token_number_max[; - const ]b4_parser_class_name[::token_number_type ]b4_parser_class_name[::yyundef_token_ = ]b4_undef_token_number[; - +]b4_token_ctor_if([], [b4_yytranslate_define([cc])])[ ]b4_namespace_close[ ]b4_epilogue[]dnl b4_output_end() + + +m4_popdef([b4_copyright_years])dnl diff --git a/data/lalr1.java b/data/lalr1.java index 7a7f763..7bf8e7f 100644 --- a/data/lalr1.java +++ b/data/lalr1.java @@ -1,6 +1,6 @@ # Java skeleton for Bison -*- autoconf -*- -# Copyright (C) 2007-2013 Free Software Foundation, Inc. +# Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,25 +17,87 @@ m4_include(b4_pkgdatadir/[java.m4]) -b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], [b4_skeleton])]) -m4_ifval(m4_defn([b4_symbol_destructors]), - [b4_fatal([%s: %%destructor does not make sense in Java], [b4_skeleton])], - []) +b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], + [b4_skeleton])]) + +# We do not depend on %debug in Java, but pacify warnings about +# non-used flags. +b4_parse_trace_if([0], [0]) + +m4_define([b4_symbol_no_destructor_assert], +[b4_symbol_if([$1], [has_destructor], + [b4_fatal([%s: %s: %%destructor does not make sense in Java], + [b4_skeleton], + [b4_symbol_action_location([$1], [destructor])])])]) +b4_symbol_foreach([b4_symbol_no_destructor_assert]) + +# Setup some macros for api.push-pull. +b4_percent_define_default([[api.push-pull]], [[pull]]) +b4_percent_define_check_values([[[[api.push-pull]], + [[pull]], [[push]], [[both]]]]) + +# Define m4 conditional macros that encode the value +# of the api.push-pull flag. +b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]]) +b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]]) +m4_case(b4_percent_define_get([[api.push-pull]]), + [pull], [m4_define([b4_push_flag], [[0]])], + [push], [m4_define([b4_pull_flag], [[0]])]) + +# Define a macro to be true when api.push-pull has the value "both". +m4_define([b4_both_if],[b4_push_if([b4_pull_if([$1],[$2])],[$2])]) + +# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing +# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the +# behavior of Bison at all when push parsing is already requested. +b4_define_flag_if([use_push_for_pull]) +b4_use_push_for_pull_if([ + b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])], + [m4_define([b4_push_flag], [[1]])])]) + +# Define a macro to encapsulate the parse state variables. +# This allows them to be defined either in parse() when doing +# pull parsing, or as class instance variable when doing push parsing. +m4_define([b4_define_state],[[ + /* Lookahead and lookahead in internal form. */ + int yychar = yyempty_; + int yytoken = 0; + + /* State. */ + int yyn = 0; + int yylen = 0; + int yystate = 0; + YYStack yystack = new YYStack (); + int label = YYNEWSTATE; + + /* Error handling. */ + int yynerrs_ = 0; + ]b4_locations_if([/* The location where the error started. */ + b4_location_type yyerrloc = null; + + /* Location. */ + b4_location_type yylloc = new b4_location_type (null, null);])[ + + /* Semantic value of the lookahead. */ + ]b4_yystype[ yylval = null; +]]) b4_output_begin([b4_parser_file_name]) b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java], - [2007-2013]) + [2007-2015, 2018]) b4_percent_define_ifdef([package], [package b4_percent_define_get([package]); ])[/* First part of user declarations. */ -]b4_pre_prologue +]b4_user_pre_prologue +b4_user_post_prologue b4_percent_code_get([[imports]]) [/** * A Bison parser, automatically generated from ]m4_bpatsubst(b4_file_name, [^"\(.*\)"$], [\1])[. * * @@author LALR (1) parser skeleton written by Paolo Bonzini. */ -]b4_public_if([public ])dnl +]b4_percent_define_get3([annotations], [], [ ])dnl +b4_public_if([public ])dnl b4_abstract_if([abstract ])dnl b4_final_if([final ])dnl b4_strictfp_if([strictfp ])dnl @@ -44,27 +106,48 @@ b4_percent_define_get3([extends], [ extends ])dnl b4_percent_define_get3([implements], [ implements ])[ { ]b4_identification[ +]b4_error_verbose_if([[ + /** + * True if verbose error messages are enabled. + */ + private boolean yyErrorVerbose = true; + + /** + * Return whether verbose error messages are enabled. + */ + public final boolean getErrorVerbose() { return yyErrorVerbose; } - /** True if verbose error messages are enabled. */ - public boolean errorVerbose = ]b4_flag_value([error_verbose]); + /** + * Set the verbosity of error messages. + * @@param verbose True to request verbose error messages. + */ + public final void setErrorVerbose(boolean verbose) + { yyErrorVerbose = verbose; } +]]) b4_locations_if([[ /** * A class defining a pair of positions. Positions, defined by the * ]b4_position_type[ class, denote a point in the input. * Locations represent a part of the input through the beginning - * and ending positions. */ + * and ending positions. + */ public class ]b4_location_type[ { - /** The first, inclusive, position in the range. */ + /** + * The first, inclusive, position in the range. + */ public ]b4_position_type[ begin; - /** The first position beyond the range. */ + /** + * The first position beyond the range. + */ public ]b4_position_type[ end; /** * Create a ]b4_location_type[ denoting an empty range located at * a given point. - * @@param loc The position at which the range is anchored. */ + * @@param loc The position at which the range is anchored. + */ public ]b4_location_type[ (]b4_position_type[ loc) { this.begin = this.end = loc; } @@ -72,7 +155,8 @@ b4_locations_if([[ /** * Create a ]b4_location_type[ from the endpoints of the range. * @@param begin The first position included in the range. - * @@param end The first position beyond the range. */ + * @@param end The first position beyond the range. + */ public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) { this.begin = begin; this.end = end; @@ -81,7 +165,8 @@ b4_locations_if([[ /** * Print a representation of the location. For this to be correct, * ]b4_position_type[ should override the equals - * method. */ + * method. + */ public String toString () { if (begin.equals (end)) return begin.toString (); @@ -92,11 +177,6 @@ b4_locations_if([[ ]]) -[ /** Token returned by the scanner to signal the end of its input. */ - public static final int EOF = 0;] - -b4_token_enums(b4_tokens) - b4_locations_if([[ private ]b4_location_type[ yylloc (YYStack rhs, int n) { @@ -111,26 +191,35 @@ b4_token_enums(b4_tokens) * parser ]b4_parser_class_name[. */ public interface Lexer { + /** Token returned by the scanner to signal the end of its input. */ + public static final int EOF = 0; + +]b4_token_enums[ + ]b4_locations_if([[/** * Method to retrieve the beginning position of the last scanned token. - * @@return the position at which the last scanned token starts. */ + * @@return the position at which the last scanned token starts. + */ ]b4_position_type[ getStartPos (); /** * Method to retrieve the ending position of the last scanned token. - * @@return the first position beyond the last scanned token. */ + * @@return the first position beyond the last scanned token. + */ ]b4_position_type[ getEndPos ();]])[ /** * Method to retrieve the semantic value of the last scanned token. - * @@return the semantic value of the last scanned token. */ + * @@return the semantic value of the last scanned token. + */ ]b4_yystype[ getLVal (); /** * Entry point for the scanner. Returns the token identifier corresponding * to the next token and prepares to return the semantic value * ]b4_locations_if([and beginning/ending positions ])[of the token. - * @@return the token identifier corresponding to the next token. */ + * @@return the token identifier corresponding to the next token. + */ int yylex () ]b4_maybe_throws([b4_lex_throws])[; /** @@ -139,15 +228,18 @@ b4_token_enums(b4_tokens) * * ]b4_locations_if([[@@param loc The location of the element to which the * error message is related]])[ - * @@param s The string for the error message. */ - void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s);] + * @@param msg The string for the error message. + */ + void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String msg);] } b4_lexer_if([[private class YYLexer implements Lexer { ]b4_percent_code_get([[lexer]])[ } - ]])[/** The object doing lexical analysis for us. */ + ]])[/** + * The object doing lexical analysis for us. + */ private Lexer yylexer; ] b4_parse_param_vars @@ -156,7 +248,9 @@ b4_lexer_if([[ /** * Instantiates the Bison-generated parser. */ - public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) { + public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) ]b4_maybe_throws([b4_init_throws])[ + { + ]b4_percent_code_get([[init]])[ this.yylexer = new YYLexer(]b4_lex_param_call[); ]b4_parse_param_cons[ } @@ -166,7 +260,9 @@ b4_lexer_if([[ * Instantiates the Bison-generated parser. * @@param yylexer The scanner that will supply tokens to the parser. */ - b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) { + b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) ]b4_maybe_throws([b4_init_throws])[ + { + ]b4_percent_code_get([[init]])[ this.yylexer = yylexer; ]b4_parse_param_cons[ } @@ -200,20 +296,35 @@ b4_lexer_if([[ */ public final void setDebugLevel(int level) { yydebug = level; } - private final int yylex () ]b4_maybe_throws([b4_lex_throws]) [{ - return yylexer.yylex (); + /** + * Print an error message via the lexer. + *]b4_locations_if([[ Use a null location.]])[ + * @@param msg The error message. + */ + public final void yyerror (String msg) + { + yylexer.yyerror (]b4_locations_if([[(]b4_location_type[)null, ]])[msg); } - protected final void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String s) { - yylexer.yyerror (]b4_locations_if([loc, ])[s); +]b4_locations_if([[ + /** + * Print an error message via the lexer. + * @@param loc The location associated with the message. + * @@param msg The error message. + */ + public final void yyerror (]b4_location_type[ loc, String msg) + { + yylexer.yyerror (loc, msg); } - ]b4_locations_if([ - protected final void yyerror (String s) { - yylexer.yyerror ((]b4_location_type[)null, s); - } - protected final void yyerror (]b4_position_type[ loc, String s) { - yylexer.yyerror (new ]b4_location_type[ (loc), s); - }]) + /** + * Print an error message via the lexer. + * @@param pos The position associated with the message. + * @@param msg The error message. + */ + public final void yyerror (]b4_position_type[ pos, String msg) + { + yylexer.yyerror (new ]b4_location_type[ (pos), msg); + }]]) [protected final void yycdebug (String s) { if (yydebug > 0) @@ -229,24 +340,24 @@ b4_lexer_if([[ public int height = -1; public final void push (int state, ]b4_yystype[ value]dnl - b4_locations_if([, ]b4_location_type[ loc])[) { + b4_locations_if([, ]b4_location_type[ loc])[) { height++; if (size == height) { - int[] newStateStack = new int[size * 2]; - System.arraycopy (stateStack, 0, newStateStack, 0, height); - stateStack = newStateStack; - ]b4_locations_if([[ - ]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2]; - System.arraycopy (locStack, 0, newLocStack, 0, height); - locStack = newLocStack;]]) - - b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2]; - System.arraycopy (valueStack, 0, newValueStack, 0, height); - valueStack = newValueStack; - - size *= 2; - } + int[] newStateStack = new int[size * 2]; + System.arraycopy (stateStack, 0, newStateStack, 0, height); + stateStack = newStateStack; + ]b4_locations_if([[ + ]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2]; + System.arraycopy (locStack, 0, newLocStack, 0, height); + locStack = newLocStack;]]) + + b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2]; + System.arraycopy (valueStack, 0, newValueStack, 0, height); + valueStack = newValueStack; + + size *= 2; + } stateStack[height] = state; ]b4_locations_if([[locStack[height] = loc;]])[ @@ -260,7 +371,7 @@ b4_lexer_if([[ public final void pop (int num) { // Avoid memory leaks... garbage collection is a white lie! if (num > 0) { - java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null); + java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null); ]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[ } height -= num; @@ -285,8 +396,8 @@ b4_lexer_if([[ for (int i = 0; i <= height; i++) { - out.print (' '); - out.print (stateStack[i]); + out.print (' '); + out.print (stateStack[i]); } out.println (); } @@ -294,46 +405,74 @@ b4_lexer_if([[ /** * Returned by a Bison action in order to stop the parsing process and - * return success (true). */ + * return success (true). + */ public static final int YYACCEPT = 0; /** * Returned by a Bison action in order to stop the parsing process and - * return failure (false). */ + * return failure (false). + */ public static final int YYABORT = 1; +]b4_push_if([ + /** + * Returned by a Bison action in order to request a new token. + */ + public static final int YYPUSH_MORE = 4;])[ + /** * Returned by a Bison action in order to start error recovery without - * printing an error message. */ + * printing an error message. + */ public static final int YYERROR = 2; - // Internal return codes that are not supported for user semantic - // actions. + /** + * Internal return codes that are not supported for user semantic + * actions. + */ private static final int YYERRLAB = 3; private static final int YYNEWSTATE = 4; private static final int YYDEFAULT = 5; private static final int YYREDUCE = 6; private static final int YYERRLAB1 = 7; private static final int YYRETURN = 8; +]b4_push_if([[ private static final int YYGETTOKEN = 9; /* Signify that a new token is expected when doing push-parsing. */]])[ private int yyerrstatus_ = 0; +]b4_push_if([dnl +b4_define_state])[ /** * Return whether error recovery is being done. In this state, the parser * reads token until it reaches a known state, and then restarts normal - * operation. */ + * operation. + */ public final boolean recovering () { return yyerrstatus_ == 0; } + /** Compute post-reduction state. + * @@param yystate the current state + * @@param yysym the nonterminal to push on the stack + */ + private int yy_lr_goto_state_ (int yystate, int yysym) + { + int yyr = yypgoto_[yysym - yyntokens_] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - yyntokens_]; + } + private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[ { ]b4_yystype[ yyval; ]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[ /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. Otherwise, use the top of the stack. + '$$ = $1'. Otherwise, use the top of the stack. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -347,8 +486,8 @@ b4_lexer_if([[ switch (yyn) { - ]b4_user_actions[ - default: break; + ]b4_user_actions[ + default: break; } yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[); @@ -357,18 +496,12 @@ b4_lexer_if([[ yylen = 0; /* Shift the result of the reduction. */ - yyn = yyr1_[yyn]; - int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0); - if (0 <= yystate && yystate <= yylast_ - && yycheck_[yystate] == yystack.stateAt (0)) - yystate = yytable_[yystate]; - else - yystate = yydefgoto_[yyn - yyntokens_]; - + int yystate = yy_lr_goto_state_ (yystack.stateAt (0), yyr1_[yyn]); yystack.push (yystate, yyval]b4_locations_if([, yyloc])[); return YYNEWSTATE; } +]b4_error_verbose_if([[ /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an @@ -387,7 +520,7 @@ b4_lexer_if([[ break strip_quotes; case '\\': - if (yystr.charAt(++i) != '\\') + if (yystr.charAt(++i) != '\\') break strip_quotes; /* Fall through. */ default: @@ -403,22 +536,24 @@ b4_lexer_if([[ return yystr; } +]])[ /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ private void yy_symbol_print (String s, int yytype, - ]b4_yystype[ yyvaluep]dnl - b4_locations_if([, Object yylocationp])[) + ]b4_yystype[ yyvaluep]dnl + b4_locations_if([, Object yylocationp])[) { if (yydebug > 0) yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ") - + yytname_[yytype] + " ("]b4_locations_if([ - + yylocationp + ": "])[ - + (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")"); + + yytname_[yytype] + " ("]b4_locations_if([ + + yylocationp + ": "])[ + + (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")"); } +]b4_push_if([],[[ /** * Parse input from the scanner that was specified at object construction * time. Return whether the end of the input was reached successfully. @@ -426,51 +561,58 @@ b4_lexer_if([[ * @@return true if the parsing succeeds. Note that this does not * imply that there were no syntax errors. */ - public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[ + public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[]])[ +]b4_push_if([ + /** + * Push Parse input from external lexer + * + * @@param yylextoken current token + * @@param yylexval current lval +]b4_locations_if([ * @@param yylexloc current position])[ + * + * @@return YYACCEPT, YYABORT, YYPUSH_MORE + */ + public int push_parse (int yylextoken, b4_yystype yylexval[]b4_locations_if([, b4_location_type yylexloc])) + b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[ { - /// Lookahead and lookahead in internal form. - int yychar = yyempty_; - int yytoken = 0; - - /* State. */ - int yyn = 0; - int yylen = 0; - int yystate = 0; - - YYStack yystack = new YYStack (); - - /* Error handling. */ - int yynerrs_ = 0; - ]b4_locations_if([/// The location where the error started. - ]b4_location_type[ yyerrloc = null; - - /// ]b4_location_type[ of the lookahead. - ]b4_location_type[ yylloc = new ]b4_location_type[ (null, null); - - /// @@$. - ]b4_location_type[ yyloc;]) - - /// Semantic value of the lookahead. - b4_yystype[ yylval = null; - + ]b4_locations_if([/* @@$. */ + b4_location_type yyloc;])[ +]b4_push_if([],[[ +]b4_define_state[ yycdebug ("Starting parse\n"); yyerrstatus_ = 0; + /* Initialize the stack. */ + yystack.push (yystate, yylval ]b4_locations_if([, yylloc])[); ]m4_ifdef([b4_initial_action], [ b4_dollar_pushdef([yylval], [], [yylloc])dnl -/* User initialization code. */ -b4_user_initial_action -b4_dollar_popdef])[]dnl - - [ /* Initialize the stack. */ - yystack.push (yystate, yylval]b4_locations_if([, yylloc])[); - - int label = YYNEWSTATE; + /* User initialization code. */ + b4_user_initial_action +b4_dollar_popdef[]dnl +])[ +]])[ +]b4_push_if([[ + if (!this.push_parse_initialized) + { + push_parse_initialize (); +]m4_ifdef([b4_initial_action], [ +b4_dollar_pushdef([yylval], [], [yylloc])dnl + /* User initialization code. */ + b4_user_initial_action +b4_dollar_popdef[]dnl +])[ + yycdebug ("Starting parse\n"); + yyerrstatus_ = 0; + } else + label = YYGETTOKEN; + + boolean push_token_consumed = true; +]])[ for (;;) switch (label) { /* New state. Unlike in the C/C++ skeletons, the state is already - pushed when we come here. */ + pushed when we come here. */ case YYNEWSTATE: yycdebug ("Entering state " + yystate + "\n"); if (yydebug > 0) @@ -478,38 +620,50 @@ b4_dollar_popdef])[]dnl /* Accept? */ if (yystate == yyfinal_) - return true; + ]b4_push_if([{label = YYACCEPT; break;}], + [return true;])[ /* Take a decision. First try without lookahead. */ yyn = yypact_[yystate]; if (yy_pact_value_is_default_ (yyn)) { label = YYDEFAULT; - break; + break; } +]b4_push_if([ /* Fall Through */ + case YYGETTOKEN:])[ /* Read a lookahead token. */ if (yychar == yyempty_) { - yycdebug ("Reading a token: "); - yychar = yylex ();] - b4_locations_if([[ - yylloc = new ]b4_location_type[(yylexer.getStartPos (), - yylexer.getEndPos ());]]) - yylval = yylexer.getLVal ();[ +]b4_push_if([[ + if (!push_token_consumed) + return YYPUSH_MORE; + yycdebug ("Reading a token: "); + yychar = yylextoken; + yylval = yylexval;]b4_locations_if([ + yylloc = yylexloc;])[ + push_token_consumed = false;]])[ +]b4_push_if([],[[ + yycdebug ("Reading a token: "); + yychar = yylexer.yylex (); + yylval = yylexer.getLVal ();]b4_locations_if([ + yylloc = new b4_location_type (yylexer.getStartPos (), + yylexer.getEndPos ());])[ +]])[ } /* Convert token to internal form. */ - if (yychar <= EOF) + if (yychar <= Lexer.EOF) { - yychar = yytoken = EOF; - yycdebug ("Now at end of input.\n"); + yychar = yytoken = Lexer.EOF; + yycdebug ("Now at end of input.\n"); } else { - yytoken = yytranslate_ (yychar); - yy_symbol_print ("Next token is", yytoken, - yylval]b4_locations_if([, yylloc])[); + yytoken = yytranslate_ (yychar); + yy_symbol_print ("Next token is", yytoken, + yylval]b4_locations_if([, yylloc])[); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -521,20 +675,20 @@ b4_dollar_popdef])[]dnl /* <= 0 means reduce or error. */ else if ((yyn = yytable_[yyn]) <= 0) { - if (yy_table_value_is_error_ (yyn)) - label = YYERRLAB; - else - { - yyn = -yyn; - label = YYREDUCE; - } + if (yy_table_value_is_error_ (yyn)) + label = YYERRLAB; + else + { + yyn = -yyn; + label = YYREDUCE; + } } else { /* Shift the lookahead token. */ - yy_symbol_print ("Shifting", yytoken, - yylval]b4_locations_if([, yylloc])[); + yy_symbol_print ("Shifting", yytoken, + yylval]b4_locations_if([, yylloc])[); /* Discard the token being shifted. */ yychar = yyempty_; @@ -567,7 +721,7 @@ b4_dollar_popdef])[]dnl case YYREDUCE: yylen = yyr2_[yyn]; label = yyaction (yyn, yystack, yylen); - yystate = yystack.stateAt (0); + yystate = yystack.stateAt (0); break; /*------------------------------------. @@ -586,17 +740,17 @@ b4_dollar_popdef])[]dnl ]b4_locations_if([yyerrloc = yylloc;])[ if (yyerrstatus_ == 3) { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= EOF) - { - /* Return failure if at end of input. */ - if (yychar == EOF) - return false; - } - else - yychar = yyempty_; + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= Lexer.EOF) + { + /* Return failure if at end of input. */ + if (yychar == Lexer.EOF) + ]b4_push_if([{label = YYABORT; break;}],[return false;])[ + } + else + yychar = yyempty_; } /* Else will try to reuse lookahead token after shifting the error @@ -604,9 +758,9 @@ b4_dollar_popdef])[]dnl label = YYERRLAB1; break; - /*---------------------------------------------------. + /*-------------------------------------------------. | errorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ + `-------------------------------------------------*/ case YYERROR: ]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[ @@ -622,70 +776,148 @@ b4_dollar_popdef])[]dnl | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ case YYERRLAB1: - yyerrstatus_ = 3; /* Each real token shifted decrements this. */ + yyerrstatus_ = 3; /* Each real token shifted decrements this. */ for (;;) { - yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yystack.height == 0) - return false; - - ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[ - yystack.pop (); - yystate = yystack.stateAt (0); - if (yydebug > 0) - yystack.print (yyDebugStream); + yyn = yypact_[yystate]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += yyterror_; + if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the + * error token. */ + if (yystack.height == 0) + ]b4_push_if([{label = YYABORT; break;}],[return false;])[ + + ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[ + yystack.pop (); + yystate = yystack.stateAt (0); + if (yydebug > 0) + yystack.print (yyDebugStream); } - ]b4_locations_if([ - /* Muck with the stack to setup for yylloc. */ - yystack.push (0, null, yylloc); - yystack.push (0, null, yyerrloc); + if (label == YYABORT) + /* Leave the switch. */ + break; + +]b4_locations_if([ + /* Muck with the stack to setup for yylloc. */ + yystack.push (0, null, yylloc); + yystack.push (0, null, yyerrloc); yyloc = yylloc (yystack, 2); - yystack.pop (2);])[ + yystack.pop (2);])[ /* Shift the error token. */ yy_symbol_print ("Shifting", yystos_[yyn], - yylval]b4_locations_if([, yyloc])[); + yylval]b4_locations_if([, yyloc])[); yystate = yyn; - yystack.push (yyn, yylval]b4_locations_if([, yyloc])[); + yystack.push (yyn, yylval]b4_locations_if([, yyloc])[); label = YYNEWSTATE; break; /* Accept. */ case YYACCEPT: - return true; + ]b4_push_if([this.push_parse_initialized = false; return YYACCEPT;], + [return true;])[ /* Abort. */ case YYABORT: - return false; + ]b4_push_if([this.push_parse_initialized = false; return YYABORT;], + [return false;])[ } +} +]b4_push_if([[ + boolean push_parse_initialized = false; + + /** + * (Re-)Initialize the state of the push parser. + */ + public void push_parse_initialize() + { + /* Lookahead and lookahead in internal form. */ + this.yychar = yyempty_; + this.yytoken = 0; + + /* State. */ + this.yyn = 0; + this.yylen = 0; + this.yystate = 0; + this.yystack = new YYStack (); + this.label = YYNEWSTATE; + + /* Error handling. */ + this.yynerrs_ = 0; + ]b4_locations_if([/* The location where the error started. */ + this.yyerrloc = null; + this.yylloc = new b4_location_type (null, null);])[ + + /* Semantic value of the lookahead. */ + this.yylval = null; + + yystack.push (this.yystate, this.yylval]b4_locations_if([, this.yylloc])[); + + this.push_parse_initialized = true; + } +]b4_locations_if([ + /** + * Push parse given input from an external lexer. + * + * @@param yylextoken current token + * @@param yylexval current lval + * @@param yyylexpos current position + * + * @@return YYACCEPT, YYABORT, YYPUSH_MORE + */ + public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type yylexpos) + b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])]) + { + return push_parse (yylextoken, yylexval, new b4_location_type (yylexpos)); + } +])[]]) + +b4_both_if([[ + /** + * Parse input from the scanner that was specified at object construction + * time. Return whether the end of the input was reached successfully. + * This version of parse () is defined only when api.push-push=both. + * + * @@return true if the parsing succeeds. Note that this does not + * imply that there were no syntax errors. + */ + public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[ + { + if (yylexer == null) + throw new NullPointerException("Null Lexer"); + int status; + do { + int token = yylexer.yylex(); + ]b4_yystype[ lval = yylexer.getLVal(); +]b4_locations_if([dnl + b4_location_type yyloc = new b4_location_type (yylexer.getStartPos (), + yylexer.getEndPos ());])[ + ]b4_locations_if([status = push_parse(token,lval,yyloc);],[ + status = push_parse(token,lval);])[ + } while (status == YYPUSH_MORE); + return (status == YYACCEPT); + } +]])[ // Generate an error message. private String yysyntax_error (int yystate, int tok) - { - if (errorVerbose) + {]b4_error_verbose_if([[ + if (yyErrorVerbose) { /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. - See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't @@ -713,8 +945,8 @@ b4_dollar_popdef])[]dnl */ if (tok != yyempty_) { - // FIXME: This method of building the message is not compatible - // with internationalization. + /* FIXME: This method of building the message is not compatible + with internationalization. */ StringBuffer res = new StringBuffer ("syntax error, unexpected "); res.append (yytnamerr_ (yytname_[tok])); @@ -749,7 +981,7 @@ b4_dollar_popdef])[]dnl return res.toString (); } } - +]])[ return "syntax error"; } @@ -763,115 +995,30 @@ b4_dollar_popdef])[]dnl } /** - * Whether the given yytable_ value indicates a syntax error. - * @@param yyvalue the value to check + * Whether the given yytable_ + * value indicates a syntax error. + * @@param yyvalue the value to check */ private static boolean yy_table_value_is_error_ (int yyvalue) { return yyvalue == yytable_ninf_; } - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[; - private static final ]b4_int_type_for([b4_pact])[ yypact_[] = - { - ]b4_pact[ - }; - - /* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the - default is an error. */ - private static final ]b4_int_type_for([b4_defact])[ yydefact_[] = - { - ]b4_defact[ - }; - - /* YYPGOTO[NTERM-NUM]. */ - private static final ]b4_int_type_for([b4_pgoto])[ yypgoto_[] = - { - ]b4_pgoto[ - }; - - /* YYDEFGOTO[NTERM-NUM]. */ - private static final ]b4_int_type_for([b4_defgoto])[ - yydefgoto_[] = - { - ]b4_defgoto[ - }; - - /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF_, syntax error. */ private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[; - private static final ]b4_int_type_for([b4_table])[ - yytable_[] = - { - ]b4_table[ - }; - - /* YYCHECK. */ - private static final ]b4_int_type_for([b4_check])[ - yycheck_[] = - { - ]b4_check[ - }; - /* STOS_[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ - private static final ]b4_int_type_for([b4_stos])[ - yystos_[] = - { - ]b4_stos[ - }; - - /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding - to YYLEX-NUM. */ - private static final ]b4_int_type_for([b4_toknum])[ - yytoken_number_[] = - { - ]b4_toknum[ - }; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ - private static final ]b4_int_type_for([b4_r1])[ - yyr1_[] = - { - ]b4_r1[ - }; - - /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ - private static final ]b4_int_type_for([b4_r2])[ - yyr2_[] = - { - ]b4_r2[ - }; + ]b4_parser_tables_define[ + ]b4_integral_parser_table_define([token_number], [b4_toknum], + [[YYTOKEN_NUMBER[YYLEX-NUM] -- Internal symbol number corresponding + to YYLEX-NUM.]])[ /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at \a yyntokens_, nonterminals. */ - private static final String yytname_[] = - { - ]b4_tname[ - }; + ]b4_typed_parser_table_define([String], [tname], [b4_tname])[ - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ - private static final ]b4_int_type_for([b4_rhs])[ yyrhs_[] = - { - ]b4_rhs[ - }; + ]b4_integral_parser_table_define([rline], [b4_rline], + [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[ - /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ - private static final ]b4_int_type_for([b4_prhs])[ yyprhs_[] = - { - ]b4_prhs[ - }; - - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ - private static final ]b4_int_type_for([b4_rline])[ yyrline_[] = - { - ]b4_rline[ - }; // Report on the debug stream that the rule yyrule is going to be reduced. private void yy_reduce_print (int yyrule, YYStack yystack) @@ -883,21 +1030,18 @@ b4_dollar_popdef])[]dnl int yynrhs = yyr2_[yyrule]; /* Print the symbols being reduced, and their result. */ yycdebug ("Reducing stack by rule " + (yyrule - 1) - + " (line " + yylno + "), "); + + " (line " + yylno + "), "); /* The symbols being reduced. */ for (int yyi = 0; yyi < yynrhs; yyi++) yy_symbol_print (" $" + (yyi + 1) + " =", - yyrhs_[yyprhs_[yyrule] + yyi], - ]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([, - b4_rhs_location(yynrhs, yyi + 1)])[); + yystos_[yystack.stateAt(yynrhs - (yyi + 1))], + ]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([, + b4_rhs_location(yynrhs, yyi + 1)])[); } /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ - private static final ]b4_int_type_for([b4_translate])[ yytranslate_table_[] = - { - ]b4_translate[ - }; + ]b4_integral_parser_table_define([translate_table], [b4_translate])[ private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t) { @@ -923,5 +1067,5 @@ b4_percent_code_get[]dnl } -b4_epilogue +b4_epilogue[]dnl b4_output_end() diff --git a/data/local.mk b/data/local.mk new file mode 100644 index 0000000..ea097aa --- /dev/null +++ b/data/local.mk @@ -0,0 +1,45 @@ +## Copyright (C) 2002, 2005-2015, 2018 Free Software Foundation, Inc. + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . + +dist_pkgdata_DATA = \ + data/README \ + data/bison.m4 \ + data/c++-skel.m4 \ + data/c++.m4 \ + data/c-like.m4 \ + data/c-skel.m4 \ + data/c.m4 \ + data/glr.c \ + data/glr.cc \ + data/java-skel.m4 \ + data/java.m4 \ + data/lalr1.cc \ + data/lalr1.java \ + data/location.cc \ + data/stack.hh \ + data/variant.hh \ + data/yacc.c + +m4sugardir = $(pkgdatadir)/m4sugar +dist_m4sugar_DATA = \ + data/m4sugar/foreach.m4 \ + data/m4sugar/m4sugar.m4 + +xsltdir = $(pkgdatadir)/xslt +dist_xslt_DATA = \ + data/xslt/bison.xsl \ + data/xslt/xml2dot.xsl \ + data/xslt/xml2text.xsl \ + data/xslt/xml2xhtml.xsl diff --git a/data/location.cc b/data/location.cc index f5011c6..3cc949d 100644 --- a/data/location.cc +++ b/data/location.cc @@ -1,6 +1,6 @@ # C++ skeleton for Bison -# Copyright (C) 2002-2007, 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,45 +15,31 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +m4_pushdef([b4_copyright_years], + [2002-2015, 2018]) -b4_output_begin([b4_dir_prefix[]position.hh]) -b4_copyright([Positions for Bison parsers in C++], - [2002-2007, 2009-2013])[ - -/** - ** \file ]b4_dir_prefix[position.hh - ** Define the ]b4_namespace_ref[::position class. - */ - -]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[ - -# include // std::max -# include -# include - -]b4_null_define[ - -]b4_namespace_open[ - /// Abstract a position. +# b4_position_define +# ------------------ +# Define class position. +m4_define([b4_position_define], +[[ /// Abstract a position. class position { - public: -]m4_ifdef([b4_location_constructors], [[ + public:]m4_ifdef([b4_location_constructors], [[ /// Construct a position. - explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL, - unsigned int l = ]b4_location_initial_line[u, - unsigned int c = ]b4_location_initial_column[u) + explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR, + unsigned l = ]b4_location_initial_line[u, + unsigned c = ]b4_location_initial_column[u) : filename (f) , line (l) , column (c) - { - } + {} ]])[ /// Initialization. - void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL, - unsigned int l = ]b4_location_initial_line[u, - unsigned int c = ]b4_location_initial_column[u) + void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR, + unsigned l = ]b4_location_initial_line[u, + unsigned c = ]b4_location_initial_column[u) { filename = fn; line = l; @@ -65,53 +51,64 @@ b4_copyright([Positions for Bison parsers in C++], /// (line related) Advance to the COUNT next lines. void lines (int count = 1) { - column = ]b4_location_initial_column[u; - line += count; + if (count) + { + column = ]b4_location_initial_column[u; + line = add_ (line, count, ]b4_location_initial_line[); + } } /// (column related) Advance to the COUNT next columns. void columns (int count = 1) { - column = std::max (]b4_location_initial_column[u, column + count); + column = add_ (column, count, ]b4_location_initial_column[); } /** \} */ /// File name to which this position refers. ]b4_percent_define_get([[filename_type]])[* filename; /// Current line number. - unsigned int line; + unsigned line; /// Current column number. - unsigned int column; + unsigned column; + + private: + /// Compute max(min, lhs+rhs) (provided min <= lhs). + static unsigned add_ (unsigned lhs, int rhs, unsigned min) + { + return (0 < rhs || -static_cast(rhs) < lhs + ? rhs + lhs + : min); + } }; - /// Add and assign a position. + /// Add \a width columns, in place. inline position& - operator+= (position& res, const int width) + operator+= (position& res, int width) { res.columns (width); return res; } - /// Add two position objects. - inline const position - operator+ (const position& begin, const int width) + /// Add \a width columns. + inline position + operator+ (position res, int width) { - position res = begin; return res += width; } - /// Add and assign a position. + /// Subtract \a width columns, in place. inline position& - operator-= (position& res, const int width) + operator-= (position& res, int width) { return res += -width; } - /// Add two position objects. - inline const position - operator- (const position& begin, const int width) + /// Subtract \a width columns. + inline position + operator- (position res, int width) { - return begin + -width; + return res -= width; } ]b4_percent_define_flag_if([[define_location_comparison]], [[ /// Compare two position objects. @@ -144,28 +141,13 @@ b4_copyright([Positions for Bison parsers in C++], ostr << *pos.filename << ':'; return ostr << pos.line << '.' << pos.column; } +]]) -]b4_namespace_close[ -]b4_cpp_guard_close([b4_dir_prefix[]position.hh]) -b4_output_end() - - -b4_output_begin([b4_dir_prefix[]location.hh]) -b4_copyright([Locations for Bison parsers in C++], - [2002-2007, 2009-2013])[ - -/** - ** \file ]b4_dir_prefix[location.hh - ** Define the ]b4_namespace_ref[::location class. - */ - -]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[ - -# include "position.hh" - -]b4_namespace_open[ - /// Abstract a location. +# b4_location_define +# ------------------ +m4_define([b4_location_define], +[[ /// Abstract a location. class location { public: @@ -174,30 +156,27 @@ b4_copyright([Locations for Bison parsers in C++], location (const position& b, const position& e) : begin (b) , end (e) - { - } + {} /// Construct a 0-width location in \a p. explicit location (const position& p = position ()) : begin (p) , end (p) - { - } + {} /// Construct a 0-width location in \a f, \a l, \a c. explicit location (]b4_percent_define_get([[filename_type]])[* f, - unsigned int l = ]b4_location_initial_line[u, - unsigned int c = ]b4_location_initial_column[u) + unsigned l = ]b4_location_initial_line[u, + unsigned c = ]b4_location_initial_column[u) : begin (f, l, c) , end (f, l, c) - { - } + {} ])[ /// Initialization. - void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL, - unsigned int l = ]b4_location_initial_line[u, - unsigned int c = ]b4_location_initial_column[u) + void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR, + unsigned l = ]b4_location_initial_line[u, + unsigned c = ]b4_location_initial_column[u) { begin.initialize (f, l, c); end = begin; @@ -213,13 +192,13 @@ b4_copyright([Locations for Bison parsers in C++], } /// Extend the current location to the COUNT next columns. - void columns (unsigned int count = 1) + void columns (int count = 1) { end += count; } /// Extend the current location to the COUNT next lines. - void lines (unsigned int count = 1) + void lines (int count = 1) { end.lines (count); } @@ -233,28 +212,43 @@ b4_copyright([Locations for Bison parsers in C++], position end; }; - /// Join two location objects to create a location. - inline const location operator+ (const location& begin, const location& end) + /// Join two locations, in place. + inline location& operator+= (location& res, const location& end) { - location res = begin; res.end = end.end; return res; } - /// Add two location objects. - inline const location operator+ (const location& begin, unsigned int width) + /// Join two locations. + inline location operator+ (location res, const location& end) { - location res = begin; - res.columns (width); - return res; + return res += end; } - /// Add and assign a location. - inline location& operator+= (location& res, unsigned int width) + /// Add \a width columns to the end position, in place. + inline location& operator+= (location& res, int width) { res.columns (width); return res; } + + /// Add \a width columns to the end position. + inline location operator+ (location res, int width) + { + return res += width; + } + + /// Subtract \a width columns to the end position, in place. + inline location& operator-= (location& res, int width) + { + return res += -width; + } + + /// Subtract \a width columns to the end position. + inline location operator- (location res, int width) + { + return res -= width; + } ]b4_percent_define_flag_if([[define_location_comparison]], [[ /// Compare two location objects. inline bool @@ -280,20 +274,63 @@ b4_copyright([Locations for Bison parsers in C++], inline std::basic_ostream& operator<< (std::basic_ostream& ostr, const location& loc) { - position last = loc.end - 1; + unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; ostr << loc.begin; - if (last.filename - && (!loc.begin.filename - || *loc.begin.filename != *last.filename)) - ostr << '-' << last; - else if (loc.begin.line != last.line) - ostr << '-' << last.line << '.' << last.column; - else if (loc.begin.column != last.column) - ostr << '-' << last.column; + if (loc.end.filename + && (!loc.begin.filename + || *loc.begin.filename != *loc.end.filename)) + ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col; + else if (loc.begin.line < loc.end.line) + ostr << '-' << loc.end.line << '.' << end_col; + else if (loc.begin.column < end_col) + ostr << '-' << end_col; return ostr; } +]]) + +b4_defines_if([ +b4_output_begin([b4_dir_prefix[]position.hh]) +b4_copyright([Positions for Bison parsers in C++])[ + +/** + ** \file ]b4_dir_prefix[position.hh + ** Define the ]b4_namespace_ref[::position class. + */ + +]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[ + +# include // std::max +# include +# include + +]b4_null_define[ + +]b4_namespace_open[ +]b4_position_define[ ]b4_namespace_close[ +]b4_cpp_guard_close([b4_dir_prefix[]position.hh]) +b4_output_end() + + +b4_output_begin([b4_dir_prefix[]location.hh]) +b4_copyright([Locations for Bison parsers in C++])[ +/** + ** \file ]b4_dir_prefix[location.hh + ** Define the ]b4_namespace_ref[::location class. + */ + +]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[ + +# include "position.hh" + +]b4_namespace_open[ +]b4_location_define[ +]b4_namespace_close[ ]b4_cpp_guard_close([b4_dir_prefix[]location.hh]) b4_output_end() +]) + + +m4_popdef([b4_copyright_years]) diff --git a/data/m4sugar/foreach.m4 b/data/m4sugar/foreach.m4 index 3fc1913..7093d0fc 100644 --- a/data/m4sugar/foreach.m4 +++ b/data/m4sugar/foreach.m4 @@ -4,7 +4,7 @@ # Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes # GNU M4 1.6 by requiring more memory and macro expansions. # -# Copyright (C) 2008-2012 Free Software Foundation, Inc. +# Copyright (C) 2008-2017 Free Software Foundation, Inc. # This file is part of Autoconf. This program is free # software; you can redistribute it and/or modify it under the @@ -24,7 +24,7 @@ # You should have received a copy of the GNU General Public License # and a copy of the Autoconf Configure Script Exception along with # this program; see the files COPYINGv3 and COPYING.EXCEPTION -# respectively. If not, see . +# respectively. If not, see . # Written by Eric Blake. diff --git a/data/m4sugar/m4sugar.m4 b/data/m4sugar/m4sugar.m4 index 12a9ab7..bbd6958 100644 --- a/data/m4sugar/m4sugar.m4 +++ b/data/m4sugar/m4sugar.m4 @@ -3,7 +3,7 @@ divert(-1)# -*- Autoconf -*- # Base M4 layer. # Requires GNU M4. # -# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # This file is part of Autoconf. This program is free # software; you can redistribute it and/or modify it under the @@ -23,7 +23,7 @@ divert(-1)# -*- Autoconf -*- # You should have received a copy of the GNU General Public License # and a copy of the Autoconf Configure Script Exception along with # this program; see the files COPYINGv3 and COPYING.EXCEPTION -# respectively. If not, see . +# respectively. If not, see . # Written by Akim Demaille. @@ -2000,7 +2000,7 @@ m4_define([_m4_defun_once], # m4_pattern_forbid(ERE, [WHY]) # ----------------------------- -# Declare that no token matching the forbidden extended regular +# Declare that no token matching the forbidden perl extended regular # expression ERE should be seen in the output unless... m4_define([m4_pattern_forbid], []) @@ -2008,7 +2008,7 @@ m4_define([m4_pattern_forbid], []) # m4_pattern_allow(ERE) # --------------------- # ... that token also matches the allowed extended regular expression ERE. -# Both used via traces. +# Both used via traces, by autom4te post-processing. m4_define([m4_pattern_allow], []) @@ -2080,13 +2080,19 @@ m4_if([$0], [m4_require], [[m4_defun]], [[AC_DEFUN]])['d macro])])]dnl # # This is called frequently, so minimize the number of macro invocations # by avoiding dnl and other overhead on the common path. +# The use of a witness macro protecting the warning allows aclocal +# to silence any warnings when probing for what macros are required +# and must therefore be located, when using the Autoconf-without-aclocal-m4 +# autom4te language. For more background, see: +# https://lists.gnu.org/archive/html/automake-patches/2012-11/msg00035.html m4_define([_m4_require_call], [m4_pushdef([_m4_divert_grow], m4_decr(_m4_divert_grow))]dnl [m4_pushdef([_m4_diverting([$1])])m4_pushdef([_m4_diverting], [$1])]dnl [m4_divert_push(_m4_divert_grow, [-])]dnl [m4_if([$2], [], [$1], [$2]) m4_provide_if([$1], [m4_set_remove([_m4_provide], [$1])], - [m4_warn([syntax], [$1 is m4_require'd but not m4_defun'd])])]dnl + [m4_ifndef([m4_require_silent_probe], + [m4_warn([syntax], [$1 is m4_require'd but not m4_defun'd])])])]dnl [_m4_divert_raw($3)_m4_undivert(_m4_divert_grow)]dnl [m4_divert_pop(_m4_divert_grow)_m4_popdef([_m4_divert_grow], [_m4_diverting([$1])], [_m4_diverting])]) @@ -2101,7 +2107,7 @@ m4_define([_m4_require_check], [m4_if(_m4_defn([_m4_diverting]), [$2], [m4_ignore], m4_ifdef([_m4_diverting([$2])], [-]), [-], [m4_warn([syntax], [$3: `$1' was expanded before it was required -http://www.gnu.org/software/autoconf/manual/autoconf.html#Expanded-Before-Required])_m4_require_call], +https://www.gnu.org/software/autoconf/manual/autoconf.html#Expanded-Before-Required])_m4_require_call], [m4_ignore])]) @@ -3120,7 +3126,8 @@ m4_define([m4_set_empty], # guaranteed. This is faster than the corresponding m4_foreach([VAR], # m4_indir([m4_dquote]m4_set_listc([SET])), [ACTION]) m4_define([m4_set_foreach], -[m4_pushdef([$2])m4_set_map_sep([$1], [m4_define([$2],], [)$3])]) +[m4_pushdef([$2])m4_set_map_sep([$1], +[m4_define([$2],], [)$3])m4_popdef([$2])]) # m4_set_intersection(SET1, SET2) # ------------------------------- diff --git a/data/stack.hh b/data/stack.hh index 317a061..c79f083 100644 --- a/data/stack.hh +++ b/data/stack.hh @@ -1,6 +1,6 @@ # C++ skeleton for Bison -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,23 +16,13 @@ # along with this program. If not, see . m4_pushdef([b4_copyright_years], - [2002-2013]) + [2002-2015, 2018]) -b4_output_begin([b4_dir_prefix[]stack.hh]) -b4_copyright([Stack handling for Bison parsers in C++], - [2002-2013])[ - -/** - ** \file ]b4_dir_prefix[stack.hh - ** Define the ]b4_namespace_ref[::stack class. - */ - -]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[ - -# include - -]b4_namespace_open[ - template > +# b4_stack_define +# --------------- +m4_define([b4_stack_define], +[[ /// A stack with random access from its top. + template > class stack { public: @@ -40,41 +30,49 @@ b4_copyright([Stack handling for Bison parsers in C++], typedef typename S::reverse_iterator iterator; typedef typename S::const_reverse_iterator const_iterator; - stack () : seq_ () + stack () + : seq_ () { + seq_.reserve (200); } - stack (unsigned int n) : seq_ (n) - { - } + stack (unsigned n) + : seq_ (n) + {} - inline + /// Random access. + /// + /// Index 0 returns the topmost element. T& - operator [] (unsigned int i) + operator[] (unsigned i) { - return seq_[i]; + return seq_[seq_.size () - 1 - i]; } - inline + /// Random access. + /// + /// Index 0 returns the topmost element. const T& - operator [] (unsigned int i) const + operator[] (unsigned i) const { - return seq_[i]; + return seq_[seq_.size () - 1 - i]; } - inline + /// Steal the contents of \a t. + /// + /// Close to move-semantics. void - push (const T& t) + push (T& t) { - seq_.push_front (t); + seq_.push_back (T()); + operator[](0).move (t); } - inline void - pop (unsigned int n = 1) + pop (unsigned n = 1) { for (; n; --n) - seq_.pop_front (); + seq_.pop_back (); } void @@ -83,19 +81,28 @@ b4_copyright([Stack handling for Bison parsers in C++], seq_.clear (); } - inline - unsigned int - height () const + typename S::size_type + size () const { return seq_.size (); } - inline const_iterator begin () const { return seq_.rbegin (); } - inline const_iterator end () const { return seq_.rend (); } + const_iterator + begin () const + { + return seq_.rbegin (); + } + + const_iterator + end () const + { + return seq_.rend (); + } private: stack (const stack&); stack& operator= (const stack&); + /// The wrapped container. S seq_; }; @@ -104,26 +111,42 @@ b4_copyright([Stack handling for Bison parsers in C++], class slice { public: - slice (const S& stack, unsigned int range) + slice (const S& stack, unsigned range) : stack_ (stack) , range_ (range) - { - } + {} - inline const T& - operator [] (unsigned int i) const + operator [] (unsigned i) const { return stack_[range_ - i]; } private: const S& stack_; - unsigned int range_; + unsigned range_; }; +]]) + +b4_defines_if( +[b4_output_begin([b4_dir_prefix[]stack.hh]) +b4_copyright([Stack handling for Bison parsers in C++])[ + +/** + ** \file ]b4_dir_prefix[stack.hh + ** Define the ]b4_namespace_ref[::stack class. + */ + +]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[ + +# include + +]b4_namespace_open[ +]b4_stack_define[ ]b4_namespace_close[ ]b4_cpp_guard_close([b4_dir_prefix[]stack.hh]) b4_output_end() +]) m4_popdef([b4_copyright_years]) diff --git a/data/variant.hh b/data/variant.hh new file mode 100644 index 0000000..7a6fbfb --- /dev/null +++ b/data/variant.hh @@ -0,0 +1,360 @@ +# C++ skeleton for Bison + +# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +## --------- ## +## variant. ## +## --------- ## + +# b4_symbol_variant(YYTYPE, YYVAL, ACTION, [ARGS]) +# ------------------------------------------------ +# Run some ACTION ("build", or "destroy") on YYVAL of symbol type +# YYTYPE. +m4_define([b4_symbol_variant], +[m4_pushdef([b4_dollar_dollar], + [$2.$3< $][3 > (m4_shift3($@))])dnl +switch ($1) + { +b4_type_foreach([b4_type_action_])[]dnl + default: + break; + } +m4_popdef([b4_dollar_dollar])dnl +]) + + +# _b4_char_sizeof_counter +# ----------------------- +# A counter used by _b4_char_sizeof_dummy to create fresh symbols. +m4_define([_b4_char_sizeof_counter], +[0]) + +# _b4_char_sizeof_dummy +# --------------------- +# At each call return a new C++ identifier. +m4_define([_b4_char_sizeof_dummy], +[m4_define([_b4_char_sizeof_counter], m4_incr(_b4_char_sizeof_counter))dnl +dummy[]_b4_char_sizeof_counter]) + + +# b4_char_sizeof(SYMBOL-NUMS) +# --------------------------- +# To be mapped on the list of type names to produce: +# +# char dummy1[sizeof(type_name_1)]; +# char dummy2[sizeof(type_name_2)]; +# +# for defined type names. +m4_define([b4_char_sizeof], +[b4_symbol_if([$1], [has_type], +[ +m4_map([ b4_symbol_tag_comment], [$@])dnl + char _b4_char_sizeof_dummy@{sizeof(b4_symbol([$1], [type]))@}; +])]) + + +# b4_variant_includes +# ------------------- +# The needed includes for variants support. +m4_define([b4_variant_includes], +[b4_parse_assert_if([[#include ]])[ +#ifndef YYASSERT +# include +# define YYASSERT assert +#endif +]]) + +# b4_variant_define +# ----------------- +# Define "variant". +m4_define([b4_variant_define], +[[ /// A char[S] buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current state. + template + struct variant + { + /// Type of *this. + typedef variant self_type; + + /// Empty construction. + variant ()]b4_parse_assert_if([ + : yytypeid_ (YY_NULLPTR)])[ + {} + + /// Construct and fill. + template + variant (const T& t)]b4_parse_assert_if([ + : yytypeid_ (&typeid (T))])[ + { + YYASSERT (sizeof (T) <= S); + new (yyas_ ()) T (t); + } + + /// Destruction, allowed only if empty. + ~variant () + {]b4_parse_assert_if([ + YYASSERT (!yytypeid_); + ])[} + + /// Instantiate an empty \a T in here. + template + T& + build () + {]b4_parse_assert_if([ + YYASSERT (!yytypeid_); + YYASSERT (sizeof (T) <= S); + yytypeid_ = & typeid (T);])[ + return *new (yyas_ ()) T; + } + + /// Instantiate a \a T in here from \a t. + template + T& + build (const T& t) + {]b4_parse_assert_if([ + YYASSERT (!yytypeid_); + YYASSERT (sizeof (T) <= S); + yytypeid_ = & typeid (T);])[ + return *new (yyas_ ()) T (t); + } + + /// Accessor to a built \a T. + template + T& + as () + {]b4_parse_assert_if([ + YYASSERT (*yytypeid_ == typeid (T)); + YYASSERT (sizeof (T) <= S);])[ + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const + {]b4_parse_assert_if([ + YYASSERT (*yytypeid_ == typeid (T)); + YYASSERT (sizeof (T) <= S);])[ + return *yyas_ (); + } + + /// Swap the content with \a other, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsability. + /// Swapping between built and (possibly) non-built is done with + /// variant::move (). + template + void + swap (self_type& other) + {]b4_parse_assert_if([ + YYASSERT (yytypeid_); + YYASSERT (*yytypeid_ == *other.yytypeid_);])[ + std::swap (as (), other.as ()); + } + + /// Move the content of \a other to this. + /// + /// Destroys \a other. + template + void + move (self_type& other) + { + build (); + swap (other); + other.destroy (); + } + + /// Copy the content of \a other to this. + template + void + copy (const self_type& other) + { + build (other.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T ();]b4_parse_assert_if([ + yytypeid_ = YY_NULLPTR;])[ + } + + private: + /// Prohibit blind copies. + self_type& operator=(const self_type&); + variant (const self_type&); + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[S]; + } yybuffer_;]b4_parse_assert_if([ + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_;])[ + }; +]]) + + +## -------------------------- ## +## Adjustments for variants. ## +## -------------------------- ## + + +# b4_value_type_declare +# --------------------- +# Declare semantic_type. +m4_define([b4_value_type_declare], +[[ /// An auxiliary type to compute the largest semantic type. + union union_type + {]b4_type_foreach([b4_char_sizeof])[}; + + /// Symbol semantic values. + typedef variant semantic_type;][]dnl +]) + + +# How the semantic value is extracted when using variants. + +# b4_symbol_value(VAL, [TYPE]) +# ---------------------------- +m4_define([b4_symbol_value], +[m4_ifval([$2], + [$1.as< $2 > ()], + [$1])]) + +# b4_symbol_value_template(VAL, [TYPE]) +# ------------------------------------- +# Same as b4_symbol_value, but used in a template method. +m4_define([b4_symbol_value_template], +[m4_ifval([$2], + [$1.template as< $2 > ()], + [$1])]) + + + +## ------------- ## +## make_SYMBOL. ## +## ------------- ## + + +# b4_symbol_constructor_declare_(SYMBOL-NUMBER) +# --------------------------------------------- +# Declare the overloaded version of make_symbol for the (common) type of +# these SYMBOL-NUMBERS. Use at class-level. +m4_define([b4_symbol_constructor_declare_], +[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id], +[ static inline + symbol_type + make_[]b4_symbol_([$1], [id]) (dnl +b4_join(b4_symbol_if([$1], [has_type], + [const b4_symbol([$1], [type])& v]), + b4_locations_if([const location_type& l]))); + +])])]) + + +# b4_symbol_constructor_declare +# ----------------------------- +# Declare symbol constructors for all the value types. +# Use at class-level. +m4_define([b4_symbol_constructor_declare], +[ // Symbol constructors declarations. +b4_symbol_foreach([b4_symbol_constructor_declare_])]) + + + +# b4_symbol_constructor_define_(SYMBOL-NUMBER) +# -------------------------------------------- +# Define symbol constructor for this SYMBOL-NUMBER. +m4_define([b4_symbol_constructor_define_], +[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id], +[ b4_parser_class_name::symbol_type + b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl +b4_join(b4_symbol_if([$1], [has_type], + [const b4_symbol([$1], [type])& v]), + b4_locations_if([const location_type& l]))) + { + return symbol_type (b4_join([token::b4_symbol([$1], [id])], + b4_symbol_if([$1], [has_type], [v]), + b4_locations_if([l]))); + } + +])])]) + + +# b4_basic_symbol_constructor_declare +# ----------------------------------- +# Generate a constructor declaration for basic_symbol from given type. +m4_define([b4_basic_symbol_constructor_declare], +[[ + basic_symbol (]b4_join( + [typename Base::kind_type t], + b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]), + b4_locations_if([const location_type& l]))[); +]]) + +# b4_basic_symbol_constructor_define +# ---------------------------------- +# Generate a constructor implementation for basic_symbol from given type. +m4_define([b4_basic_symbol_constructor_define], +[[ + template + ]b4_parser_class_name[::basic_symbol::basic_symbol (]b4_join( + [typename Base::kind_type t], + b4_symbol_if([$1], [has_type], const b4_symbol([$1], [type])[ v]), + b4_locations_if([const location_type& l]))[) + : Base (t) + , value (]b4_symbol_if([$1], [has_type], [v])[)]b4_locations_if([ + , location (l)])[ + {} +]]) + +# b4_symbol_constructor_define +# ---------------------------- +# Define the overloaded versions of make_symbol for all the value types. +m4_define([b4_symbol_constructor_define], +[ // Implementation of make_symbol for each symbol type. +b4_symbol_foreach([b4_symbol_constructor_define_])]) diff --git a/data/xslt/bison.xsl b/data/xslt/bison.xsl index 10e3305..9f9132b 100644 --- a/data/xslt/bison.xsl +++ b/data/xslt/bison.xsl @@ -3,7 +3,7 @@ @@ -214,7 +216,9 @@ - + + %empty + [ @@ -279,20 +283,20 @@ - - dotted - - - solid - - - dashed - + + dotted + + + solid + + + dashed + - + diff --git a/data/xslt/xml2text.xsl b/data/xslt/xml2text.xsl index d479a8e..747c32b 100644 --- a/data/xslt/xml2text.xsl +++ b/data/xslt/xml2text.xsl @@ -3,7 +3,7 @@ \$\$ = nterm start (1.1: <> for 'S' @ 1) -Stack now 0 -Entering state 1 -Reading a token: Now at end of input. -Shifting token END (1.1: <> for 'E' @ 1) -Entering state 2 -Stack now 0 1 2 -Cleanup: popping token END (1.1: <> for 'E' @ 1) -Cleanup: popping nterm start (1.1: <> for 'S' @ 1) -" | \ - $at_diff - "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1087" +at_fn_check_skip $at_status "$at_srcdir/synclines.at:210" $at_failed && at_fn_log_failure $at_traceon; } +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:210: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + # 2. Normalize the lines we kept. + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:210" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + # 2. Normalize the lines we kept. + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF -cat >input1.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%error-verbose -%debug -%locations - -%{ -# include -# include -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); -} <*> +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:210" +$at_failed && at_fn_log_failure +$at_traceon; } -%printer { - fprintf (yyoutput, "<> printer should not be called.\n"); -} <> -%union { char tag; } -%type start END -%% +{ set +x +$as_echo "$at_srcdir/synclines.at:210: cat stdout" +at_fn_check_prepare_trace "synclines.at:210" +( $at_check_trace; cat stdout +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:210" +$at_failed && at_fn_log_failure +$at_traceon; } -start: { $$ = 'S'; } ; -%% + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_188 +#AT_START_189 +at_fn_group_banner 189 'synclines.at:219' \ + "%union name syncline" " " 8 +at_xfail=no +( + $as_echo "189. $at_setup_line: testing $at_desc ..." + $at_traceon -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; -} -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - YY_LOCATION_PRINT (stderr, (yylloc)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -int -main (void) +cat >input.y <<'_ATEOF' +%union break { - yydebug = 1; - return yyparse (); + char dummy; } +%{ +void yyerror (const char *msg); +int yylex (void); +%} +%% +exp: '0'; +%% _ATEOF - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1088: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1088" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input1.c input1.y +$as_echo "$at_srcdir/synclines.at:235: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:235" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1088" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:235" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1088: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y" "actions.at:1088" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input1.c input1.y +$as_echo "$at_srcdir/synclines.at:235: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:235" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1088" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:235" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1088: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:235: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1088" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:235" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -45606,16 +47890,16 @@ at_status=$? at_failed=false $at_check_filter 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:1088" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:235" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1088: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:235: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1088" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:235" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -45624,7 +47908,7 @@ at_status=$? at_failed=false $at_check_filter 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:1088" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:235" $at_failed && at_fn_log_failure $at_traceon; } @@ -45632,222 +47916,390 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1088: bison -o input1.c input1.y" -at_fn_check_prepare_trace "actions.at:1088" -( $at_check_trace; bison -o input1.c input1.y +$as_echo "$at_srcdir/synclines.at:235: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "synclines.at:235" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1088" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:235" $at_failed && at_fn_log_failure $at_traceon; } +# Check if we can trust location translation. +cat >syncline.c <<'_ATEOF' +void foo (void); +void foo (void) +{ +#error "4" +} +_ATEOF + + { set +x -$as_echo "$at_srcdir/actions.at:1088: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1088" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/synclines.at:236: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:236" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1088" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/synclines.at:236" $at_failed && at_fn_log_failure $at_traceon; } + +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. { set +x -$as_echo "$at_srcdir/actions.at:1088: \$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:1088" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS +$as_echo "$at_srcdir/synclines.at:236: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:236" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1088" +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:236" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/actions.at:1088: \$PREPARSER ./input1" -at_fn_check_prepare_dynamic " $PREPARSER ./input1" "actions.at:1088" -( $at_check_trace; $PREPARSER ./input1 +$as_echo "$at_srcdir/synclines.at:236: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:236" +( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -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:1088" +at_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:236" $at_failed && at_fn_log_failure $at_traceon; } + +# Then work for real. { set +x -$as_echo "$at_srcdir/actions.at:1088: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1088" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/synclines.at:236: \$CC \$CFLAGS \$CPPFLAGS -c input.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:236" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "Starting parse -Entering state 0 -Reducing stack by rule 1 (line 42): --> \$\$ = nterm start (1.1: <*> for 'S' @ 1) -Stack now 0 -Entering state 1 -Reading a token: Now at end of input. -Shifting token END (1.1: <*> for 'E' @ 1) -Entering state 2 -Stack now 0 1 2 -Cleanup: popping token END (1.1: <*> for 'E' @ 1) -Cleanup: popping nterm start (1.1: <*> for 'S' @ 1) -" | \ - $at_diff - "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1088" +at_fn_check_skip $at_status "$at_srcdir/synclines.at:236" $at_failed && at_fn_log_failure $at_traceon; } +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:236: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:236" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:236" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/synclines.at:237: grep '^input.y:1' stdout" +at_fn_check_prepare_trace "synclines.at:237" +( $at_check_trace; grep '^input.y:1' stdout +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/synclines.at:237" +$at_failed && at_fn_log_failure +$at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_167 -#AT_START_168 -at_fn_group_banner 168 'actions.at:1098' \ - "Default %printer and %destructor are not for error or \$undefined" "" 9 +#AT_STOP_189 +#AT_START_190 +at_fn_group_banner 190 'synclines.at:263' \ + "Postprologue syncline" " " 8 at_xfail=no ( - $as_echo "168. $at_setup_line: testing $at_desc ..." + $as_echo "190. $at_setup_line: testing $at_desc ..." $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 -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc +%{ +void yyerror (const char *msg); +int yylex (void); +%} +%union +{ + int ival; } - -%debug - %{ -# include -# include -static void yyerror ( const char *msg); -static int yylex (void); -# define USE(SYM) +#error "10" %} - -%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'; } - ; - +exp: '0'; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) -{ - static char const input[] = "abd"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - yylval = res; - return res; -} -int -main (void) -{ - yydebug = 1; - return yyparse (); -} _ATEOF - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1148: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1148" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/synclines.at:263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1148" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:263" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1148: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1148" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/synclines.at:263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1148" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:263" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1148: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:263: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1148" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:263" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -45856,16 +48308,16 @@ at_status=$? at_failed=false $at_check_filter 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:1148" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:263" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1148: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:263: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1148" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:263" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -45874,7 +48326,7 @@ at_status=$? at_failed=false $at_check_filter 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:1148" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:263" $at_failed && at_fn_log_failure $at_traceon; } @@ -45882,309 +48334,317 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1148: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1148" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/synclines.at:263: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "synclines.at:263" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1148" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:263" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/actions.at:1149: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1149" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1149" -$at_failed && at_fn_log_failure -$at_traceon; } +# Check if we can trust location translation. +cat >syncline.c <<'_ATEOF' +void foo (void); +void foo (void) +{ +#error "4" +} +_ATEOF -{ set +x -$as_echo "$at_srcdir/actions.at:1149: \$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:1149" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1149" -$at_failed && at_fn_log_failure -$at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1150: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1150" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/synclines.at:263: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:263" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1150" +at_fn_check_skip $at_status "$at_srcdir/synclines.at:263" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/actions.at:1150: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1150" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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 0 $at_status "$at_srcdir/actions.at:1150" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_168 -#AT_START_169 -at_fn_group_banner 169 'actions.at:1193' \ - "Default %printer and %destructor are not for \$accept" "" 9 -at_xfail=no -( - $as_echo "169. $at_setup_line: testing $at_desc ..." - $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 $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 -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%debug /* So that %printer is actually compiled. */ - -%{ -# include -# include -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 start +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:263: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. -%% + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; -start: { USE($$); } ; + # 2. Normalize the lines we kept. -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) -{ - static char const input[] = ""; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; -} -int -main (void) -{ - return yyparse (); -} -_ATEOF + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:263" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + # 2. Normalize the lines we kept. + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1247" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1247" +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:263" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/actions.at:1247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1247" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1247" -$at_failed && at_fn_log_failure -$at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/actions.at:1247: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1247" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml +{ set +x +$as_echo "$at_srcdir/synclines.at:263: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:263" +( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1247" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:263" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/actions.at:1247: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1247" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1247" -$at_failed && at_fn_log_failure -$at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi +# Then work for real. { set +x -$as_echo "$at_srcdir/actions.at:1247: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1247" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/synclines.at:263: \$CC \$CFLAGS \$CPPFLAGS -c input.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:263" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1247" +at_fn_check_skip $at_status "$at_srcdir/synclines.at:263" $at_failed && at_fn_log_failure $at_traceon; } +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. { set +x -$as_echo "$at_srcdir/actions.at:1248: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1248" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/synclines.at:263: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:263" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1248" +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:263" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/actions.at:1248: \$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:1248" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/synclines.at:263: cat stdout" +at_fn_check_prepare_trace "synclines.at:263" +( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1248" +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:263" $at_failed && at_fn_log_failure $at_traceon; } @@ -46193,126 +48653,68 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_169 -#AT_START_170 -at_fn_group_banner 170 'actions.at:1258' \ - "Default %printer and %destructor for mid-rule values" "" 9 +#AT_STOP_190 +#AT_START_191 +at_fn_group_banner 191 'synclines.at:282' \ + "Action syncline" " " 8 at_xfail=no ( - $as_echo "170. $at_setup_line: testing $at_desc ..." + $as_echo "191. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%debug /* So that %printer is actually compiled. */ - %{ -# include -# include -static void yyerror ( const char *msg); -static int yylex (void); -# define USE(SYM) -# define YYLTYPE int -# define YYLLOC_DEFAULT(Current, Rhs, N) (void)(Rhs) -# define YY_LOCATION_PRINT(File, Loc) +void yyerror (const char *msg); +int yylex (void); %} - -%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; } - ; - %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) -{ - static char const input[] = ""; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; -} -int -main (void) +exp: { - yydebug = 1; - return yyparse (); -} +#error "8" +}; _ATEOF - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/synclines.at:282: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:282" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1303" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/synclines.at:282: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:282" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1303: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:282: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:282" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -46321,16 +48723,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1303: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:282: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1303" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:282" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -46339,7 +48741,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } @@ -46347,140 +48749,346 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/synclines.at:282: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "synclines.at:282" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$ -input.y:32.3-23: warning: unused value: \$3 -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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_fn_check_status 0 $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - # To avoid expanding it repeatedly, store specified stdout. - : >expout +# Check if we can trust location translation. +cat >syncline.c <<'_ATEOF' +void foo (void); +void foo (void) +{ +#error "4" +} +_ATEOF - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "actions.at:1303" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror + +{ set +x +$as_echo "$at_srcdir/synclines.at:282: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:282" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1303" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:33.3-23: warning: unset value: $$ -input.y:32.3-23: warning: unused value: $3 -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:282: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:282" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/actions.at:1303: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1303" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: +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:282" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/synclines.at:282: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:282" +( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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_fn_check_status 0 $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "actions.at:1303" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error +# Then work for real. +{ set +x +$as_echo "$at_srcdir/synclines.at:282: \$CC \$CFLAGS \$CPPFLAGS -c input.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:282" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1303" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "actions.at:1303" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:282: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:282" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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" +echo stdout:; tee stdout <"$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:282" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/actions.at:1303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "actions.at:1303" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror + + +{ set +x +$as_echo "$at_srcdir/synclines.at:282: cat stdout" +at_fn_check_prepare_trace "synclines.at:282" +( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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" +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:282" $at_failed && at_fn_log_failure $at_traceon; } - at_restore_special_files -fi + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_191 +#AT_START_192 +at_fn_group_banner 192 'synclines.at:300' \ + "Epilogue syncline" " " 8 +at_xfail=no +( + $as_echo "192. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%{ +void yyerror (const char *msg); +int yylex (void); +%} +%% +exp: '0'; +%% +#error "8" +_ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files @@ -46488,39 +49096,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -fcaret -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1308" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -fcaret -o input.c input.y +$as_echo "$at_srcdir/synclines.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:300" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1308" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "actions.at:1308" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y +$as_echo "$at_srcdir/synclines.at:300: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:300" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1308" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1308: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:300: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1308" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:300" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -46529,16 +49137,16 @@ at_status=$? at_failed=false $at_check_filter 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:1308" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1308: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:300: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1308" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:300" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -46547,7 +49155,7 @@ at_status=$? at_failed=false $at_check_filter 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:1308" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } @@ -46555,251 +49163,752 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1308: bison -fcaret -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1308" -( $at_check_trace; bison -fcaret -o input.c input.y +$as_echo "$at_srcdir/synclines.at:300: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "synclines.at:300" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$ - { @\$ = 4; } // Only used. - ^^^^^^^^^^^^^^^^^^^^^ -input.y:32.3-23: warning: unused value: \$3 - { USE (\$\$); @\$ = 3; } // Only set. - ^^^^^^^^^^^^^^^^^^^^^ -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1308" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - # To avoid expanding it repeatedly, store specified stdout. - : >expout +# Check if we can trust location translation. +cat >syncline.c <<'_ATEOF' +void foo (void); +void foo (void) +{ +#error "4" +} +_ATEOF - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "actions.at:1308" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror + +{ set +x +$as_echo "$at_srcdir/synclines.at:300: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:300" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1308" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:33.3-23: warning: unset value: $$ - { @$ = 4; } // Only used. - ^^^^^^^^^^^^^^^^^^^^^ -input.y:32.3-23: warning: unused value: $3 - { USE ($$); @$ = 3; } // Only set. - ^^^^^^^^^^^^^^^^^^^^^ -_ATEOF +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:300: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:300" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/actions.at:1308: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1308" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: +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:300" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/synclines.at:300: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:300" +( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1308" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "actions.at:1308" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error +# Then work for real. +{ set +x +$as_echo "$at_srcdir/synclines.at:300: \$CC \$CFLAGS \$CPPFLAGS -c input.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:300" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1308" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "actions.at:1308" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:300: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:300" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1308" +echo stdout:; tee stdout <"$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:300" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/actions.at:1308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "actions.at:1308" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror + + +{ set +x +$as_echo "$at_srcdir/synclines.at:300: cat stdout" +at_fn_check_prepare_trace "synclines.at:300" +( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1308" +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:300" $at_failed && at_fn_log_failure $at_traceon; } - at_restore_special_files -fi + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_192 +#AT_START_193 +at_fn_group_banner 193 'synclines.at:319' \ + "%code top syncline" " " 8 +at_xfail=no +( + $as_echo "193. $at_setup_line: testing $at_desc ..." + $at_traceon -{ set +x -$as_echo "$at_srcdir/actions.at:1317: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1317" -( $at_check_trace; $BISON_C_WORKS + + +cat >input.y <<'_ATEOF' +%code top { +#error "2" +} +%{ +void yyerror (const char *msg); +int yylex (void); +%} +%% +exp: '0'; +%% +_ATEOF + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:319" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1317" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:319" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/actions.at:1317: \$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:1317" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS + { set +x +$as_echo "$at_srcdir/synclines.at:319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:319" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1317" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:319" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/actions.at:1318: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1318" -( $at_check_trace; $PREPARSER ./input + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/synclines.at:319: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:319" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1318" +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:319" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/synclines.at:319: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:319" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:319" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/actions.at:1318: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1318" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/synclines.at:319: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "synclines.at:319" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:319" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check if we can trust location translation. +cat >syncline.c <<'_ATEOF' +void foo (void); +void foo (void) +{ +#error "4" +} +_ATEOF + + +{ set +x +$as_echo "$at_srcdir/synclines.at:319: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:319" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_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:319" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:319: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:319" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:319" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/synclines.at:319: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:319" +( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:319" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Then work for real. +{ set +x +$as_echo "$at_srcdir/synclines.at:319: \$CC \$CFLAGS \$CPPFLAGS -c input.c" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:319" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1318" +at_fn_check_skip $at_status "$at_srcdir/synclines.at:319" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Transform stderr into something like this: +# +# input.y:4: #error "4" +# +# 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" +# +# It may also issue more context information: +# +# input.y: In function 'yyparse': +# input.y:8: #error "8" +# => +# input.y:4: #error "8" +# +# The message may include a caret-error (indented by GCC 4.8, +# not by clang 3.2): +# +# input.y:1:2: error: #error "1" +# #error "1" +# ^ +# +# Possibly distcc adds its bits. +# +# distcc[33187] ERROR: compile (null) on localhost failed +# syncline.c:1:2: error: #error "1" +# distcc[33185] ERROR: compile syncline.c on localhost failed +# +# or even +# +# distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host +# distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead +# +# The compiler might end by the number of messages issued (Clang 3.2): +# +# syncline.c:1:2: error: "1" +# #error "1" +# ^ +# 1 error generated. +# +# When c++ is used to compiler C, we might have more messages (Clang 3.2): +# +# clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated +# +# +# xlc reports things like: +# +# "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". +# "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers +# +# Newer GCCs go further and if the function is declared static, complain +# that it's not used. +{ set +x +$as_echo "$at_srcdir/synclines.at:319: \$PERL -p -0777 - stderr <<\\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\\[\\d+\\] .*\\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\\n//gm; + # Caret error. + s/^ *#error.*\\n *\\^\\n//gm; + # Number of errors. + s/^1 error generated\\.\\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). + s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; + # Remove column. + s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; + # Map all combinations of \"error: \" and \"#error: \" to \"#error \". + s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; +EOF +" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:319" +( $at_check_trace; $PERL -p -0777 - stderr <<\EOF + # 1. Remove useless lines. + + # distcc clutter. + s/^distcc\[\d+\] .*\n//gm; + # c vs. c++. + s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm; + # Function context. + s/^[^:]*: In function '[^']+':\n//gm; + # Caret error. + s/^ *#error.*\n *\^\n//gm; + # Number of errors. + s/^1 error generated\.\n//gm; + + # 2. Normalize the lines we kept. + + # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). + s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; + # Remove column. + s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; + # Map all combinations of "error: " and "#error: " to "#error ". + s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; +EOF + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:319" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/synclines.at:319: cat stdout" +at_fn_check_prepare_trace "synclines.at:319" +( $at_check_trace; cat stdout +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:319" +$at_failed && at_fn_log_failure +$at_traceon; } + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_170 -#AT_START_171 -at_fn_group_banner 171 'actions.at:1406' \ - "@\$ in %initial-action implies %locations" " " 9 +#AT_STOP_193 +#AT_START_194 +at_fn_group_banner 194 'synclines.at:347' \ + "%no-lines: yacc.c" " " 8 at_xfail=no ( - $as_echo "171. $at_setup_line: testing $at_desc ..." + $as_echo "194. $at_setup_line: testing $at_desc ..." $at_traceon + cat >input.y <<'_ATEOF' %code top { #include @@ -46809,85 +49918,55 @@ cat >input.y <<'_ATEOF' #undef realloc } -%code { - #include -static void yyerror ( const char *msg); -static int yylex (void); -} - -%debug - -%initial-action { - fprintf (stderr, "%d\n", @$.first_line); -} - -%% - -start: ; - +%skeleton "yacc.c" %defines +%{ +void yyerror (const char *msg); +int yylex (void); +%} %% - -static int -yylex (void) -{ - return 0; -} - -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -int -main (void) -{ - return yyparse (); -} +exp: '0' _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1406" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/synclines.at:347: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --no-lines -o input.c -d input.y" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:347" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:347" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1406" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/synclines.at:347: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:347" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:347" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1406: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:347: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1406" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:347" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -46896,16 +49975,16 @@ at_status=$? at_failed=false $at_check_filter 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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:347" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1406: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:347: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1406" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:347" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -46914,7 +49993,7 @@ at_status=$? at_failed=false $at_check_filter 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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:347" $at_failed && at_fn_log_failure $at_traceon; } @@ -46922,60 +50001,49 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1406: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1406" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/synclines.at:347: bison -fno-caret --no-lines -o input.c -d input.y" +at_fn_check_prepare_trace "synclines.at:347" +( $at_check_trace; bison -fno-caret --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:347" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1406: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1406" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/synclines.at:347: grep '#line' *.c *.h" +at_fn_check_prepare_trace "synclines.at:347" +( $at_check_trace; grep '#line' *.c *.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1406" +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/synclines.at:347" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/actions.at:1406: \$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:1406" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1406" -$at_failed && at_fn_log_failure -$at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_171 -#AT_START_172 -at_fn_group_banner 172 'actions.at:1407' \ - "@\$ in %destructor implies %locations" " " 9 +#AT_STOP_194 +#AT_START_195 +at_fn_group_banner 195 'synclines.at:348' \ + "%no-lines: glr.c" " " 8 at_xfail=no ( - $as_echo "172. $at_setup_line: testing $at_desc ..." + $as_echo "195. $at_setup_line: testing $at_desc ..." $at_traceon + cat >input.y <<'_ATEOF' %code top { #include @@ -46985,85 +50053,55 @@ cat >input.y <<'_ATEOF' #undef realloc } -%code { - #include -static void yyerror ( const char *msg); -static int yylex (void); -} - -%debug - -%destructor { - fprintf (stderr, "%d\n", @$.first_line); -} start - -%% - -start: ; - +%skeleton "glr.c" %defines +%{ +void yyerror (const char *msg); +int yylex (void); +%} %% - -static int -yylex (void) -{ - return 0; -} - -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -int -main (void) -{ - return yyparse (); -} +exp: '0' _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1407: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1407" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/synclines.at:348: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --no-lines -o input.c -d input.y" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:348" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1407" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:348" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1407: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1407" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/synclines.at:348: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:348" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1407" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:348" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1407: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:348: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1407" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:348" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -47072,16 +50110,16 @@ at_status=$? at_failed=false $at_check_filter 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:1407" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:348" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1407: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:348: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1407" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:348" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -47090,7 +50128,7 @@ at_status=$? at_failed=false $at_check_filter 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:1407" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:348" $at_failed && at_fn_log_failure $at_traceon; } @@ -47098,60 +50136,49 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1407: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1407" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/synclines.at:348: bison -fno-caret --no-lines -o input.c -d input.y" +at_fn_check_prepare_trace "synclines.at:348" +( $at_check_trace; bison -fno-caret --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1407" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:348" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1407: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1407" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/synclines.at:348: grep '#line' *.c *.h" +at_fn_check_prepare_trace "synclines.at:348" +( $at_check_trace; grep '#line' *.c *.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1407" +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/synclines.at:348" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/actions.at:1407: \$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:1407" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1407" -$at_failed && at_fn_log_failure -$at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_172 -#AT_START_173 -at_fn_group_banner 173 'actions.at:1408' \ - "@\$ in %printer implies %locations" " " 9 +#AT_STOP_195 +#AT_START_196 +at_fn_group_banner 196 'synclines.at:349' \ + "%no-lines: lalr1.cc" " " 8 at_xfail=no ( - $as_echo "173. $at_setup_line: testing $at_desc ..." + $as_echo "196. $at_setup_line: testing $at_desc ..." $at_traceon + cat >input.y <<'_ATEOF' %code top { #include @@ -47161,85 +50188,55 @@ cat >input.y <<'_ATEOF' #undef realloc } -%code { - #include -static void yyerror ( const char *msg); -static int yylex (void); -} - -%debug - -%printer { - fprintf (stderr, "%d\n", @$.first_line); -} start - -%% - -start: ; +%skeleton "lalr1.cc" %defines +%{ +int yylex (yy::parser::semantic_type *lvalp); +%} %% - -static int -yylex (void) -{ - return 0; -} - -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -int -main (void) -{ - return yyparse (); -} +exp: '0' _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1408" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/synclines.at:349: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:349" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1408" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:349" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1408" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/synclines.at:349: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:349" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1408" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:349" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1408: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:349: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1408" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:349" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -47248,16 +50245,16 @@ at_status=$? at_failed=false $at_check_filter 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:1408" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:349" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1408: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:349: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1408" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:349" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -47266,7 +50263,7 @@ at_status=$? at_failed=false $at_check_filter 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:1408" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:349" $at_failed && at_fn_log_failure $at_traceon; } @@ -47274,62 +50271,49 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1408: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1408" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/synclines.at:349: bison -fno-caret --no-lines -o input.cc -d input.y" +at_fn_check_prepare_trace "synclines.at:349" +( $at_check_trace; bison -fno-caret --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1408" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:349" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1408: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1408" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/synclines.at:349: grep '#line' *.cc *.hh" +at_fn_check_prepare_trace "synclines.at:349" +( $at_check_trace; grep '#line' *.cc *.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1408" +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/synclines.at:349" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/actions.at:1408: \$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:1408" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1408" -$at_failed && at_fn_log_failure -$at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_173 -#AT_START_174 -at_fn_group_banner 174 'actions.at:1529' \ - "Qualified \$\$ in actions: yacc.c" " " 9 +#AT_STOP_196 +#AT_START_197 +at_fn_group_banner 197 'synclines.at:350' \ + "%no-lines: glr.cc" " " 8 at_xfail=no ( - $as_echo "174. $at_setup_line: testing $at_desc ..." + $as_echo "197. $at_setup_line: testing $at_desc ..." $at_traceon - cat >input.y <<'_ATEOF' %code top { #include @@ -47339,129 +50323,55 @@ cat >input.y <<'_ATEOF' #undef realloc } -%skeleton "yacc.c" -%defines // FIXME: Mandated by lalr1.cc in Bison 2.6. -%locations // FIXME: Mandated by lalr1.cc in Bison 2.6. -%debug -%code requires -{ - typedef struct sem_type - { - int ival; - float fval; - } sem_type; - -# define YYSTYPE sem_type - - -# include - static void - report (FILE* yyo, int ival, float fval) - { - fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval); - } - -} - -%code -{ - static void yyerror ( const char *msg); - static int yylex (void); -} - -%token UNTYPED -%token INT -%type float -%printer { report (yyo, $$, $$); } ; -%printer { report (yyo, $$, $$ ); } ; -%printer { report (yyo, $$, $$); } <>; - -%initial-action -{ - $$ = 42; - $$ = 4.2; -} +%skeleton "glr.cc" %defines +%{ +int yylex (yy::parser::semantic_type *lvalp); +%} %% -float: UNTYPED INT -{ - $$ = $1 + $2; - $$ = $1 + $2; -}; -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - YY_LOCATION_PRINT (stderr, (yylloc)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) -{ - static int const input[] = {UNTYPED, INT, EOF}; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;; - (yylloc).first_line = (yylloc).last_line = 1; - (yylloc).first_column = (yylloc).last_column = toknum; - return res; -} -int -main (void) -{ - yydebug = 1; - return yyparse (); -} +exp: '0' _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1529" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/synclines.at:350: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y" +at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:350" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1529" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:350" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1529" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/synclines.at:350: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:350" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1529" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:350" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1529: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:350: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1529" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:350" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -47470,16 +50380,16 @@ at_status=$? at_failed=false $at_check_filter 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:1529" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:350" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1529: \$XSLTPROC \\ +$as_echo "$at_srcdir/synclines.at:350: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1529" +at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:350" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -47488,7 +50398,7 @@ at_status=$? at_failed=false $at_check_filter 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:1529" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:350" $at_failed && at_fn_log_failure $at_traceon; } @@ -47496,120 +50406,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1529: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1529" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/synclines.at:350: bison -fno-caret --no-lines -o input.cc -d input.y" +at_fn_check_prepare_trace "synclines.at:350" +( $at_check_trace; bison -fno-caret --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1529" -$at_failed && at_fn_log_failure -$at_traceon; } - - - { set +x -$as_echo "$at_srcdir/actions.at:1529: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1529" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1529" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/actions.at:1529: \$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:1529" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1529" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/actions.at:1529: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1529" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/actions.at:1529: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1529" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" +at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:350" $at_failed && at_fn_log_failure $at_traceon; } -# Don't be too picky on the traces, GLR is not exactly the same. Keep -# only the lines from the printer. -# -# Don't care about locations. FIXME: remove their removal when Bison -# supports C++ without locations. { set +x -$as_echo "$at_srcdir/actions.at:1529: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr" -at_fn_check_prepare_trace "actions.at:1529" -( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr +$as_echo "$at_srcdir/synclines.at:350: grep '#line' *.cc *.hh" +at_fn_check_prepare_trace "synclines.at:350" +( $at_check_trace; grep '#line' *.cc *.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) -Shifting token UNTYPED (ival: 10, fval: 0.1) -Reading a token: Next token is token INT (ival: 20, fval: 0.2) -Shifting token INT (ival: 20, fval: 0.2) - \$1 = token UNTYPED (ival: 10, fval: 0.1) - \$2 = token INT (ival: 20, fval: 0.2) --> \$\$ = nterm float (ival: 30, fval: 0.3) -Cleanup: popping nterm float (ival: 30, fval: 0.3) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1529" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:350" $at_failed && at_fn_log_failure $at_traceon; } - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_174 -#AT_START_175 -at_fn_group_banner 175 'actions.at:1530' \ - "Qualified \$\$ in actions: glr.c" " " 9 +#AT_STOP_197 +#AT_START_198 +at_fn_group_banner 198 'headers.at:57' \ + "Invalid CPP guards: --defines=input/input.h" " " 9 at_xfail=no ( - $as_echo "175. $at_setup_line: testing $at_desc ..." + $as_echo "198. $at_setup_line: testing $at_desc ..." $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.y <<'_ATEOF' +cat >input/input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -47618,86 +50483,16 @@ cat >input.y <<'_ATEOF' #undef realloc } -%skeleton "glr.c" -%defines // FIXME: Mandated by lalr1.cc in Bison 2.6. -%locations // FIXME: Mandated by lalr1.cc in Bison 2.6. -%debug -%code requires -{ - typedef struct sem_type - { - int ival; - float fval; - } sem_type; - -# define YYSTYPE sem_type - - -# include - static void - report (FILE* yyo, int ival, float fval) - { - fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval); - } - -} - -%code -{ - static void yyerror ( const char *msg); - static int yylex (void); -} - -%token UNTYPED -%token INT -%type float -%printer { report (yyo, $$, $$); } ; -%printer { report (yyo, $$, $$ ); } ; -%printer { report (yyo, $$, $$); } <>; - -%initial-action -{ - $$ = 42; - $$ = 4.2; -} +%{ +#include +void yyerror (const char *msg); +int yylex (void); +%} %% -float: UNTYPED INT -{ - $$ = $1 + $2; - $$ = $1 + $2; -}; +dummy: /* empty */; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - YY_LOCATION_PRINT (stderr, (yylloc)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) -{ - static int const input[] = {UNTYPED, INT, EOF}; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;; - (yylloc).first_line = (yylloc).last_line = 1; - (yylloc).first_column = (yylloc).last_column = toknum; - return res; -} -int -main (void) -{ - yydebug = 1; - return yyparse (); -} +#include _ATEOF @@ -47708,39 +50503,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1530: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1530" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/headers.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:57" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1530" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1530: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1530" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/headers.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:57" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1530" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1530: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1530" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -47749,16 +50544,16 @@ at_status=$? at_failed=false $at_check_filter 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:1530" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1530: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1530" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -47767,7 +50562,7 @@ at_status=$? at_failed=false $at_check_filter 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:1530" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } @@ -47775,120 +50570,89 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1530: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1530" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/headers.at:57: bison -fno-caret --defines=input/input.h --output=input/input.c input/input.y" +at_fn_check_prepare_trace "headers.at:57" +( $at_check_trace; bison -fno-caret --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1530" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/actions.at:1530: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1530" + +{ set +x +$as_echo "$at_srcdir/headers.at:57: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:57" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1530" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1530: \$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:1530" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/headers.at:57: \$CC \$CFLAGS \$CPPFLAGS -c -o input/input.o -I. -c input/input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c " "headers.at:57" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1530" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/actions.at:1530: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1530" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/actions.at:1530: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1530" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Don't be too picky on the traces, GLR is not exactly the same. Keep -# only the lines from the printer. -# -# Don't care about locations. FIXME: remove their removal when Bison -# supports C++ without locations. -{ set +x -$as_echo "$at_srcdir/actions.at:1530: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr" -at_fn_check_prepare_trace "actions.at:1530" -( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) -Shifting token UNTYPED (ival: 10, fval: 0.1) -Reading a token: Next token is token INT (ival: 20, fval: 0.2) -Shifting token INT (ival: 20, fval: 0.2) - \$1 = token UNTYPED (ival: 10, fval: 0.1) - \$2 = token INT (ival: 20, fval: 0.2) --> \$\$ = nterm float (ival: 30, fval: 0.3) -Cleanup: popping nterm float (ival: 30, fval: 0.3) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1530" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_175 -#AT_START_176 -at_fn_group_banner 176 'actions.at:1531' \ - "Qualified \$\$ in actions: lalr1.cc" " " 9 +#AT_STOP_198 +#AT_START_199 +at_fn_group_banner 199 'headers.at:58' \ + "Invalid CPP guards: --defines=9foo.h" " " 9 at_xfail=no ( - $as_echo "176. $at_setup_line: testing $at_desc ..." + $as_echo "199. $at_setup_line: testing $at_desc ..." $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 >input.y <<'_ATEOF' +cat >9foo.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -47897,87 +50661,16 @@ cat >input.y <<'_ATEOF' #undef realloc } -%skeleton "lalr1.cc" -%defines // FIXME: Mandated by lalr1.cc in Bison 2.6. -%locations // FIXME: Mandated by lalr1.cc in Bison 2.6. -%debug -%code requires -{ - typedef struct sem_type - { - int ival; - float fval; - } sem_type; - -# define YYSTYPE sem_type - - -# include - static void - report (std::ostream& yyo, int ival, float fval) - { - yyo << "ival: " << ival << ", fval: " << fval; - } - -} - -%code -{ - - static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -} - -%token UNTYPED -%token INT -%type float -%printer { report (yyo, $$, $$); } ; -%printer { report (yyo, $$, $$ ); } ; -%printer { report (yyo, $$, $$); } <>; - -%initial-action -{ - $$ = 42; - $$ = 4.2; -} +%{ +#include <9foo.h> +void yyerror (const char *msg); +int yylex (void); +%} %% -float: UNTYPED INT -{ - $$ = $1 + $2; - $$ = $1 + $2; -}; +dummy: /* empty */; %% -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -#include -static -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) -{ - static int const input[] = {yy::parser::token::UNTYPED, - yy::parser::token::INT, - EOF}; - static size_t toknum = 0; - int res; - (void) lvalp;(void) llocp; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;; - (*llocp).begin.line = (*llocp).end.line = 1; - (*llocp).begin.column = (*llocp).end.column = toknum; - return res; -} -int -main (void) -{ - yy::parser p; - p.set_debug_level(1); - return p.parse (); -} +#include <9foo.h> _ATEOF @@ -47988,39 +50681,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1531" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/headers.at:58: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:58" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1531" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/headers.at:58: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:58" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1531: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1531" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -48029,16 +50722,16 @@ at_status=$? at_failed=false $at_check_filter 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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1531: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1531" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -48047,7 +50740,7 @@ at_status=$? at_failed=false $at_check_filter 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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } @@ -48055,121 +50748,89 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1531: bison -o input.cc input.y" -at_fn_check_prepare_trace "actions.at:1531" -( $at_check_trace; bison -o input.cc input.y +$as_echo "$at_srcdir/headers.at:58: bison -fno-caret --defines=9foo.h --output=9foo.c 9foo.y" +at_fn_check_prepare_trace "headers.at:58" +( $at_check_trace; bison -fno-caret --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1531: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1531" -( $at_check_trace; $BISON_CXX_WORKS +$as_echo "$at_srcdir/headers.at:58: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:58" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1531: \$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:1531" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +$as_echo "$at_srcdir/headers.at:58: \$CC \$CFLAGS \$CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " "headers.at:58" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1531" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/actions.at:1531: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1531" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/actions.at:1531: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1531" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Don't be too picky on the traces, GLR is not exactly the same. Keep -# only the lines from the printer. -# -# Don't care about locations. FIXME: remove their removal when Bison -# supports C++ without locations. -{ set +x -$as_echo "$at_srcdir/actions.at:1531: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr" -at_fn_check_prepare_trace "actions.at:1531" -( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) -Shifting token UNTYPED (ival: 10, fval: 0.1) -Reading a token: Next token is token INT (ival: 20, fval: 0.2) -Shifting token INT (ival: 20, fval: 0.2) - \$1 = token UNTYPED (ival: 10, fval: 0.1) - \$2 = token INT (ival: 20, fval: 0.2) --> \$\$ = nterm float (ival: 30, fval: 0.3) -Cleanup: popping nterm float (ival: 30, fval: 0.3) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1531" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_176 -#AT_START_177 -at_fn_group_banner 177 'actions.at:1532' \ - "Qualified \$\$ in actions: glr.cc" " " 9 +#AT_STOP_199 +#AT_START_200 +at_fn_group_banner 200 'headers.at:59' \ + "Invalid CPP guards: %glr-parser --defines=input/input.h" "" 9 at_xfail=no ( - $as_echo "177. $at_setup_line: testing $at_desc ..." + $as_echo "200. $at_setup_line: testing $at_desc ..." $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.y <<'_ATEOF' +cat >input/input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -48178,88 +50839,17 @@ cat >input.y <<'_ATEOF' #undef realloc } -%skeleton "glr.cc" -%defines // FIXME: Mandated by lalr1.cc in Bison 2.6. -%locations // FIXME: Mandated by lalr1.cc in Bison 2.6. -%debug -%code requires -{ - typedef struct sem_type - { - int ival; - float fval; - } sem_type; - -# define YYSTYPE sem_type - - -# include - static void - report (std::ostream& yyo, int ival, float fval) - { - yyo << "ival: " << ival << ", fval: " << fval; - } - -} - -%code -{ - - static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -} - -%token UNTYPED -%token INT -%type float -%printer { report (yyo, $$, $$); } ; -%printer { report (yyo, $$, $$ ); } ; -%printer { report (yyo, $$, $$); } <>; - -%initial-action -{ - $$ = 42; - $$ = 4.2; -} - -%% -float: UNTYPED INT -{ - $$ = $1 + $2; - $$ = $1 + $2; -}; -%% -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -#include -static -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) -{ - static int const input[] = {yy::parser::token::UNTYPED, - yy::parser::token::INT, - EOF}; - static size_t toknum = 0; - int res; - (void) lvalp;(void) llocp; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;; - (*llocp).begin.line = (*llocp).end.line = 1; - (*llocp).begin.column = (*llocp).end.column = toknum; - return res; -} -int -main (void) -{ - yy::parser p; - p.set_debug_level(1); - return p.parse (); -} -_ATEOF +%glr-parser +%{ +#include +void yyerror (const char *msg); +int yylex (void); +%} +%% +dummy: /* empty */; +%% +#include +_ATEOF @@ -48269,39 +50859,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1532" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/headers.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:59" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1532" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1532" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/headers.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:59" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1532" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1532: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.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' "actions.at:1532" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.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 @@ -48310,16 +50900,16 @@ at_status=$? at_failed=false $at_check_filter 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:1532" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1532: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1532" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.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 | sort @@ -48328,7 +50918,7 @@ at_status=$? at_failed=false $at_check_filter 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:1532" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } @@ -48336,101 +50926,223 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1532: bison -o input.cc input.y" -at_fn_check_prepare_trace "actions.at:1532" -( $at_check_trace; bison -o input.cc input.y +$as_echo "$at_srcdir/headers.at:59: bison -fno-caret --defines=input/input.h --output=input/input.c input/input.y" +at_fn_check_prepare_trace "headers.at:59" +( $at_check_trace; bison -fno-caret --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1532" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1532: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1532" -( $at_check_trace; $BISON_CXX_WORKS +$as_echo "$at_srcdir/headers.at:59: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:59" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1532" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1532: \$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:1532" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +$as_echo "$at_srcdir/headers.at:59: \$CC \$CFLAGS \$CPPFLAGS -c -o input/input.o -I. -c input/input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c " "headers.at:59" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1532" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/actions.at:1532: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1532" -( $at_check_trace; $PREPARSER ./input + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_200 +#AT_START_201 +at_fn_group_banner 201 'headers.at:60' \ + "Invalid CPP guards: %glr-parser --defines=9foo.h" "" 9 +at_xfail=no +( + $as_echo "201. $at_setup_line: testing $at_desc ..." + $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 +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%glr-parser +%{ +#include <9foo.h> +void yyerror (const char *msg); +int yylex (void); +%} +%% +dummy: /* empty */; +%% +#include <9foo.h> +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:60: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:60" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/headers.at:60: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:60" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:60" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:60" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:60" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:60" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:60" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/actions.at:1532: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1532" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:60: bison -fno-caret --defines=9foo.h --output=9foo.c 9foo.y" +at_fn_check_prepare_trace "headers.at:60" +( $at_check_trace; bison -fno-caret --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:1532" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } -# Don't be too picky on the traces, GLR is not exactly the same. Keep -# only the lines from the printer. -# -# Don't care about locations. FIXME: remove their removal when Bison -# supports C++ without locations. + { set +x -$as_echo "$at_srcdir/actions.at:1532: sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr" -at_fn_check_prepare_trace "actions.at:1532" -( $at_check_trace; sed -ne 's/([-0-9.]*: /(/;/ival:/p' stderr +$as_echo "$at_srcdir/headers.at:60: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:60" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) -Shifting token UNTYPED (ival: 10, fval: 0.1) -Reading a token: Next token is token INT (ival: 20, fval: 0.2) -Shifting token INT (ival: 20, fval: 0.2) - \$1 = token UNTYPED (ival: 10, fval: 0.1) - \$2 = token INT (ival: 20, fval: 0.2) --> \$\$ = nterm float (ival: 30, fval: 0.3) -Cleanup: popping nterm float (ival: 30, fval: 0.3) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1532" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/headers.at:60: \$CC \$CFLAGS \$CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " "headers.at:60" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:60" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -48438,68 +51150,57 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_177 -#AT_START_178 -at_fn_group_banner 178 'actions.at:1540' \ - "Fix user actions without a trailing semicolon" " " 9 +#AT_STOP_201 +#AT_START_202 +at_fn_group_banner 202 'headers.at:69' \ + "export YYLTYPE" " " 9 at_xfail=no ( - $as_echo "178. $at_setup_line: testing $at_desc ..." + $as_echo "202. $at_setup_line: testing $at_desc ..." $at_traceon -# This feature is undocumented, but we accidentally broke it in 2.3a, -# and there was a complaint at: -# . cat >input.y <<'_ATEOF' -%% -start: test2 test1 test0 testc; - -test2 -: 'a' { semi; /* TEST:N:2 */ } -| 'b' { if (0) {no_semi} /* TEST:N:2 */ } -| 'c' { if (0) {semi;} /* TEST:N:2 */ } -| 'd' { semi; no_semi /* TEST:Y:2 */ } -| 'e' { semi(); no_semi() /* TEST:Y:2 */ } -| 'f' { semi[]; no_semi[] /* TEST:Y:2 */ } -| 'g' { semi++; no_semi++ /* TEST:Y:2 */ } -| 'h' { {no_semi} no_semi /* TEST:Y:2 */ } -| 'i' { {semi;} no_semi /* TEST:Y:2 */ } -; -test1 - : 'a' { semi; // TEST:N:1 ; -} | 'b' { if (0) {no_semi} // TEST:N:1 ; -} | 'c' { if (0) {semi;} // TEST:N:1 ; -} | 'd' { semi; no_semi // TEST:Y:1 ; -} | 'e' { semi(); no_semi() // TEST:Y:1 ; -} | 'f' { semi[]; no_semi[] // TEST:Y:1 ; -} | 'g' { semi++; no_semi++ // TEST:Y:1 ; -} | 'h' { {no_semi} no_semi // TEST:Y:1 ; -} | 'i' { {semi;} no_semi // TEST:Y:1 ; -} ; -test0 - : 'a' { semi; // TEST:N:1 {} -} | 'b' { if (0) {no_semi} // TEST:N:1 {} -} | 'c' { if (0) {semi;} // TEST:N:1 {} -} | 'd' { semi; no_semi // TEST:Y:1 {} -} | 'e' { semi(); no_semi() // TEST:Y:1 {} -} | 'f' { semi[]; no_semi[] // TEST:Y:1 {} -} | 'g' { semi++; no_semi++ // TEST:Y:1 {} -} | 'h' { {no_semi} no_semi // TEST:Y:1 {} -} | 'i' { {semi;} no_semi // TEST:Y:1 {} -} ; +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%locations + +%name-prefix "my_" +%{ +#include +#include + -testc -: 'a' { -#define TEST_MACRO_N \ -[]"broken\" $ @ $$ @$ [];\ -string;"} -| 'b' { -no_semi -#define TEST_MACRO_N \ -[]"broken\" $ @ $$ @$ [];\ -string;"} + +/* A C error reporting function. */ +static +void my_error (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int my_lex (void) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +%} +%% +exp: /* empty */; _ATEOF @@ -48510,39 +51211,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1597" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/headers.at:87: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:87" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1597" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:87" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1597" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/headers.at:87: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines -o input.c input.y" "headers.at:87" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1597" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:87" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1597: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:87: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1597" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:87" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -48551,16 +51252,16 @@ at_status=$? at_failed=false $at_check_filter 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:1597" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:87" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1597: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:87: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1597" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:87" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -48569,7 +51270,7 @@ at_status=$? at_failed=false $at_check_filter 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:1597" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:87" $at_failed && at_fn_log_failure $at_traceon; } @@ -48577,331 +51278,222 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1597: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1597" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/headers.at:87: bison -fno-caret --defines -o input.c input.y" +at_fn_check_prepare_trace "headers.at:87" +( $at_check_trace; bison -fno-caret --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:8.48: warning: a ';' might be needed at the end of action code -input.y:8.48: future versions of Bison will not add the ';' -input.y:9.48: warning: a ';' might be needed at the end of action code -input.y:9.48: future versions of Bison will not add the ';' -input.y:10.48: warning: a ';' might be needed at the end of action code -input.y:10.48: future versions of Bison will not add the ';' -input.y:11.48: warning: a ';' might be needed at the end of action code -input.y:11.48: future versions of Bison will not add the ';' -input.y:12.48: warning: a ';' might be needed at the end of action code -input.y:12.48: future versions of Bison will not add the ';' -input.y:13.48: warning: a ';' might be needed at the end of action code -input.y:13.48: future versions of Bison will not add the ';' -input.y:20.1: warning: a ';' might be needed at the end of action code -input.y:20.1: future versions of Bison will not add the ';' -input.y:21.1: warning: a ';' might be needed at the end of action code -input.y:21.1: future versions of Bison will not add the ';' -input.y:22.1: warning: a ';' might be needed at the end of action code -input.y:22.1: future versions of Bison will not add the ';' -input.y:23.1: warning: a ';' might be needed at the end of action code -input.y:23.1: future versions of Bison will not add the ';' -input.y:24.1: warning: a ';' might be needed at the end of action code -input.y:24.1: future versions of Bison will not add the ';' -input.y:25.1: warning: a ';' might be needed at the end of action code -input.y:25.1: future versions of Bison will not add the ';' -input.y:31.1: warning: a ';' might be needed at the end of action code -input.y:31.1: future versions of Bison will not add the ';' -input.y:32.1: warning: a ';' might be needed at the end of action code -input.y:32.1: future versions of Bison will not add the ';' -input.y:33.1: warning: a ';' might be needed at the end of action code -input.y:33.1: future versions of Bison will not add the ';' -input.y:34.1: warning: a ';' might be needed at the end of action code -input.y:34.1: future versions of Bison will not add the ';' -input.y:35.1: warning: a ';' might be needed at the end of action code -input.y:35.1: future versions of Bison will not add the ';' -input.y:36.1: warning: a ';' might be needed at the end of action code -input.y:36.1: future versions of Bison will not add the ';' -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1597" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:87" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - - # To avoid expanding it repeatedly, store specified stdout. - : >expout - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "actions.at:1597" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1597" -$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; - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:8.48: warning: a ';' might be needed at the end of action code -input.y:8.48: future versions of Bison will not add the ';' -input.y:9.48: warning: a ';' might be needed at the end of action code -input.y:9.48: future versions of Bison will not add the ';' -input.y:10.48: warning: a ';' might be needed at the end of action code -input.y:10.48: future versions of Bison will not add the ';' -input.y:11.48: warning: a ';' might be needed at the end of action code -input.y:11.48: future versions of Bison will not add the ';' -input.y:12.48: warning: a ';' might be needed at the end of action code -input.y:12.48: future versions of Bison will not add the ';' -input.y:13.48: warning: a ';' might be needed at the end of action code -input.y:13.48: future versions of Bison will not add the ';' -input.y:20.1: warning: a ';' might be needed at the end of action code -input.y:20.1: future versions of Bison will not add the ';' -input.y:21.1: warning: a ';' might be needed at the end of action code -input.y:21.1: future versions of Bison will not add the ';' -input.y:22.1: warning: a ';' might be needed at the end of action code -input.y:22.1: future versions of Bison will not add the ';' -input.y:23.1: warning: a ';' might be needed at the end of action code -input.y:23.1: future versions of Bison will not add the ';' -input.y:24.1: warning: a ';' might be needed at the end of action code -input.y:24.1: future versions of Bison will not add the ';' -input.y:25.1: warning: a ';' might be needed at the end of action code -input.y:25.1: future versions of Bison will not add the ';' -input.y:31.1: warning: a ';' might be needed at the end of action code -input.y:31.1: future versions of Bison will not add the ';' -input.y:32.1: warning: a ';' might be needed at the end of action code -input.y:32.1: future versions of Bison will not add the ';' -input.y:33.1: warning: a ';' might be needed at the end of action code -input.y:33.1: future versions of Bison will not add the ';' -input.y:34.1: warning: a ';' might be needed at the end of action code -input.y:34.1: future versions of Bison will not add the ';' -input.y:35.1: warning: a ';' might be needed at the end of action code -input.y:35.1: future versions of Bison will not add the ';' -input.y:36.1: warning: a ';' might be needed at the end of action code -input.y:36.1: future versions of Bison will not add the ';' -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr +int my_parse (void); - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/actions.at:1597: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1597" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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 0 $at_status "$at_srcdir/actions.at:1597" -$at_failed && at_fn_log_failure -$at_traceon; } +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return my_parse (); +} +_ATEOF - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "actions.at:1597" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error +# 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:101: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:101" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1597" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:101" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "actions.at:1597" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror +{ set +x +$as_echo "$at_srcdir/headers.at:101: \$CC \$CFLAGS \$CPPFLAGS -c -o caller.o caller.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o caller.o caller.c " "headers.at:101" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o caller.o caller.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1597" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:101" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/actions.at:1597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "actions.at:1597" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror +{ set +x +$as_echo "$at_srcdir/headers.at:102: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:102" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1597" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:102" $at_failed && at_fn_log_failure $at_traceon; } - - at_restore_special_files -fi - { set +x -$as_echo "$at_srcdir/actions.at:1636: \$PERL -0777 -ne ' -my \$count = 0; -s{/\\* TEST:N:2 \\*/ \\}\$}{ ++\$count; \"\" }gem; -printf \"\$count\\n\";' input.c" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1636" -( $at_check_trace; $PERL -0777 -ne ' -my $count = 0; -s{/\* TEST:N:2 \*/ \}$}{ ++$count; "" }gem; -printf "$count\n";' input.c +$as_echo "$at_srcdir/headers.at:102: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:102" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "3 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1636" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:102" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1637: \$PERL -0777 -ne ' -my \$count = 0; -s{/\\* TEST:Y:2 \\*/ ;\\}\$}{ ++\$count; \"\" }gem; -printf \"\$count\\n\";' input.c" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1637" -( $at_check_trace; $PERL -0777 -ne ' -my $count = 0; -s{/\* TEST:Y:2 \*/ ;\}$}{ ++$count; "" }gem; -printf "$count\n";' input.c +$as_echo "$at_srcdir/headers.at:103: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:103" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "6 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1637" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:103" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1638: \$PERL -0777 -ne ' -my \$count = 0; -s{// TEST:N:1 [;{}]*\\n\\}\$}{ ++\$count; \"\" }gem; -printf \"\$count\\n\";' input.c" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1638" -( $at_check_trace; $PERL -0777 -ne ' -my $count = 0; -s{// TEST:N:1 [;{}]*\n\}$}{ ++$count; "" }gem; -printf "$count\n";' input.c +$as_echo "$at_srcdir/headers.at:103: \$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:103" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "6 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1638" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:103" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1639: \$PERL -0777 -ne ' -my \$count = 0; -s{// TEST:Y:1 [;{}]*\\n;\\}\$}{ ++\$count; \"\" }gem; -printf \"\$count\\n\";' input.c" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1639" -( $at_check_trace; $PERL -0777 -ne ' -my $count = 0; -s{// TEST:Y:1 [;{}]*\n;\}$}{ ++$count; "" }gem; -printf "$count\n";' input.c +$as_echo "$at_srcdir/headers.at:104: \$PREPARSER ./caller" +at_fn_check_prepare_dynamic " $PREPARSER ./caller" "headers.at:104" +( $at_check_trace; $PREPARSER ./caller ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "12 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1639" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:104" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1640: \$PERL -0777 -ne ' -my \$count = 0; -s{#define TEST_MACRO_N \\\\\\n\\[\\]\"broken\\\\\" \\\$ \\@ \\\$\\\$ \\@\\\$ \\[\\];\\\\\\nstring;\"\\}}{ ++\$count; \"\" }gem; -printf \"\$count\\n\";' input.c" -at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1640" -( $at_check_trace; $PERL -0777 -ne ' -my $count = 0; -s{#define TEST_MACRO_N \\\n\[\]"broken\\" \$ \@ \$\$ \@\$ \[\];\\\nstring;"\}}{ ++$count; "" }gem; -printf "$count\n";' input.c +$as_echo "$at_srcdir/headers.at:104: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "headers.at:104" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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/actions.at:1640" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:104" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_178 -#AT_START_179 -at_fn_group_banner 179 'actions.at:1649' \ - "Destroying lookahead assigned by semantic action" "" 9 +#AT_STOP_202 +#AT_START_203 +at_fn_group_banner 203 'headers.at:112' \ + "Several parsers" " " 9 at_xfail=no ( - $as_echo "179. $at_setup_line: testing $at_desc ..." + $as_echo "203. $at_setup_line: testing $at_desc ..." $at_traceon +# AT_TEST([PREFIX], [DIRECTIVES]) +# ------------------------------- +# Generate and compile to *.o. Make sure there is no (allowed) YY* +# nor yy* identifiers in the header. Check that headers are +# self-contained, and can be compiled by a C++ compiler. +# AT_TEST -cat >input.y <<'_ATEOF' +cat >main.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +// If we are compiling with CC=$CXX, then do not load the C headers +// inside extern "C", since they were _not_ compiled this way. +#if ! CC_IS_CXX +extern "C" +{ +#endif + #include "x1.h" + #include "x2.h" + #include "x3.h" + #include "x4.h" + #include "x6.h" + #include "x7.h" + #include "x8.h" +#if ! CC_IS_CXX +} +#endif +#include "x5.hh" +//#include "x6.hh" + +#define RUN(S) \ + do { \ + int res = S; \ + if (res) \ + std::cerr << #S": " << res << '\n'; \ + } while (false) + +int +main (void) +{ + RUN(x1_parse()); + RUN(x2_parse()); + RUN(x3_parse()); + RUN(x4_parse()); + x5_::parser p5; + RUN(p5.parse()); + RUN(x6_parse()); + RUN(x7_parse()); + RUN(x8_parse()); +// x6_::parser p6; +// RUN(p6.parse()); + return 0; +} +_ATEOF +# main.cc + + +cat >x1.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -48910,51 +51502,46 @@ cat >input.y <<'_ATEOF' #undef realloc } +%define api.prefix {x1_} -%code { - #include - #include -static void yyerror ( const char *msg); -static int yylex (void); - #define USE(Var) +%error-verbose +%union +{ + int integer; } +%{ +#include + #include -%destructor { fprintf (stderr, "'a' destructor\n"); } 'a' -%destructor { fprintf (stderr, "'b' destructor\n"); } 'b' +static void x1_error (const char *msg); + static int x1_lex (void); +%} +%% +exp: + 'x' '1' { printf ("x1\n"); } +| 'x' '2' { printf ("x2\n"); } +| 'x' '3' { printf ("x3\n"); } +| 'x' '4' { printf ("x4\n"); } +| 'x' '5' { printf ("x5\n"); } +| 'x' '6' { printf ("x6\n"); } +| 'x' '7' { printf ("x7\n"); } +| 'x' '8' { printf ("x8\n"); } +; %% -// In a previous version of Bison, yychar assigned by the semantic -// action below was not translated into yytoken before the lookahead was -// discarded and thus before its destructor (selected according to -// yytoken) was called in order to return from yyparse. This would -// happen even if YYACCEPT was performed in a later semantic action as -// long as only consistent states with default reductions were visited -// in between. However, we leave YYACCEPT in the same semantic action -// for this test in order to show that skeletons cannot simply translate -// immediately after every semantic action because a semantic action -// that has set yychar might not always return normally. Instead, -// skeletons must translate before every use of yytoken. -start: 'a' accept { USE($1); } ; -accept: /*empty*/ { - assert (yychar == YYEMPTY); - yychar = 'b'; - YYACCEPT; -} ; -%% -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void x1_error (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static -int yylex (void) +int x1_lex (void) { - static char const input[] = "a"; + static char const input[] = "x1"; static size_t toknum = 0; int res; ; @@ -48963,11 +51550,6 @@ int yylex (void) ; return res; } -int -main (void) -{ - return yyparse (); -} _ATEOF @@ -48978,39 +51560,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1695: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1695" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/headers.at:205: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -d -o x1.c x1.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:205" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -d -o x1.c x1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1695" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:205" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1695: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1695" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/headers.at:205: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y" "headers.at:205" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1695" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:205" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1695: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:205: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1695" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:205" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -49019,16 +51601,16 @@ at_status=$? at_failed=false $at_check_filter 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:1695" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:205" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1695: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:205: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1695" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:205" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -49037,7 +51619,7 @@ at_status=$? at_failed=false $at_check_filter 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:1695" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:205" $at_failed && at_fn_log_failure $at_traceon; } @@ -49045,93 +51627,64 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1695: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1695" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/headers.at:205: bison -fno-caret -d -o x1.c x1.y" +at_fn_check_prepare_trace "headers.at:205" +( $at_check_trace; bison -fno-caret -d -o x1.c x1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1695" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:205" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/actions.at:1696: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1696" +$as_echo "$at_srcdir/headers.at:205: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:205" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1696" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:205" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1696: \$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:1696" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/headers.at:205: \$CC \$CFLAGS \$CPPFLAGS -c -o x1.o x1.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x1.o x1.c " "headers.at:205" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x1.o x1.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1696" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/actions.at:1697: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1697" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1697" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:205" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1697: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1697" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:205: echo \"x1\" >>expout" +at_fn_check_prepare_trace "headers.at:205" +( $at_check_trace; echo "x1" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "'b' destructor -'a' destructor -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1697" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:205" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_179 -#AT_START_180 -at_fn_group_banner 180 'actions.at:1708' \ - "YYBACKUP" " " 9 -at_xfail=no -( - $as_echo "180. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' +cat >x2.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -49140,101 +51693,137 @@ cat >input.y <<'_ATEOF' #undef realloc } - +%define api.prefix {x2_} +%locations %debug %error-verbose -%debug -%pure-parser -%code { -# include -# include -# include - - static void yyerror ( const char *msg); - static int yylex (YYSTYPE *lvalp); +%union +{ + int integer; } -%% -input: - exp exp {} -; +%{ +#include + #include + +#if defined X2_LTYPE_IS_TRIVIAL && X2_LTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, X2_LTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void x2_error (const char *msg); + static int x2_lex (void); +%} +%% exp: - 'a' { printf ("a: %d\n", $1); } -| 'b' { YYBACKUP('a', 123); } -| 'c' 'd' { YYBACKUP('a', 456); } + 'x' '1' { printf ("x1\n"); } +| 'x' '2' { printf ("x2\n"); } +| 'x' '3' { printf ("x3\n"); } +| 'x' '4' { printf ("x4\n"); } +| 'x' '5' { printf ("x5\n"); } +| 'x' '6' { printf ("x6\n"); } +| 'x' '7' { printf ("x7\n"); } +| 'x' '8' { printf ("x8\n"); } ; %% -#include + + +# if defined X2_LTYPE_IS_TRIVIAL && X2_LTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, X2_LTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void x2_error (const char *msg) { + LOCATION_PRINT (stderr, (x2_lloc)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static -int yylex (YYSTYPE *lvalp) +int x2_lex (void) { - static char const input[] = "bcd"; + static char const input[] = "x2"; static size_t toknum = 0; int res; - (void) lvalp;; + ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; - *lvalp = (toknum + 1) * 10; + ; + (x2_lloc).first_line = (x2_lloc).last_line = 1; + (x2_lloc).first_column = (x2_lloc).last_column = toknum; return res; } - -int -main (void) -{ - yydebug = !!getenv("YYDEBUG"); - return yyparse (); -} _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1749: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1749" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/headers.at:206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -d -o x2.c x2.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:206" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -d -o x2.c x2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1749" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:206" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1749: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1749" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/headers.at:206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y" "headers.at:206" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1749" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:206" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/actions.at:1749: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:206: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1749" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:206" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -49243,16 +51832,16 @@ at_status=$? at_failed=false $at_check_filter 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:1749" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:206" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/actions.at:1749: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:206: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1749" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:206" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -49261,7 +51850,7 @@ at_status=$? at_failed=false $at_check_filter 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:1749" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:206" $at_failed && at_fn_log_failure $at_traceon; } @@ -49269,137 +51858,163 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/actions.at:1749: bison -o input.c input.y" -at_fn_check_prepare_trace "actions.at:1749" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/headers.at:206: bison -fno-caret -d -o x2.c x2.y" +at_fn_check_prepare_trace "headers.at:206" +( $at_check_trace; bison -fno-caret -d -o x2.c x2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1749" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:206" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/actions.at:1750: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1750" +$as_echo "$at_srcdir/headers.at:206: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:206" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1750" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:206" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1750: \$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:1750" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/headers.at:206: \$CC \$CFLAGS \$CPPFLAGS -c -o x2.o x2.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x2.o x2.c " "headers.at:206" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x2.o x2.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1750" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/actions.at:1751: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1751" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "a: 123 -a: 456 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1751" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:206" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/actions.at:1751: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "actions.at:1751" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:206: echo \"x2\" >>expout" +at_fn_check_prepare_trace "headers.at:206" +( $at_check_trace; echo "x2" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1751" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:206" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_180 -#AT_START_181 -at_fn_group_banner 181 'conflicts.at:31' \ - "S/R in initial" " " 10 -at_xfail=no -( - $as_echo "181. $at_setup_line: testing $at_desc ..." - $at_traceon -cat >input.y <<'_ATEOF' -%expect 1 +cat >x3.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%define api.prefix {x3_} +%glr-parser +%error-verbose +%union +{ + int integer; +} +%{ +#include + #include + +static void x3_error (const char *msg); + static int x3_lex (void); +%} %% -exp: e 'e'; -e: 'e' | /* Nothing. */; +exp: + 'x' '1' { printf ("x1\n"); } +| 'x' '2' { printf ("x2\n"); } +| 'x' '3' { printf ("x3\n"); } +| 'x' '4' { printf ("x4\n"); } +| 'x' '5' { printf ("x5\n"); } +| 'x' '6' { printf ("x6\n"); } +| 'x' '7' { printf ("x7\n"); } +| 'x' '8' { printf ("x8\n"); } +; + +%% + + +/* A C error reporting function. */ +static +void x3_error (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int x3_lex (void) +{ + static char const input[] = "x3"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/headers.at:207: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -d -o x3.c x3.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:207" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -d -o x3.c x3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/headers.at:207" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:40" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/headers.at:207: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y" "headers.at:207" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/headers.at:207" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:40: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:207: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:207" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -49408,16 +52023,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/headers.at:207" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:40: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:207: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:40" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:207" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -49426,7 +52041,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/headers.at:207" $at_failed && at_fn_log_failure $at_traceon; } @@ -49434,138 +52049,163 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/headers.at:207: bison -fno-caret -d -o x3.c x3.y" +at_fn_check_prepare_trace "headers.at:207" +( $at_check_trace; bison -fno-caret -d -o x3.c x3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:207" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - # To avoid expanding it repeatedly, store specified stdout. - : >expout - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "conflicts.at:40" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror +{ set +x +$as_echo "$at_srcdir/headers.at:207: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:207" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:40" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:207" $at_failed && at_fn_log_failure $at_traceon; } - - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */ -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/conflicts.at:40: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:40" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 +{ set +x +$as_echo "$at_srcdir/headers.at:207: \$CC \$CFLAGS \$CPPFLAGS -c -o x3.o x3.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x3.o x3.c " "headers.at:207" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x3.o x3.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 0 $at_status "$at_srcdir/conflicts.at:40" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:207" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "conflicts.at:40" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error +{ set +x +$as_echo "$at_srcdir/headers.at:207: echo \"x3\" >>expout" +at_fn_check_prepare_trace "headers.at:207" +( $at_check_trace; echo "x3" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:40" +at_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:207" $at_failed && at_fn_log_failure $at_traceon; } - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "conflicts.at:40" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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; } - { set +x -$as_echo "$at_srcdir/conflicts.at:40: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "conflicts.at:40" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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; } - at_restore_special_files -fi +cat >x4.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%define api.prefix {x4_} +%locations %debug %glr-parser +%error-verbose +%union +{ + int integer; +} +%{ +#include + #include + +#if defined X4_LTYPE_IS_TRIVIAL && X4_LTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, X4_LTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void x4_error (const char *msg); + static int x4_lex (void); +%} +%% +exp: + 'x' '1' { printf ("x1\n"); } +| 'x' '2' { printf ("x2\n"); } +| 'x' '3' { printf ("x3\n"); } +| 'x' '4' { printf ("x4\n"); } +| 'x' '5' { printf ("x5\n"); } +| 'x' '6' { printf ("x6\n"); } +| 'x' '7' { printf ("x7\n"); } +| 'x' '8' { printf ("x8\n"); } +; + +%% + + +# if defined X4_LTYPE_IS_TRIVIAL && X4_LTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, X4_LTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void x4_error (const char *msg) +{ + LOCATION_PRINT (stderr, (x4_lloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} +#include +static +int x4_lex (void) +{ + static char const input[] = "x4"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (x4_lloc).first_line = (x4_lloc).last_line = 1; + (x4_lloc).first_column = (x4_lloc).last_column = toknum; + return res; +} +_ATEOF + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files @@ -49573,39 +52213,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -fcaret -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:44" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -fcaret -o input.c input.y +$as_echo "$at_srcdir/headers.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -d -o x4.c x4.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:208" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -d -o x4.c x4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:44" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:208" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "conflicts.at:44" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y +$as_echo "$at_srcdir/headers.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y" "headers.at:208" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:44" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:208" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:44: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:208: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:44" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:208" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -49614,16 +52254,16 @@ at_status=$? at_failed=false $at_check_filter 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:44" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:208" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:44: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:208: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:44" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:208" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -49632,7 +52272,7 @@ at_status=$? at_failed=false $at_check_filter 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:44" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:208" $at_failed && at_fn_log_failure $at_traceon; } @@ -49640,159 +52280,64 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:44: bison -fcaret -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:44" -( $at_check_trace; bison -fcaret -o input.c input.y +$as_echo "$at_srcdir/headers.at:208: bison -fno-caret -d -o x4.c x4.y" +at_fn_check_prepare_trace "headers.at:208" +( $at_check_trace; bison -fno-caret -d -o x4.c x4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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: 'e' | /* Nothing. */; - ^ -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:44" -$at_failed && at_fn_log_failure -$at_traceon; } - -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - - # To avoid expanding it repeatedly, store specified stdout. - : >expout - - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "conflicts.at:44" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:44" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:208" $at_failed && at_fn_log_failure $at_traceon; } - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:4.9: warning: rule useless in parser due to conflicts - e: 'e' | /* Nothing. */; - ^ -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/conflicts.at:44: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:44" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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 0 $at_status "$at_srcdir/conflicts.at:44" -$at_failed && at_fn_log_failure -$at_traceon; } - - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "conflicts.at:44" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error +{ set +x +$as_echo "$at_srcdir/headers.at:208: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:208" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:44" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:208" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "conflicts.at:44" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror +{ set +x +$as_echo "$at_srcdir/headers.at:208: \$CC \$CFLAGS \$CPPFLAGS -c -o x4.o x4.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x4.o x4.c " "headers.at:208" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x4.o x4.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:44" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:208" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:44: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "conflicts.at:44" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror +{ set +x +$as_echo "$at_srcdir/headers.at:208: echo \"x4\" >>expout" +at_fn_check_prepare_trace "headers.at:208" +( $at_check_trace; echo "x4" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:44" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:208" $at_failed && at_fn_log_failure $at_traceon; } - at_restore_special_files -fi - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_181 -#AT_START_182 -at_fn_group_banner 182 'conflicts.at:57' \ - "%nonassoc and eof" " " 10 -at_xfail=no -( - $as_echo "182. $at_setup_line: testing $at_desc ..." - $at_traceon -cat >input.y <<'_ATEOF' +cat >x5.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -49801,95 +52346,95 @@ cat >input.y <<'_ATEOF' #undef realloc } - -%{ -#include -#include -#include -#include - -#define YYERROR_VERBOSE 1 -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -/* The current argument. */ -static const char *input; - -static int -yylex (void) +%define api.prefix {x5_} +%locations %debug %language "c++" +%error-verbose +%union { - static size_t toknum; - assert (toknum <= strlen (input)); - return input[toknum++]; + int integer; } +%{ +#include + static int x5_lex (x5_::parser::semantic_type *lvalp, x5_::parser::location_type *llocp); %} - -%nonassoc '<' '>' - %% -expr: expr '<' expr - | expr '>' expr - | '0' - ; +exp: + 'x' '1' { printf ("x1\n"); } +| 'x' '2' { printf ("x2\n"); } +| 'x' '3' { printf ("x3\n"); } +| 'x' '4' { printf ("x4\n"); } +| 'x' '5' { printf ("x5\n"); } +| 'x' '6' { printf ("x6\n"); } +| 'x' '7' { printf ("x7\n"); } +| 'x' '8' { printf ("x8\n"); } +; + %% -int -main (int argc, const char *argv[]) +/* A C++ error reporting function. */ +void +x5_::parser::error (const location_type& l, const std::string& m) { - input = argc <= 1 ? "" : argv[1]; - return yyparse (); + std::cerr << l << ": " << m << '\n'; +} +#include +static +int x5_lex (x5_::parser::semantic_type *lvalp, x5_::parser::location_type *llocp) +{ + static char const input[] = "x5"; + static size_t toknum = 0; + int res; + (void) lvalp;(void) llocp; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (*llocp).begin.line = (*llocp).end.line = 1; + (*llocp).begin.column = (*llocp).end.column = toknum; + return res; } _ATEOF - - - -# Expected token list is missing. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:123" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/headers.at:209: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -d -o x5.cc x5.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:209" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -d -o x5.cc x5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:123" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:209" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:123: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:123" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/headers.at:209: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y" "headers.at:209" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:123" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:209" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:123: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.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' "conflicts.at:123" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.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 @@ -49898,16 +52443,16 @@ at_status=$? at_failed=false $at_check_filter 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:123" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:209" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:123: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:123" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.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 | sort @@ -49916,7 +52461,7 @@ at_status=$? at_failed=false $at_check_filter 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:123" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:209" $at_failed && at_fn_log_failure $at_traceon; } @@ -49924,235 +52469,164 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:123: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:123" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/headers.at:209: bison -fno-caret -d -o x5.cc x5.y" +at_fn_check_prepare_trace "headers.at:209" +( $at_check_trace; bison -fno-caret -d -o x5.cc x5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:123" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:209" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/conflicts.at:123: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:123" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/headers.at:209: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:209" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:123" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:209" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:123: \$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:123" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/headers.at:209: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o x5.o x5.cc " +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o x5.o x5.cc " "headers.at:209" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o x5.o x5.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:123" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0<0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:123" -( $at_check_trace; $PREPARSER ./input '0<0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:209" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:123" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:209: echo \"x5\" >>expout" +at_fn_check_prepare_trace "headers.at:209" +( $at_check_trace; echo "x5" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:123" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:209" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0<0<0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:123" -( $at_check_trace; $PREPARSER ./input '0<0<0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:123" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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 0 $at_status "$at_srcdir/conflicts.at:123" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:123" -( $at_check_trace; $PREPARSER ./input '0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:123" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:123" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:123" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0>0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:123" -( $at_check_trace; $PREPARSER ./input '0>0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:123" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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 0 $at_status "$at_srcdir/conflicts.at:123" -$at_failed && at_fn_log_failure -$at_traceon; } +cat >x6.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%define api.prefix {x6_} +%define api.pure +%error-verbose +%union +{ + int integer; +} +%{ +#include + #include -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: \$PREPARSER ./input '0<0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:123" -( $at_check_trace; $PREPARSER ./input '0<0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:123" -$at_failed && at_fn_log_failure -$at_traceon; } +static void x6_error (const char *msg); + static int x6_lex (X6_STYPE *lvalp); +%} +%% +exp: + 'x' '1' { printf ("x1\n"); } +| 'x' '2' { printf ("x2\n"); } +| 'x' '3' { printf ("x3\n"); } +| 'x' '4' { printf ("x4\n"); } +| 'x' '5' { printf ("x5\n"); } +| 'x' '6' { printf ("x6\n"); } +| 'x' '7' { printf ("x7\n"); } +| 'x' '8' { printf ("x8\n"); } +; -{ set +x -$as_echo "$at_srcdir/conflicts.at:123: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:123" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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 0 $at_status "$at_srcdir/conflicts.at:123" -$at_failed && at_fn_log_failure -$at_traceon; } +%% +/* A C error reporting function. */ +static +void x6_error (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int x6_lex (X6_STYPE *lvalp) +{ + static char const input[] = "x6"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +_ATEOF -# We must disable default reductions in inconsistent states in order to -# have an explicit list of all expected tokens. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:127: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dlr.default-reductions=consistent -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:127" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dlr.default-reductions=consistent -o input.c input.y +$as_echo "$at_srcdir/headers.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -d -o x6.c x6.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:210" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -d -o x6.c x6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:127" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:210" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:127: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y" "conflicts.at:127" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.default-reductions=consistent -o input.c input.y +$as_echo "$at_srcdir/headers.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y" "headers.at:210" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:127" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:210" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:127: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.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' "conflicts.at:127" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.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 @@ -50161,16 +52635,16 @@ at_status=$? at_failed=false $at_check_filter 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:127" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:210" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:127: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:127" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.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 | sort @@ -50179,7 +52653,7 @@ at_status=$? at_failed=false $at_check_filter 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:127" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:210" $at_failed && at_fn_log_failure $at_traceon; } @@ -50187,239 +52661,163 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:127: bison -Dlr.default-reductions=consistent -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:127" -( $at_check_trace; bison -Dlr.default-reductions=consistent -o input.c input.y +$as_echo "$at_srcdir/headers.at:210: bison -fno-caret -d -o x6.c x6.y" +at_fn_check_prepare_trace "headers.at:210" +( $at_check_trace; bison -fno-caret -d -o x6.c x6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:127" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:210" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/conflicts.at:127: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:127" +$as_echo "$at_srcdir/headers.at:210: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:210" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:127" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:210" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:127: \$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:127" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/headers.at:210: \$CC \$CFLAGS \$CPPFLAGS -c -o x6.o x6.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x6.o x6.c " "headers.at:210" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x6.o x6.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:127" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0<0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:127" -( $at_check_trace; $PREPARSER ./input '0<0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:210" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:127" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:210: echo \"x6\" >>expout" +at_fn_check_prepare_trace "headers.at:210" +( $at_check_trace; echo "x6" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:127" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0<0<0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:127" -( $at_check_trace; $PREPARSER ./input '0<0<0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:210" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:127" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end -" | \ - $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:127" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:127" -( $at_check_trace; $PREPARSER ./input '0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:127" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:127" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:127" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0>0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:127" -( $at_check_trace; $PREPARSER ./input '0>0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:127" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end -" | \ - $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:127" -$at_failed && at_fn_log_failure -$at_traceon; } +cat >x7.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%define api.prefix {x7_} +%define api.push-pull both +%error-verbose +%union +{ + int integer; +} +%{ +#include + #include -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: \$PREPARSER ./input '0<0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:127" -( $at_check_trace; $PREPARSER ./input '0<0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:127" -$at_failed && at_fn_log_failure -$at_traceon; } +static void x7_error (const char *msg); + static int x7_lex (void); +%} +%% +exp: + 'x' '1' { printf ("x1\n"); } +| 'x' '2' { printf ("x2\n"); } +| 'x' '3' { printf ("x3\n"); } +| 'x' '4' { printf ("x4\n"); } +| 'x' '5' { printf ("x5\n"); } +| 'x' '6' { printf ("x6\n"); } +| 'x' '7' { printf ("x7\n"); } +| 'x' '8' { printf ("x8\n"); } +; -{ set +x -$as_echo "$at_srcdir/conflicts.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:127" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end -" | \ - $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:127" -$at_failed && at_fn_log_failure -$at_traceon; } +%% +/* A C error reporting function. */ +static +void x7_error (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int x7_lex (void) +{ + static char const input[] = "x7"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +_ATEOF -# lr.default-reductions=consistent happens to work for this test case. -# However, for other grammars, lookahead sets can be merged for -# different left contexts, so it is still possible to have an incorrect -# expected list. Canonical LR is almost a general solution (that is, it -# can fail only when %nonassoc is used), so make sure it gives the same -# result as above. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:136" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y +$as_echo "$at_srcdir/headers.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -d -o x7.c x7.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:211" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -d -o x7.c x7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/headers.at:211" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:136: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:136" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y +$as_echo "$at_srcdir/headers.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y" "headers.at:211" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/headers.at:211" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:136: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:211: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:211" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -50428,16 +52826,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/headers.at:211" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:136: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:211: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:136" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:211" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -50446,7 +52844,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/headers.at:211" $at_failed && at_fn_log_failure $at_traceon; } @@ -50454,238 +52852,163 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:136: bison -Dlr.type=canonical-lr -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:136" -( $at_check_trace; bison -Dlr.type=canonical-lr -o input.c input.y +$as_echo "$at_srcdir/headers.at:211: bison -fno-caret -d -o x7.c x7.y" +at_fn_check_prepare_trace "headers.at:211" +( $at_check_trace; bison -fno-caret -d -o x7.c x7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:136" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:211" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/conflicts.at:136: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:136" +$as_echo "$at_srcdir/headers.at:211: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:211" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/headers.at:211" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:136: \$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:136" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/headers.at:211: \$CC \$CFLAGS \$CPPFLAGS -c -o x7.o x7.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x7.o x7.c " "headers.at:211" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x7.o x7.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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: \$PREPARSER ./input '0<0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:136" -( $at_check_trace; $PREPARSER ./input '0<0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:211" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:136" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:211: echo \"x7\" >>expout" +at_fn_check_prepare_trace "headers.at:211" +( $at_check_trace; echo "x7" >>expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:136" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0<0<0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:136" -( $at_check_trace; $PREPARSER ./input '0<0<0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:136" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end -" | \ - $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; } - - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:136" -( $at_check_trace; $PREPARSER ./input '0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:211" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:136" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:136" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0>0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:136" -( $at_check_trace; $PREPARSER ./input '0>0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:136" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end -" | \ - $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; } +cat >x8.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%define api.prefix {x8_} +%define api.pure %define api.push-pull both +%error-verbose +%union +{ + int integer; +} +%{ +#include + #include -{ set +x -$as_echo "$at_srcdir/conflicts.at:136: \$PREPARSER ./input '0<0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:136" -( $at_check_trace; $PREPARSER ./input '0<0>0' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:136" -$at_failed && at_fn_log_failure -$at_traceon; } +static void x8_error (const char *msg); + static int x8_lex (X8_STYPE *lvalp); +%} +%% +exp: + 'x' '1' { printf ("x1\n"); } +| 'x' '2' { printf ("x2\n"); } +| 'x' '3' { printf ("x3\n"); } +| 'x' '4' { printf ("x4\n"); } +| 'x' '5' { printf ("x5\n"); } +| 'x' '6' { printf ("x6\n"); } +| 'x' '7' { printf ("x7\n"); } +| 'x' '8' { printf ("x8\n"); } +; -{ set +x -$as_echo "$at_srcdir/conflicts.at:136: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:136" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end -" | \ - $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; } +%% +/* A C error reporting function. */ +static +void x8_error (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int x8_lex (X8_STYPE *lvalp) +{ + static char const input[] = "x8"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +_ATEOF -# parse.lac=full is a completely general solution that does not require -# any of the above sacrifices. Of course, it does not extend the -# language-recognition power of LALR to (IE)LR, but it does ensure that -# the reported list of expected tokens matches what the given parser -# would have accepted in place of the unexpected token. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:143: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dparse.lac=full -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:143" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dparse.lac=full -o input.c input.y +$as_echo "$at_srcdir/headers.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -d -o x8.c x8.y" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:212" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -d -o x8.c x8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:212" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:143: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" "conflicts.at:143" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y +$as_echo "$at_srcdir/headers.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y" "headers.at:212" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:212" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:212: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:143" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:212" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -50694,16 +53017,16 @@ at_status=$? at_failed=false $at_check_filter 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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:212" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$XSLTPROC \\ +$as_echo "$at_srcdir/headers.at:212: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:143" +at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:212" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -50712,7 +53035,7 @@ at_status=$? at_failed=false $at_check_filter 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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:212" $at_failed && at_fn_log_failure $at_traceon; } @@ -50720,187 +53043,353 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:143: bison -Dparse.lac=full -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:143" -( $at_check_trace; bison -Dparse.lac=full -o input.c input.y +$as_echo "$at_srcdir/headers.at:212: bison -fno-caret -d -o x8.c x8.y" +at_fn_check_prepare_trace "headers.at:212" +( $at_check_trace; bison -fno-caret -d -o x8.c x8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:212" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:143" +$as_echo "$at_srcdir/headers.at:212: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:212" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:212" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$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:143" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/headers.at:212: \$CC \$CFLAGS \$CPPFLAGS -c -o x8.o x8.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x8.o x8.c " "headers.at:212" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x8.o x8.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:212" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/headers.at:212: echo \"x8\" >>expout" +at_fn_check_prepare_trace "headers.at:212" +( $at_check_trace; echo "x8" >>expout +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:212" $at_failed && at_fn_log_failure $at_traceon; } +#AT_TEST([x5], [%locations %language "c++" %glr-parser]) + +# Check there is no 'yy' left. +# C++ output relies on namespaces and still uses yy a lot. +# +# Check there is no 'YY' left. +# Ignore comments, YYChar (template parameter), YYPUSH_MORE(_DEFINED)? +# (constant definition), YY_\w+_INCLUDED (header guards). +# YYDEBUG (not renamed) can be read, but not changed. { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0<0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:143" -( $at_check_trace; $PREPARSER ./input '0<0' +$as_echo "$at_srcdir/headers.at:246: \$PERL -n -0777 -e ' + s{/\\*.*?\\*/}{}gs; + s{//.*}{}g; + s{\\b(YYChar + |YYPUSH_MORE(?:_DEFINED)? + |YYUSE + |YY_ATTRIBUTE(?:_PURE|_UNUSED)? + |YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END) + |YY_INITIAL_VALUE + |YY_\\w+_INCLUDED + |YY_NULLPTR + |(defined|if)\\ YYDEBUG + )\\b}{}gx; + while (/^(.*YY.*)\$/gm) + { + print \"\$ARGV: invalid exported YY: \$1\\n\"; + } + if (\$ARGV =~ /\\.h\$/) + { + while (/^(.*yy.*)\$/gm) + { + print \"\$ARGV: invalid exported yy: \$1\\n\"; + } + } +' -- *.hh *.h" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:246" +( $at_check_trace; $PERL -n -0777 -e ' + s{/\*.*?\*/}{}gs; + s{//.*}{}g; + s{\b(YYChar + |YYPUSH_MORE(?:_DEFINED)? + |YYUSE + |YY_ATTRIBUTE(?:_PURE|_UNUSED)? + |YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END) + |YY_INITIAL_VALUE + |YY_\w+_INCLUDED + |YY_NULLPTR + |(defined|if)\ YYDEBUG + )\b}{}gx; + while (/^(.*YY.*)$/gm) + { + print "$ARGV: invalid exported YY: $1\n"; + } + if ($ARGV =~ /\.h$/) + { + while (/^(.*yy.*)$/gm) + { + print "$ARGV: invalid exported yy: $1\n"; + } + } +' -- *.hh *.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:246" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check that the headers are self-contained, and protected against +# multiple inclusions. While at it, check they are sane for C++. +for h in *.h *.hh +do + # No shell expansion with AT_DATA. + cat >$h.cc < +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "$h" +#include "$h" +EOF + +{ set +x +$as_echo "$at_srcdir/headers.at:258: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:258" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:258" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:143" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:258: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o \$h.o \$h.cc " +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o $h.o $h.cc " "headers.at:258" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o $h.o $h.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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:143" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:258" $at_failed && at_fn_log_failure $at_traceon; } +done + +# Do this late, so that other checks have been performed. +cat >c-and-cxx.h <<'_ATEOF' +#ifdef __cplusplus +extern "C" +{ +#endif + int fortytwo (void); +#ifdef __cplusplus +} +#endif +_ATEOF + +cat >c-only.c <<'_ATEOF' +#include "c-and-cxx.h" +int +main (void) +{ + return fortytwo () == 42 ? 0 : 1; +} +_ATEOF + +cat >cxx-only.cc <<'_ATEOF' +#include "c-and-cxx.h" +int fortytwo () +{ + return 42; +} +_ATEOF { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0<0<0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:143" -( $at_check_trace; $PREPARSER ./input '0<0<0' +$as_echo "$at_srcdir/headers.at:262: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:262" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:262" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:143" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:262: \$CC \$CFLAGS \$CPPFLAGS -c -o c-only.o c-only.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o c-only.o c-only.c " "headers.at:262" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o c-only.o c-only.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting \$end -" | \ - $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:143" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:262" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/headers.at:262: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:262" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:262" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:143" -( $at_check_trace; $PREPARSER ./input '0>0' +$as_echo "$at_srcdir/headers.at:262: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx-only.o cxx-only.cc " +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx-only.o cxx-only.cc " "headers.at:262" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx-only.o cxx-only.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:143" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:262" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:143" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/headers.at:262: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS c-only.o cxx-only.o -o c-and-cxx || + exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "headers.at:262" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS c-only.o cxx-only.o -o c-and-cxx || + exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:143" +echo stdout:; cat "$at_stdout" +at_fn_check_skip $at_status "$at_srcdir/headers.at:262" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0>0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:143" -( $at_check_trace; $PREPARSER ./input '0>0>0' +$as_echo "$at_srcdir/headers.at:262: \$PREPARSER ./c-and-cxx" +at_fn_check_prepare_dynamic " $PREPARSER ./c-and-cxx" "headers.at:262" +( $at_check_trace; $PREPARSER ./c-and-cxx ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:262" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:143" +$as_echo "$at_srcdir/headers.at:262: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "headers.at:262" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:262" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/conflicts.at:143: \$PREPARSER ./input '0<0>0'" -at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:143" -( $at_check_trace; $PREPARSER ./input '0<0>0' +$as_echo "$at_srcdir/headers.at:264: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:264" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:264" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/headers.at:264: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=\$CC_IS_CXX main.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS" "headers.at:264" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:264" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/headers.at:265: \$PREPARSER ./parser" +at_fn_check_prepare_dynamic " $PREPARSER ./parser" "headers.at:265" +( $at_check_trace; $PREPARSER ./parser ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:143" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:265" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:143" +$as_echo "$at_srcdir/headers.at:265: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "headers.at:265" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting \$end -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:143" +at_fn_check_status 0 $at_status "$at_srcdir/headers.at:265" $at_failed && at_fn_log_failure $at_traceon; } @@ -50908,41 +53397,24 @@ $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_182 -#AT_START_183 -at_fn_group_banner 183 'conflicts.at:155' \ - "%error-verbose and consistent errors" " " 10 +#AT_STOP_203 +#AT_START_204 +at_fn_group_banner 204 'actions.at:24' \ + "Mid-rule actions" " " 10 at_xfail=no ( - $as_echo "183. $at_setup_line: testing $at_desc ..." + $as_echo "204. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - -# Unfortunately, no expected tokens are reported even though 'b' can be -# accepted. Nevertheless, the main point of this test is to make sure -# that at least the unexpected token is reported. In a previous version -# of Bison, it wasn't reported because the error is detected in a -# consistent state with an error action, and that case always triggered -# the simple "syntax error" message. -# -# The point isn't to test IELR here, but state merging happens to -# complicate this example. - - - - +# 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' @@ -50954,115 +53426,102 @@ cat >input.y <<'_ATEOF' #undef realloc } - - +%define parse.error verbose +%debug %code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.type ielr - -%error-verbose +#include +static void yyerror (const char *msg); +static int yylex (void); +} %% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - +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'); } + ; %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) -{ - static char const *input = "a"; - *lvalp = 1; - return *input++; -} -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } - - -/*-------. -| main. | -`-------*/ - +#include +static +int yylex (void) +{ + static char const input[] = "123456789"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) { + (void) argc; + (void) argv; return yyparse (); } _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:299" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:59" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:299" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:59" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:299: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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' "conflicts.at:299" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 @@ -51071,16 +53530,16 @@ at_status=$? at_failed=false $at_check_filter 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:299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:299: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:299" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 | sort @@ -51089,7 +53548,7 @@ at_status=$? at_failed=false $at_check_filter 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:299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } @@ -51097,91 +53556,90 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:299: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:299" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:59: bison -fno-caret -d -v -o input.c input.y" +at_fn_check_prepare_trace "actions.at:59" +( $at_check_trace; bison -fno-caret -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:299: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:299" +{ set +x +$as_echo "$at_srcdir/actions.at:60: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:60" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:60" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:299: \$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:299" +$as_echo "$at_srcdir/actions.at:60: \$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:60" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:60" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:299: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:299" +$as_echo "$at_srcdir/actions.at:63: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:63" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:299" +echo >>"$at_stdout"; $as_echo "0123456789 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:299: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:299" +$as_echo "$at_srcdir/actions.at:63: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:63" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:63" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_204 +#AT_START_205 +at_fn_group_banner 205 'actions.at:71' \ + "Implicitly empty rule" " " 10 +at_xfail=no +( + $as_echo "205. $at_setup_line: testing $at_desc ..." + $at_traceon - - - - - - - - - -cat >input.y <<'_ATEOF' +cat >1.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -51190,73 +53648,11 @@ cat >input.y <<'_ATEOF' #undef realloc } - - -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.type ielr - %glr-parser - -%error-verbose - -%% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - %% - -/*--------. -| yylex. | -`--------*/ - -int yylex (YYSTYPE *lvalp) -{ - static char const *input = "a"; - *lvalp = 1; - return *input++; -} -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} - - -/*-------. -| main. | -`-------*/ - -int -main (void) -{ - return yyparse (); -} +exp: a b; +a: /* empty. */ {}; +// A mid-rule action does not count as an empty rule. +b: {} {}; _ATEOF @@ -51267,39 +53663,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:303" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:85: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -fcaret -Wempty-rule 1.y" +at_fn_check_prepare_notrace 'an embedded newline' "actions.at:85" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -fcaret -Wempty-rule 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:303" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:85" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:303: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:303" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:85: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y" "actions.at:85" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:303" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:85" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:303: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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' "conflicts.at:303" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 @@ -51308,16 +53704,16 @@ at_status=$? at_failed=false $at_check_filter 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:303" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:85" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:303: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:303" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 | sort @@ -51326,7 +53722,7 @@ at_status=$? at_failed=false $at_check_filter 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:303" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:85" $at_failed && at_fn_log_failure $at_traceon; } @@ -51334,91 +53730,120 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:303: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:303" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:85: bison -fno-caret -fcaret -Wempty-rule 1.y" +at_fn_check_prepare_trace "actions.at:85" +( $at_check_trace; bison -fno-caret -fcaret -Wempty-rule 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "1.y:11.17-18: warning: empty rule without %empty [-Wempty-rule] + a: /* 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:303" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:85" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout - { set +x -$as_echo "$at_srcdir/conflicts.at:303: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:303" -( $at_check_trace; $BISON_C_WORKS + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:85: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Werror" "actions.at:85" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:303" +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:85" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:303: \$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:303" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +1.y:11.17-18: warning: empty rule without %empty [-Wempty-rule] + a: /* empty. */ {}; + ^^ +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:85: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:85" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:303" +$at_diff experr "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:85" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:85: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=error" "actions.at:85" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:85" +$at_failed && at_fn_log_failure +$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:303: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:303" -( $at_check_trace; $PREPARSER ./input + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:85: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Wnone -Werror" "actions.at:85" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:303" +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:85" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:303: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:303" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/actions.at:85: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror" "actions.at:85" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end -" | \ - $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:303" +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:85" $at_failed && at_fn_log_failure $at_traceon; } + at_restore_special_files +fi - - - - - - - - - - - -cat >input.y <<'_ATEOF' +cat >2.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -51427,73 +53852,11 @@ cat >input.y <<'_ATEOF' #undef realloc } - - -%code { - #include - #include - int yylex (yy::parser::semantic_type *lvalp); - #define USE(Var) -} - -%defines - -%define lr.type ielr - %language "c++" - -%error-verbose - -%% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - %% - -/*--------. -| yylex. | -`--------*/ - -int yylex (yy::parser::semantic_type *lvalp) -{ - static char const *input = "a"; - *lvalp = 1; - return *input++; -} -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << m << std::endl; -} - - -/*-------. -| main. | -`-------*/ - -int -main (void) -{ - yy::parser parser; - return parser.parse (); -} +exp: a b c; +a: /* empty. */ {}; +b: %empty {}; +c: /* empty. */ {}; _ATEOF @@ -51504,39 +53867,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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' "conflicts.at:308" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/actions.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -fcaret 2.y" +at_fn_check_prepare_notrace 'an embedded newline' "actions.at:102" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -fcaret 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:308" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:102" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:308: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:308" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/actions.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret 2.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret 2.y" "actions.at:102" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:308" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:102" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:308: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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' "conflicts.at:308" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 @@ -51545,16 +53908,16 @@ at_status=$? at_failed=false $at_check_filter 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:308" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:102" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:308: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:308" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 | sort @@ -51563,7 +53926,7 @@ at_status=$? at_failed=false $at_check_filter 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:308" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:102" $at_failed && at_fn_log_failure $at_traceon; } @@ -51571,166 +53934,124 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:308: bison -o input.cc input.y" -at_fn_check_prepare_trace "conflicts.at:308" -( $at_check_trace; bison -o input.cc input.y +$as_echo "$at_srcdir/actions.at:102: bison -fno-caret -fcaret 2.y" +at_fn_check_prepare_trace "actions.at:102" +( $at_check_trace; bison -fno-caret -fcaret 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "2.y:11.17-18: warning: empty rule without %empty [-Wempty-rule] + a: /* empty. */ {}; + ^^ +2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule] + c: /* 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:308" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:102" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout -{ set +x -$as_echo "$at_srcdir/conflicts.at:308: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:308" -( $at_check_trace; $BISON_CXX_WORKS + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Werror" "actions.at:102" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:308" +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:102" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:308: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:308" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +2.y:11.17-18: warning: empty rule without %empty [-Wempty-rule] + a: /* empty. */ {}; + ^^ +2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule] + c: /* empty. */ {}; + ^^ +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:102: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:102" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:308" +$at_diff experr "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:102" $at_failed && at_fn_log_failure $at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:308: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:308" -( $at_check_trace; $PREPARSER ./input + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=error" "actions.at:102" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:308" +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:102" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:308: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:308" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Wnone -Werror" "actions.at:102" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end -" | \ - $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:308" +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:102" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/actions.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=none -Werror" "actions.at:102" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:102" +$at_failed && at_fn_log_failure +$at_traceon; } - - - - - - - - - - - -cat >input.y <<'_ATEOF' - - -%code imports { - import java.io.IOException; -} - -%define lr.type ielr - %language "java" - -%error-verbose - -%% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - -%code lexer { - -/*--------. -| yylex. | -`--------*/ - -public String input = "a"; -public int index = 0; -public int yylex () -{ - if (index < input.length ()) - return input.charAt (index++); - else - return 0; -} -public Object getLVal () -{ - return new Integer(1); -} - - public void yyerror (String s) - { - System.err.println (s); - } - -}; - -%% - -/*-------. -| main. | -`-------*/ - -class input -{ - public static void main (String args[]) throws IOException - { - YYParser p = new YYParser (); - p.parse (); - } -} -_ATEOF - + at_restore_special_files +fi if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files @@ -51738,39 +54059,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:313: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -o input.java input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:313" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.java input.y +$as_echo "$at_srcdir/actions.at:104: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -fcaret -Wno-empty-rule 2.y" +at_fn_check_prepare_notrace 'an embedded newline' "actions.at:104" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -fcaret -Wno-empty-rule 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:313" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:104" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:313: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y" "conflicts.at:313" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.java input.y +$as_echo "$at_srcdir/actions.at:104: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y" "actions.at:104" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:313" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:104" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:313: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:104: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:313" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:104" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -51779,16 +54100,16 @@ at_status=$? at_failed=false $at_check_filter 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:313" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:104" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:313: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:104: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:313" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:104" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -51797,7 +54118,7 @@ at_status=$? at_failed=false $at_check_filter 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:313" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:104" $at_failed && at_fn_log_failure $at_traceon; } @@ -51805,69 +54126,131 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:313: bison -o input.java input.y" -at_fn_check_prepare_trace "conflicts.at:313" -( $at_check_trace; bison -o input.java input.y +$as_echo "$at_srcdir/actions.at:104: bison -fno-caret -fcaret -Wno-empty-rule 2.y" +at_fn_check_prepare_trace "actions.at:104" +( $at_check_trace; bison -fno-caret -fcaret -Wno-empty-rule 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:313" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:104" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "conflicts.at:313" >"$at_check_line_file" -(test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/conflicts.at:313" -$as_echo "conflicts.at:313" >"$at_check_line_file" -(test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/conflicts.at:313" -{ set +x -$as_echo "$at_srcdir/conflicts.at:313: \$SHELL ../../../javacomp.sh input.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "conflicts.at:313" -( $at_check_trace; $SHELL ../../../javacomp.sh input.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:313" -$at_failed && at_fn_log_failure -$at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_205 +#AT_START_206 +at_fn_group_banner 206 'actions.at:112' \ + "Invalid uses of %empty" " " 10 +at_xfail=no +( + $as_echo "206. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >one.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%% +exp: + %empty {} %empty +; +_ATEOF { set +x -$as_echo "$at_srcdir/conflicts.at:313: \$SHELL ../../../javaexec.sh input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "conflicts.at:313" -( $at_check_trace; $SHELL ../../../javaexec.sh input +$as_echo "$at_srcdir/actions.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret one.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret one.y" "actions.at:128" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret one.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected end of input +echo >>"$at_stderr"; $as_echo "one.y:11.13-18: error: only one %empty allowed per rule + %empty {} %empty + ^^^^^^ +one.y:11.3-8: previous declaration + %empty {} %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:313" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:128" $at_failed && at_fn_log_failure $at_traceon; } +cat >two.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%% +exp: + 'a' %empty {} +| %empty 'a' {} +| %empty {} {} +; +_ATEOF -# Even canonical LR doesn't foresee the error for 'a'! +{ set +x +$as_echo "$at_srcdir/actions.at:149: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret two.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret two.y" "actions.at:149" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret two.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "two.y:11.7-12: error: %empty on non-empty rule + 'a' %empty {} + ^^^^^^ +two.y:12.3-8: error: %empty on non-empty rule + | %empty 'a' {} + ^^^^^^ +two.y:13.3-8: error: %empty on non-empty rule + | %empty {} {} + ^^^^^^ +" | \ + $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:149" +$at_failed && at_fn_log_failure +$at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_206 +#AT_START_207 +at_fn_group_banner 207 'actions.at:157' \ + "Valid uses of %empty" " " 10 +at_xfail=no +( + $as_echo "207. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -51881,70 +54264,45 @@ cat >input.y <<'_ATEOF' } +%debug +%code +{ +#include -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) +static void yyerror (const char *msg); +static int yylex (void); } - -%define api.pure - -%define lr.type ielr - %define lr.default-reductions consistent - -%error-verbose - %% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - +exp: %empty {} %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) -{ - static char const *input = "a"; - *lvalp = 1; - return *input++; -} -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } - - -/*-------. -| main. | -`-------*/ - +#include +static +int yylex (void) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) { + (void) argc; + (void) argv; return yyparse (); } _ATEOF @@ -51957,39 +54315,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:320" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:176" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:176" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:320: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:320" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:176" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:176" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:320: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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' "conflicts.at:320" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 @@ -51998,16 +54356,16 @@ at_status=$? at_failed=false $at_check_filter 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:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:176" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:320: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:320" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 | sort @@ -52016,7 +54374,7 @@ at_status=$? at_failed=false $at_check_filter 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:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:176" $at_failed && at_fn_log_failure $at_traceon; } @@ -52024,87 +54382,85 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:320: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:320" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:176: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:176" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:176" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:320: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:320" + { set +x +$as_echo "$at_srcdir/actions.at:176: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:176" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:176" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:320: \$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:320" +$as_echo "$at_srcdir/actions.at:176: \$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:176" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:176" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:320: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:320" +$as_echo "$at_srcdir/actions.at:177: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:177" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:177" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:320: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:320" +$as_echo "$at_srcdir/actions.at:177: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:177" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b' -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:320" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:177" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_207 +#AT_START_208 +at_fn_group_banner 208 'actions.at:241' \ + "Initial location: yacc.c " " " 10 +at_xfail=no +( + $as_echo "208. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -52117,72 +54473,80 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "yacc.c" -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.type ielr - %define lr.default-reductions accepting +%code +{ +# include +# include /* getenv */ +#include -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (const char *msg); +static int yylex (void); +} %% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "a"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - -/*-------. -| main. | -`-------*/ +int yylex (void) +{ + return 'x'; +} int main (void) { - return yyparse (); + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (); } _ATEOF @@ -52194,39 +54558,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:325: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:325" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:241" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:325" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:325: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:325" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:241" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:325" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:325: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:241: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:325" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:241" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -52235,16 +54599,16 @@ at_status=$? at_failed=false $at_check_filter 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:325" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:325: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:241: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:325" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:241" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -52253,7 +54617,7 @@ at_status=$? at_failed=false $at_check_filter 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:325" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } @@ -52261,87 +54625,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:325: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:325" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:241: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:241" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:325" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:325: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:325" + { set +x +$as_echo "$at_srcdir/actions.at:241: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:241" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:325" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:325: \$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:325" +$as_echo "$at_srcdir/actions.at:241: \$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:241" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:325" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:325: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:325" +$as_echo "$at_srcdir/actions.at:241: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:241" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:325" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:325: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:325" +$as_echo "$at_srcdir/actions.at:241: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:241" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:325" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:241" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_208 +#AT_START_209 +at_fn_group_banner 209 'actions.at:242' \ + "Initial location: yacc.c api.pure=full" " " 10 +at_xfail=no +( + $as_echo "209. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -52354,71 +54719,82 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "yacc.c" +%define api.pure full +%code +{ +# include +# include /* getenv */ +#include -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.type canonical-lr - -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (YYLTYPE const * const llocp, const char *msg); +static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); +} %% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "a"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - -/*-------. -| main. | -`-------*/ +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) +{ + YYUSE(lvalp); + YYUSE(llocp); + return 'x'; +} int main (void) { - return yyparse (); + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (); } _ATEOF @@ -52430,39 +54806,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:330: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:330" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:242: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:242" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:330" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:330: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:330" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:242: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:242" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:330" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:330: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:242: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:330" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:242" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -52471,16 +54847,16 @@ at_status=$? at_failed=false $at_check_filter 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:330" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:330: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:242: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:330" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:242" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -52489,7 +54865,7 @@ at_status=$? at_failed=false $at_check_filter 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:330" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } @@ -52497,89 +54873,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:330: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:330" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:242: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:242" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:330" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:330: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:330" + { set +x +$as_echo "$at_srcdir/actions.at:242: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:242" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:330" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:330: \$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:330" +$as_echo "$at_srcdir/actions.at:242: \$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:242" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:330" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:330: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:330" +$as_echo "$at_srcdir/actions.at:242: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:242" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:330" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:330: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:330" +$as_echo "$at_srcdir/actions.at:242: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:242" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' or 'b' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:330" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:242" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - -# Only LAC gets it right. - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_209 +#AT_START_210 +at_fn_group_banner 210 'actions.at:243' \ + "Initial location: yacc.c api.pure %parse-param { int x }" "" 10 +at_xfail=no +( + $as_echo "210. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -52592,72 +54967,83 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "yacc.c" +%define api.pure %parse-param { int x } +%code +{ +# include +# include /* getenv */ +#include -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.type canonical-lr - %define parse.lac full - -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (YYLTYPE const * const llocp, int x, const char *msg); +static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); +} %% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "a"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (YYLTYPE const * const llocp, int x, const char *msg) { + YYUSE(x); + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - -/*-------. -| main. | -`-------*/ +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) +{ + YYUSE(lvalp); + YYUSE(llocp); + return 'x'; +} int main (void) { - return yyparse (); + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (0); } _ATEOF @@ -52669,39 +55055,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:336: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:336" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:243: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:243" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:336" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:336: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:336" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:243: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:243" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:336" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:336: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:243: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:336" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:243" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -52710,16 +55096,16 @@ at_status=$? at_failed=false $at_check_filter 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:336" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:336: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:243: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:336" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:243" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -52728,7 +55114,7 @@ at_status=$? at_failed=false $at_check_filter 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:336" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } @@ -52736,87 +55122,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:336: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:336" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:243: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:243" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:336" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:336: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:336" + { set +x +$as_echo "$at_srcdir/actions.at:243: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:243" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:336" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:336: \$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:336" +$as_echo "$at_srcdir/actions.at:243: \$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:243" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:336" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:336: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:336" +$as_echo "$at_srcdir/actions.at:243: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:243" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:336" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:336" +$as_echo "$at_srcdir/actions.at:243: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:243" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'b' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:336" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:243" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_210 +#AT_START_211 +at_fn_group_banner 211 'actions.at:244' \ + "Initial location: yacc.c api.push-pull=both" " " 10 +at_xfail=no +( + $as_echo "211. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -52829,72 +55216,80 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "yacc.c" +%define api.push-pull both +%code +{ +# include +# include /* getenv */ +#include -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.type ielr - %define parse.lac full - -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (const char *msg); +static int yylex (void); +} %% - -%nonassoc 'a'; - -start: consistent-error-on-a-a 'a' ; - -consistent-error-on-a-a: - 'a' default-reduction - | 'a' default-reduction 'a' - | 'a' shift - ; - -default-reduction: /*empty*/ ; -shift: 'b' ; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error-on-a-a 'c' ; - - +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "a"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - -/*-------. -| main. | -`-------*/ +int yylex (void) +{ + return 'x'; +} int main (void) { - return yyparse (); + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (); } _ATEOF @@ -52906,39 +55301,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:341: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:341" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:244: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:244" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:341" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:341: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:341" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:244: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:244" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:341" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:341: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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:341" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 @@ -52947,16 +55342,16 @@ at_status=$? at_failed=false $at_check_filter 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:341" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:341: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:341" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 | sort @@ -52965,7 +55360,7 @@ at_status=$? at_failed=false $at_check_filter 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:341" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } @@ -52973,94 +55368,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:341: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:341" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:244: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:244" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:341" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:341: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:341" + { set +x +$as_echo "$at_srcdir/actions.at:244: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:244" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:341" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:341: \$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:341" +$as_echo "$at_srcdir/actions.at:244: \$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:244" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:341" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:341: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:341" +$as_echo "$at_srcdir/actions.at:244: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:244" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:341" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:341" +$as_echo "$at_srcdir/actions.at:244: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:244" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'b' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:341" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:244" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_211 +#AT_START_212 +at_fn_group_banner 212 'actions.at:245' \ + "Initial location: yacc.c api.push-pull=both api.pure=full" "" 10 +at_xfail=no +( + $as_echo "212. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -53073,98 +55462,82 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "yacc.c" +%define api.push-pull both %define api.pure full +%code +{ +# include +# include /* getenv */ +#include -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - - - -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (YYLTYPE const * const llocp, const char *msg); +static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); +} %% - -%nonassoc 'a'; - -// If $$ = 0 here, then we know that the 'a' destructor is being invoked -// incorrectly for the 'b' set in the semantic action below. All 'a' -// tokens are returned by yylex, which sets $$ = 1. -%destructor { - if (!$$) - fprintf (stderr, "Wrong destructor.\n"); -} 'a'; - -// Rather than depend on an inconsistent state to induce reading a -// lookahead as in the previous grammar, just assign the lookahead in a -// semantic action. That lookahead isn't needed before either error -// action is encountered. In a previous version of Bison, this was a -// problem as it meant yychar was not translated into yytoken before -// either error action. The second error action thus invoked a -// destructor that it selected according to the incorrect yytoken. The -// first error action would have reported an incorrect unexpected token -// except that, due to the bug described in the previous grammar, the -// unexpected token was not reported at all. -start: error-reduce consistent-error 'a' { USE ($3); } ; - -error-reduce: - 'a' 'a' consistent-reduction consistent-error 'a' - { USE (($1, $2, $5)); } -| 'a' error - { USE ($1); } -; - -consistent-reduction: /*empty*/ { - assert (yychar == YYEMPTY); - yylval = 0; - yychar = 'b'; -} ; - -consistent-error: - 'a' { USE ($1); } -| /*empty*/ %prec 'a' -; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error 'b' ; - - +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "aa"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - -/*-------. -| main. | -`-------*/ +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) +{ + YYUSE(lvalp); + YYUSE(llocp); + return 'x'; +} int main (void) { - return yyparse (); + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (); } _ATEOF @@ -53176,39 +55549,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:397" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:245" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:397" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:397" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:245" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:397" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:397: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:245: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:397" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:245" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -53217,16 +55590,16 @@ at_status=$? at_failed=false $at_check_filter 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:397" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:397: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:245: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:397" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:245" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -53235,7 +55608,7 @@ at_status=$? at_failed=false $at_check_filter 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:397" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } @@ -53243,87 +55616,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:397: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:397" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:245: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:245" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:397" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:397: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:397" + { set +x +$as_echo "$at_srcdir/actions.at:245: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:245" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:397" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:397: \$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:397" +$as_echo "$at_srcdir/actions.at:245: \$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:245" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:397" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:397: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:397" +$as_echo "$at_srcdir/actions.at:245: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:245" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:397" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:397" +$as_echo "$at_srcdir/actions.at:245: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:245" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:397" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:245" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_212 +#AT_START_213 +at_fn_group_banner 213 'actions.at:246' \ + "Initial location: glr.c " " " 10 +at_xfail=no +( + $as_echo "213. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -53336,98 +55710,80 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "glr.c" -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%glr-parser +%code +{ +# include +# include /* getenv */ +#include -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (const char *msg); +static int yylex (void); +} %% - -%nonassoc 'a'; - -// If $$ = 0 here, then we know that the 'a' destructor is being invoked -// incorrectly for the 'b' set in the semantic action below. All 'a' -// tokens are returned by yylex, which sets $$ = 1. -%destructor { - if (!$$) - fprintf (stderr, "Wrong destructor.\n"); -} 'a'; - -// Rather than depend on an inconsistent state to induce reading a -// lookahead as in the previous grammar, just assign the lookahead in a -// semantic action. That lookahead isn't needed before either error -// action is encountered. In a previous version of Bison, this was a -// problem as it meant yychar was not translated into yytoken before -// either error action. The second error action thus invoked a -// destructor that it selected according to the incorrect yytoken. The -// first error action would have reported an incorrect unexpected token -// except that, due to the bug described in the previous grammar, the -// unexpected token was not reported at all. -start: error-reduce consistent-error 'a' { USE ($3); } ; - -error-reduce: - 'a' 'a' consistent-reduction consistent-error 'a' - { USE (($1, $2, $5)); } -| 'a' error - { USE ($1); } -; - -consistent-reduction: /*empty*/ { - assert (yychar == YYEMPTY); - yylval = 0; - yychar = 'b'; -} ; - -consistent-error: - 'a' { USE ($1); } -| /*empty*/ %prec 'a' -; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error 'b' ; - - +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "aa"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - -/*-------. -| main. | -`-------*/ +int yylex (void) +{ + return 'x'; +} int main (void) { - return yyparse (); + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (); } _ATEOF @@ -53439,39 +55795,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:401: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:401" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:246: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:246" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:401" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:401: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:401" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:246: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:246" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:401" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:401: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:246: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:401" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:246" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -53480,16 +55836,16 @@ at_status=$? at_failed=false $at_check_filter 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:401" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:401: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:246: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:401" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:246" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -53498,7 +55854,7 @@ at_status=$? at_failed=false $at_check_filter 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:401" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } @@ -53506,87 +55862,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:401: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:401" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:246: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:246" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:401" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:401: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:401" + { set +x +$as_echo "$at_srcdir/actions.at:246: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:246" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:401" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:401: \$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:401" +$as_echo "$at_srcdir/actions.at:246: \$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:246" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:401" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:401: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:401" +$as_echo "$at_srcdir/actions.at:246: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:246" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:401" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:401" +$as_echo "$at_srcdir/actions.at:246: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:246" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:401" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:246" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_213 +#AT_START_214 +at_fn_group_banner 214 'actions.at:247' \ + "Initial location: glr.c api.pure" " " 10 +at_xfail=no +( + $as_echo "214. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -53599,100 +55956,84 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "glr.c" +%define api.pure +%code +{ +# include +# include /* getenv */ +#include -%code { - #include - #include - int yylex (yy::parser::semantic_type *lvalp); - #define USE(Var) +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (YYLTYPE const * const llocp, const char *msg); +static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } +%% +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } +%% -%defines -%language "c++" +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif -%error-verbose +/* A C error reporting function. */ +static +void yyerror (YYLTYPE const * const llocp, const char *msg) +{ + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} -%% +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) +{ + YYUSE(lvalp); + YYUSE(llocp); + return 'x'; +} -%nonassoc 'a'; - -// If $$ = 0 here, then we know that the 'a' destructor is being invoked -// incorrectly for the 'b' set in the semantic action below. All 'a' -// tokens are returned by yylex, which sets $$ = 1. -%destructor { - if (!$$) - fprintf (stderr, "Wrong destructor.\n"); -} 'a'; - -// Rather than depend on an inconsistent state to induce reading a -// lookahead as in the previous grammar, just assign the lookahead in a -// semantic action. That lookahead isn't needed before either error -// action is encountered. In a previous version of Bison, this was a -// problem as it meant yychar was not translated into yytoken before -// either error action. The second error action thus invoked a -// destructor that it selected according to the incorrect yytoken. The -// first error action would have reported an incorrect unexpected token -// except that, due to the bug described in the previous grammar, the -// unexpected token was not reported at all. -start: error-reduce consistent-error 'a' { USE ($3); } ; - -error-reduce: - 'a' 'a' consistent-reduction consistent-error 'a' - { USE (($1, $2, $5)); } -| 'a' error - { USE ($1); } -; - -consistent-reduction: /*empty*/ { - assert (yychar == yyempty_); - yylval = 0; - yychar = 'b'; -} ; - -consistent-error: - 'a' { USE ($1); } -| /*empty*/ %prec 'a' -; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error 'b' ; - - -%% - -/*--------. -| yylex. | -`--------*/ - -int yylex (yy::parser::semantic_type *lvalp) -{ - static char const *input = "aa"; - *lvalp = 1; - return *input++; -} -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << m << std::endl; -} - - -/*-------. -| main. | -`-------*/ - -int -main (void) -{ - yy::parser parser; - return parser.parse (); -} -_ATEOF +int +main (void) +{ + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (); +} +_ATEOF @@ -53702,39 +56043,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:405: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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' "conflicts.at:405" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/actions.at:247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:247" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:405" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:405: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:405" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/actions.at:247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:247" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:405" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:405: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:247: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:405" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:247" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -53743,16 +56084,16 @@ at_status=$? at_failed=false $at_check_filter 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:405" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:405: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:247: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:405" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:247" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -53761,7 +56102,7 @@ at_status=$? at_failed=false $at_check_filter 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:405" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } @@ -53769,90 +56110,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:405: bison -o input.cc input.y" -at_fn_check_prepare_trace "conflicts.at:405" -( $at_check_trace; bison -o input.cc input.y +$as_echo "$at_srcdir/actions.at:247: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:247" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:405" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:405: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:405" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/actions.at:247: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:247" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:405" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:405: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:405" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +$as_echo "$at_srcdir/actions.at:247: \$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:247" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:405" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:405: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:405" +$as_echo "$at_srcdir/actions.at:247: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:247" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:405" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:405" +$as_echo "$at_srcdir/actions.at:247: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:247" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:405" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:247" $at_failed && at_fn_log_failure $at_traceon; } - - - - - -# No Java test because yychar cannot be manipulated by users. - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_214 +#AT_START_215 +at_fn_group_banner 215 'actions.at:248' \ + "Initial location: lalr1.cc " " " 10 +at_xfail=no +( + $as_echo "215. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -53865,98 +56204,41 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "lalr1.cc" -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.default-reductions consistent - -%error-verbose +%code +{ +# include +# include /* getenv */ +static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} %% - -%nonassoc 'a'; - -// If $$ = 0 here, then we know that the 'a' destructor is being invoked -// incorrectly for the 'b' set in the semantic action below. All 'a' -// tokens are returned by yylex, which sets $$ = 1. -%destructor { - if (!$$) - fprintf (stderr, "Wrong destructor.\n"); -} 'a'; - -// Rather than depend on an inconsistent state to induce reading a -// lookahead as in the previous grammar, just assign the lookahead in a -// semantic action. That lookahead isn't needed before either error -// action is encountered. In a previous version of Bison, this was a -// problem as it meant yychar was not translated into yytoken before -// either error action. The second error action thus invoked a -// destructor that it selected according to the incorrect yytoken. The -// first error action would have reported an incorrect unexpected token -// except that, due to the bug described in the previous grammar, the -// unexpected token was not reported at all. -start: error-reduce consistent-error 'a' { USE ($3); } ; - -error-reduce: - 'a' 'a' consistent-reduction consistent-error 'a' - { USE (($1, $2, $5)); } -| 'a' error - { USE ($1); } -; - -consistent-reduction: /*empty*/ { - assert (yychar == YYEMPTY); - yylval = 0; - yychar = 'b'; -} ; - -consistent-error: - 'a' { USE ($1); } -| /*empty*/ %prec 'a' -; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error 'b' ; - - +exp: { std::cerr << @$ << '\n'; } %% - -/*--------. -| yylex. | -`--------*/ - -int yylex (YYSTYPE *lvalp) +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) { - static char const *input = "aa"; - *lvalp = 1; - return *input++; + std::cerr << l << ": " << m << '\n'; } -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) + +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { - fprintf (stderr, "%s\n", msg); + YYUSE(lvalp); + YYUSE(llocp); + return 'x'; } - -/*-------. -| main. | -`-------*/ - int main (void) { - return yyparse (); + yy::parser p; + p.set_debug_level (!!getenv("YYDEBUG")); + return p.parse (); } _ATEOF @@ -53968,39 +56250,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:411: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:411" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:248: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:248" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:411" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:411: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:411" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:248: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:248" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:411" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:411: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:248: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:411" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:248" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -54009,16 +56291,16 @@ at_status=$? at_failed=false $at_check_filter 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:411" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:411: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:248: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:411" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:248" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -54027,7 +56309,7 @@ at_status=$? at_failed=false $at_check_filter 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:411" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } @@ -54035,89 +56317,89 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:411: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:411" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:248: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "actions.at:248" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:411" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:411: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:411" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/actions.at:248: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:248" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:411" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:411: \$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:411" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/actions.at:248: \$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:248" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:411" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:411: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:411" +$as_echo "$at_srcdir/actions.at:248: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:248" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:411" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:411" +$as_echo "$at_srcdir/actions.at:248: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:248" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:411" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:248" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - -# Canonical LR doesn't foresee the error for 'a'! - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_215 +#AT_START_216 +at_fn_group_banner 216 'actions.at:249' \ + "Initial location: glr.cc " " " 10 +at_xfail=no +( + $as_echo "216. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -54130,98 +56412,41 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "glr.cc" -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.default-reductions accepting - -%error-verbose +%code +{ +# include +# include /* getenv */ +static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} %% - -%nonassoc 'a'; - -// If $$ = 0 here, then we know that the 'a' destructor is being invoked -// incorrectly for the 'b' set in the semantic action below. All 'a' -// tokens are returned by yylex, which sets $$ = 1. -%destructor { - if (!$$) - fprintf (stderr, "Wrong destructor.\n"); -} 'a'; - -// Rather than depend on an inconsistent state to induce reading a -// lookahead as in the previous grammar, just assign the lookahead in a -// semantic action. That lookahead isn't needed before either error -// action is encountered. In a previous version of Bison, this was a -// problem as it meant yychar was not translated into yytoken before -// either error action. The second error action thus invoked a -// destructor that it selected according to the incorrect yytoken. The -// first error action would have reported an incorrect unexpected token -// except that, due to the bug described in the previous grammar, the -// unexpected token was not reported at all. -start: error-reduce consistent-error 'a' { USE ($3); } ; - -error-reduce: - 'a' 'a' consistent-reduction consistent-error 'a' - { USE (($1, $2, $5)); } -| 'a' error - { USE ($1); } -; - -consistent-reduction: /*empty*/ { - assert (yychar == YYEMPTY); - yylval = 0; - yychar = 'b'; -} ; - -consistent-error: - 'a' { USE ($1); } -| /*empty*/ %prec 'a' -; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error 'b' ; - - +exp: { std::cerr << @$ << '\n'; } %% - -/*--------. -| yylex. | -`--------*/ - -int yylex (YYSTYPE *lvalp) +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) { - static char const *input = "aa"; - *lvalp = 1; - return *input++; + std::cerr << l << ": " << m << '\n'; } -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) + +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { - fprintf (stderr, "%s\n", msg); + YYUSE(lvalp); + YYUSE(llocp); + return 'x'; } - -/*-------. -| main. | -`-------*/ - int main (void) { - return yyparse (); + yy::parser p; + p.set_debug_level (!!getenv("YYDEBUG")); + return p.parse (); } _ATEOF @@ -54233,39 +56458,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:417" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:249: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:249" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:417" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:417: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:417" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:249: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:249" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:417" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:417: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:249: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:417" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:249" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -54274,16 +56499,16 @@ at_status=$? at_failed=false $at_check_filter 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:417" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:417: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:249: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:417" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:249" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -54292,7 +56517,7 @@ at_status=$? at_failed=false $at_check_filter 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:417" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } @@ -54300,87 +56525,89 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:417: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:417" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:249: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "actions.at:249" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:417" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:417: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:417" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/actions.at:249: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:249" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:417" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:417: \$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:417" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/actions.at:249: \$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:249" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:417" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:417: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:417" +$as_echo "$at_srcdir/actions.at:249: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:249" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:417" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:417: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:417" +$as_echo "$at_srcdir/actions.at:249: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:249" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' +echo >>"$at_stderr"; $as_echo "1.1 +1.1: 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/conflicts.at:417" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:249" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_216 +#AT_START_217 +at_fn_group_banner 217 'actions.at:267' \ + "Initial location: yacc.c api.pure=full" " " 10 +at_xfail=no +( + $as_echo "217. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -54393,98 +56620,89 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "yacc.c" +%define api.pure full +%{ +# define YYLTYPE int +# define LOCATION_PRINT(Stream, Loc) \ + (void) (Loc) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + (Current) = ((Rhs)[N ? 1 : 0]) +%} +%code +{ +# include +# include /* getenv */ +#include -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define lr.type canonical-lr - -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (YYLTYPE const * const llocp, const char *msg); +static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); +} %% - -%nonassoc 'a'; - -// If $$ = 0 here, then we know that the 'a' destructor is being invoked -// incorrectly for the 'b' set in the semantic action below. All 'a' -// tokens are returned by yylex, which sets $$ = 1. -%destructor { - if (!$$) - fprintf (stderr, "Wrong destructor.\n"); -} 'a'; - -// Rather than depend on an inconsistent state to induce reading a -// lookahead as in the previous grammar, just assign the lookahead in a -// semantic action. That lookahead isn't needed before either error -// action is encountered. In a previous version of Bison, this was a -// problem as it meant yychar was not translated into yytoken before -// either error action. The second error action thus invoked a -// destructor that it selected according to the incorrect yytoken. The -// first error action would have reported an incorrect unexpected token -// except that, due to the bug described in the previous grammar, the -// unexpected token was not reported at all. -start: error-reduce consistent-error 'a' { USE ($3); } ; - -error-reduce: - 'a' 'a' consistent-reduction consistent-error 'a' - { USE (($1, $2, $5)); } -| 'a' error - { USE ($1); } -; - -consistent-reduction: /*empty*/ { - assert (yychar == YYEMPTY); - yylval = 0; - yychar = 'b'; -} ; - -consistent-error: - 'a' { USE ($1); } -| /*empty*/ %prec 'a' -; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error 'b' ; - - +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "aa"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - -/*-------. -| main. | -`-------*/ +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) +{ + YYUSE(lvalp); + YYUSE(llocp); + return 'x'; +} int main (void) { - return yyparse (); + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (); } _ATEOF @@ -54496,39 +56714,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:421" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:267: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:267" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:421" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:421: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:421" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:267: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:267" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:421" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:421: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:267: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:421" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:267" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -54537,16 +56755,16 @@ at_status=$? at_failed=false $at_check_filter 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:421" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:421: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:267: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:421" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:267" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -54555,7 +56773,7 @@ at_status=$? at_failed=false $at_check_filter 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:421" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } @@ -54563,88 +56781,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:421: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:421" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:267: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:267" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:421" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:421: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:421" + { set +x +$as_echo "$at_srcdir/actions.at:267: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:267" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:421" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:421: \$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:421" +$as_echo "$at_srcdir/actions.at:267: \$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:267" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:421" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:421: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:421" +$as_echo "$at_srcdir/actions.at:267: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:267" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:421" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:421: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:421" +$as_echo "$at_srcdir/actions.at:267: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:267" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' +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/conflicts.at:421" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:267" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_217 +#AT_START_218 +at_fn_group_banner 218 'actions.at:278' \ + "Initial location: yacc.c api.pure=full" " " 10 +at_xfail=no +( + $as_echo "218. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -54657,98 +56875,89 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "yacc.c" +%define api.pure full +%{ +# define YYLTYPE int +# define LOCATION_PRINT(Stream, Loc) \ + fprintf ((Stream), "%d", (Loc)) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + (Current) = ((Rhs)[N ? 1 : 0]) +%} +%code +{ +# include +# include /* getenv */ +#include -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define parse.lac full - -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (YYLTYPE const * const llocp, const char *msg); +static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); +} %% - -%nonassoc 'a'; - -// If $$ = 0 here, then we know that the 'a' destructor is being invoked -// incorrectly for the 'b' set in the semantic action below. All 'a' -// tokens are returned by yylex, which sets $$ = 1. -%destructor { - if (!$$) - fprintf (stderr, "Wrong destructor.\n"); -} 'a'; - -// Rather than depend on an inconsistent state to induce reading a -// lookahead as in the previous grammar, just assign the lookahead in a -// semantic action. That lookahead isn't needed before either error -// action is encountered. In a previous version of Bison, this was a -// problem as it meant yychar was not translated into yytoken before -// either error action. The second error action thus invoked a -// destructor that it selected according to the incorrect yytoken. The -// first error action would have reported an incorrect unexpected token -// except that, due to the bug described in the previous grammar, the -// unexpected token was not reported at all. -start: error-reduce consistent-error 'a' { USE ($3); } ; - -error-reduce: - 'a' 'a' consistent-reduction consistent-error 'a' - { USE (($1, $2, $5)); } -| 'a' error - { USE ($1); } -; - -consistent-reduction: /*empty*/ { - assert (yychar == YYEMPTY); - yylval = 0; - yychar = 'b'; -} ; - -consistent-error: - 'a' { USE ($1); } -| /*empty*/ %prec 'a' -; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error 'b' ; - - +exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "aa"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - -/*-------. -| main. | -`-------*/ +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) +{ + YYUSE(lvalp); + YYUSE(llocp); + return 'x'; +} int main (void) { - return yyparse (); + yydebug = !!getenv("YYDEBUG"); + return !!yyparse (); } _ATEOF @@ -54760,39 +56969,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:426: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:426" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:278" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:426" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:426: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:426" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:278" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:426" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:426: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:278: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:426" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:278" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -54801,16 +57010,16 @@ at_status=$? at_failed=false $at_check_filter 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:426" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:426: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:278: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:426" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:278" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -54819,7 +57028,7 @@ at_status=$? at_failed=false $at_check_filter 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:426" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } @@ -54827,87 +57036,88 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:426: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:426" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:278: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:278" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:426" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:426: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:426" + { set +x +$as_echo "$at_srcdir/actions.at:278: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:278" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:426" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:426: \$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:426" +$as_echo "$at_srcdir/actions.at:278: \$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:278" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:426" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:426: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:426" +$as_echo "$at_srcdir/actions.at:278: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:278" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:426" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:426" +$as_echo "$at_srcdir/actions.at:278: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:278" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' +echo >>"$at_stderr"; $as_echo "0 +0: 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/conflicts.at:426" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:278" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_218 +#AT_START_219 +at_fn_group_banner 219 'actions.at:352' \ + "Location print: yacc.c " " " 10 +at_xfail=no +( + $as_echo "219. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -54920,99 +57130,104 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%debug +%skeleton "yacc.c" -%code { - #include - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *lvalp); - #define USE(Var) -} - -%define api.pure - -%define parse.lac full - %define lr.default-reductions accepting +%code +{ +#include -%error-verbose +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif +static void yyerror (const char *msg); +static int yylex (void); +} %% - -%nonassoc 'a'; - -// If $$ = 0 here, then we know that the 'a' destructor is being invoked -// incorrectly for the 'b' set in the semantic action below. All 'a' -// tokens are returned by yylex, which sets $$ = 1. -%destructor { - if (!$$) - fprintf (stderr, "Wrong destructor.\n"); -} 'a'; - -// Rather than depend on an inconsistent state to induce reading a -// lookahead as in the previous grammar, just assign the lookahead in a -// semantic action. That lookahead isn't needed before either error -// action is encountered. In a previous version of Bison, this was a -// problem as it meant yychar was not translated into yytoken before -// either error action. The second error action thus invoked a -// destructor that it selected according to the incorrect yytoken. The -// first error action would have reported an incorrect unexpected token -// except that, due to the bug described in the previous grammar, the -// unexpected token was not reported at all. -start: error-reduce consistent-error 'a' { USE ($3); } ; - -error-reduce: - 'a' 'a' consistent-reduction consistent-error 'a' - { USE (($1, $2, $5)); } -| 'a' error - { USE ($1); } -; - -consistent-reduction: /*empty*/ { - assert (yychar == YYEMPTY); - yylval = 0; - yychar = 'b'; -} ; - -consistent-error: - 'a' { USE ($1); } -| /*empty*/ %prec 'a' -; - -// Provide another context in which all rules are useful so that this -// test case looks a little more realistic. -start: 'b' consistent-error 'b' ; - - +exp: %empty; %% -/*--------. -| yylex. | -`--------*/ -int yylex (YYSTYPE *lvalp) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - static char const *input = "aa"; - *lvalp = 1; - return *input++; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; } -#include +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } - - -/*-------. -| main. | -`-------*/ +#include +static +int yylex (void) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (yylloc).first_line = (yylloc).last_line = 1; + (yylloc).first_column = (yylloc).last_column = toknum; + return res; +} int main (void) { - return yyparse (); + YYLTYPE loc; + +#define TEST(L1, C1, L2, C2) \ + loc.first_line = L1; \ + loc.first_column = C1; \ + loc.last_line = L2; \ + loc.last_column = C2; \ + LOCATION_PRINT(stdout, loc);\ + putchar ('\n'); + + TEST(1, 1, 1, 1); + TEST(2, 1, 2, 10); + TEST(3, 1, 4, 1); + TEST(5, 1, 6, 10); + + TEST(7, 2, 0, 2); + TEST(8, 0, 8, 0); + return 0; } _ATEOF @@ -55024,39 +57239,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:430" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:352: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:352" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:430" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:430" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:352: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:352" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:430" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:430: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:352: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:430" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:352" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -55065,16 +57280,16 @@ at_status=$? at_failed=false $at_check_filter 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:430" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:430: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:352: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:430" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:352" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -55083,7 +57298,7 @@ at_status=$? at_failed=false $at_check_filter 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:430" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } @@ -55091,104 +57306,95 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:430: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:430" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:352: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:352" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:430" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:430: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:430" + { set +x +$as_echo "$at_srcdir/actions.at:352: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:352" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:430" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:430: \$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:430" +$as_echo "$at_srcdir/actions.at:352: \$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:352" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:430" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } - - - - { set +x -$as_echo "$at_srcdir/conflicts.at:430: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:430" +$as_echo "$at_srcdir/actions.at:352: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:352" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:430" +echo >>"$at_stdout"; $as_echo "1.1 +2.1-9 +3.1-4.0 +5.1-6.9 +7.2 +8.0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:430: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:430" +$as_echo "$at_srcdir/actions.at:352: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:352" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:430" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:352" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - - - - - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_183 -#AT_START_184 -at_fn_group_banner 184 'conflicts.at:456' \ - "LAC: %nonassoc requires splitting canonical LR states" "" 10 +#AT_STOP_219 +#AT_START_220 +at_fn_group_banner 220 'actions.at:353' \ + "Location print: glr.c " " " 10 at_xfail=no ( - $as_echo "184. $at_setup_line: testing $at_desc ..." + $as_echo "220. $at_setup_line: testing $at_desc ..." $at_traceon + cat >input.y <<'_ATEOF' %code top { #include @@ -55198,117 +57404,148 @@ cat >input.y <<'_ATEOF' #undef realloc } -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); -} +%locations +%debug +%skeleton "glr.c" -%error-verbose -%nonassoc 'a' -%% +%code +{ +#include -start: - 'a' problem 'a' // First context. -| 'b' problem 'b' // Second context. -| 'c' reduce-nonassoc // Just makes reduce-nonassoc useful. -; +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif -problem: - look reduce-nonassoc -| look 'a' -| look 'b' -; +static void yyerror (const char *msg); +static int yylex (void); +} +%% +exp: %empty; +%% -// For the state reached after shifting the 'a' in these productions, -// lookahead sets are the same in both the first and second contexts. -// Thus, canonical LR reuses the same state for both contexts. However, -// the lookahead 'a' for the reduction "look: 'a'" later becomes an -// error action only in the first context. In order to immediately -// detect the syntax error on 'a' here for only the first context, this -// canonical LR state would have to be split into two states, and the -// 'a' lookahead would have to be removed from only one of the states. -look: - 'a' // Reduction lookahead set is always ['a', 'b']. -| 'a' 'b' -| 'a' 'c' // 'c' is forgotten as an expected token. -; -reduce-nonassoc: %prec 'a'; +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif -%% -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { - static char const input[] = "aaa"; + static char const input[] = ""; static size_t toknum = 0; int res; ; assert (toknum < sizeof input / sizeof input[0]); res = input[toknum++]; ; + (yylloc).first_line = (yylloc).last_line = 1; + (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { - return yyparse (); + YYLTYPE loc; + +#define TEST(L1, C1, L2, C2) \ + loc.first_line = L1; \ + loc.first_column = C1; \ + loc.last_line = L2; \ + loc.last_column = C2; \ + LOCATION_PRINT(stdout, loc);\ + putchar ('\n'); + + TEST(1, 1, 1, 1); + TEST(2, 1, 2, 10); + TEST(3, 1, 4, 1); + TEST(5, 1, 6, 10); + + TEST(7, 2, 0, 2); + TEST(8, 0, 8, 0); + return 0; } _ATEOF - -# Show canonical LR's failure. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:511" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y +$as_echo "$at_srcdir/actions.at:353: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:353" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:511" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:511" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y +$as_echo "$at_srcdir/actions.at:353: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:353" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:511" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:511: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:353: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:511" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:353" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -55317,16 +57554,16 @@ at_status=$? at_failed=false $at_check_filter 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:511" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:511: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:353: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:511" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:353" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -55335,7 +57572,7 @@ at_status=$? at_failed=false $at_check_filter 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:511" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } @@ -55343,121 +57580,204 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:511: bison -Dlr.type=canonical-lr -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:511" -( $at_check_trace; bison -Dlr.type=canonical-lr -o input.c input.y +$as_echo "$at_srcdir/actions.at:353: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:353" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:511" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:515: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:515" + { set +x +$as_echo "$at_srcdir/actions.at:353: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:353" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:515" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:515: \$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:515" +$as_echo "$at_srcdir/actions.at:353: \$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:353" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:515" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:516: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:516" +$as_echo "$at_srcdir/actions.at:353: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:353" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:516" +echo >>"$at_stdout"; $as_echo "1.1 +2.1-9 +3.1-4.0 +5.1-6.9 +7.2 +8.0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:516: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:516" +$as_echo "$at_srcdir/actions.at:353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:353" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:516" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:353" $at_failed && at_fn_log_failure $at_traceon; } -# It's corrected by LAC. + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_220 +#AT_START_221 +at_fn_group_banner 221 'actions.at:354' \ + "Location print: lalr1.cc " " " 10 +at_xfail=no +( + $as_echo "221. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%locations +%debug +%skeleton "lalr1.cc" + + +%code +{ + +static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} +%% +exp: %empty; +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + (void) lvalp;(void) llocp; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (*llocp).begin.line = (*llocp).end.line = 1; + (*llocp).begin.column = (*llocp).end.column = toknum; + return res; +} + +int +main (void) +{ + yy::parser::location_type loc; + +#define TEST(L1, C1, L2, C2) \ + loc.begin.line = L1; \ + loc.begin.column = C1; \ + loc.end.line = L2; \ + loc.end.column = C2; \ + std::cout << loc;\ + putchar ('\n'); + + TEST(1, 1, 1, 1); + TEST(2, 1, 2, 10); + TEST(3, 1, 4, 1); + TEST(5, 1, 6, 10); + + TEST(7, 2, 0, 2); + TEST(8, 0, 8, 0); + return 0; +} +_ATEOF + + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dlr.type=canonical-lr -Dparse.lac=full \\ - -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dlr.type=canonical-lr -Dparse.lac=full \ - -o input.c input.y +$as_echo "$at_srcdir/actions.at:354: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:354" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:521" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \\ - -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \ - -o input.c input.y +$as_echo "$at_srcdir/actions.at:354: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:354" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:521" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:521: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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' "conflicts.at:521" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 @@ -55466,16 +57786,16 @@ at_status=$? at_failed=false $at_check_filter 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:521" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:521: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:521" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.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 | sort @@ -55484,7 +57804,7 @@ at_status=$? at_failed=false $at_check_filter 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:521" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } @@ -55492,286 +57812,205 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:521: bison -Dlr.type=canonical-lr -Dparse.lac=full \\ - -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521" -( $at_check_trace; bison -Dlr.type=canonical-lr -Dparse.lac=full \ - -o input.c input.y +$as_echo "$at_srcdir/actions.at:354: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "actions.at:354" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 2 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:521" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/conflicts.at:525: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:525" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/actions.at:354: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:354" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:525" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:525: \$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:525" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/actions.at:354: \$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:354" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:525" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:526: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:526" +$as_echo "$at_srcdir/actions.at:354: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:354" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:526" +echo >>"$at_stdout"; $as_echo "1.1 +2.1-9 +3.1-4.0 +5.1-6.9 +7.2 +8.0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:526" +$as_echo "$at_srcdir/actions.at:354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:354" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' or 'c' -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:526" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:354" $at_failed && at_fn_log_failure $at_traceon; } -# IELR is sufficient when LAC is used. -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:531" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:531" -$at_failed && at_fn_log_failure -$at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_221 +#AT_START_222 +at_fn_group_banner 222 'actions.at:355' \ + "Location print: glr.cc " " " 10 +at_xfail=no +( + $as_echo "222. $at_setup_line: testing $at_desc ..." + $at_traceon - { set +x -$as_echo "$at_srcdir/conflicts.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" "conflicts.at:531" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:531" -$at_failed && at_fn_log_failure -$at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:531: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:531" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:531" -$at_failed && at_fn_log_failure -$at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:531: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:531" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:531" -$at_failed && at_fn_log_failure -$at_traceon; } - - rm -rf xml-tests expout - at_restore_special_files -fi -{ set +x -$as_echo "$at_srcdir/conflicts.at:531: bison -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:531" -( $at_check_trace; bison -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "input.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/conflicts.at:531" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/conflicts.at:535: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:535" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:535" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:535: \$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:535" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:535" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:536: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:536" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:536" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/conflicts.at:536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "conflicts.at:536" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 'b' or 'c' -" | \ - $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:536" -$at_failed && at_fn_log_failure -$at_traceon; } +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%locations +%debug +%skeleton "glr.cc" - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_184 -#AT_START_185 -at_fn_group_banner 185 'conflicts.at:546' \ - "Unresolved SR Conflicts" " " 10 -at_xfail=no -( - $as_echo "185. $at_setup_line: testing $at_desc ..." - $at_traceon +%code +{ +static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} +%% +exp: %empty; +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + (void) lvalp;(void) llocp; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (*llocp).begin.line = (*llocp).end.line = 1; + (*llocp).begin.column = (*llocp).end.column = toknum; + return res; +} +int +main (void) +{ + yy::parser::location_type loc; +loc.initialize(); +#define TEST(L1, C1, L2, C2) \ + loc.begin.line = L1; \ + loc.begin.column = C1; \ + loc.end.line = L2; \ + loc.end.column = C2; \ + std::cout << loc;\ + putchar ('\n'); + TEST(1, 1, 1, 1); + TEST(2, 1, 2, 10); + TEST(3, 1, 4, 1); + TEST(5, 1, 6, 10); -cat >input.y <<'_ATEOF' -%token NUM OP -%% -exp: exp OP exp | NUM; + TEST(7, 2, 0, 2); + TEST(8, 0, 8, 0); + return 0; +} _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:556" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:355: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:355" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:556" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:355" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:556" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:355: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:355" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:556" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:355" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:556: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:355: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:556" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:355" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -55780,16 +58019,16 @@ at_status=$? at_failed=false $at_check_filter 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:556" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:355" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:556: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:355: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:556" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:355" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -55798,7 +58037,7 @@ at_status=$? at_failed=false $at_check_filter 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:556" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:355" $at_failed && at_fn_log_failure $at_traceon; } @@ -55806,182 +58045,215 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:556: bison -o input.c --report=all input.y" -at_fn_check_prepare_trace "conflicts.at:556" -( $at_check_trace; bison -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:355: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "actions.at:355" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:556" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:355" $at_failed && at_fn_log_failure $at_traceon; } -# Check the contents of the report. { set +x -$as_echo "$at_srcdir/conflicts.at:561: cat input.output" -at_fn_check_prepare_trace "conflicts.at:561" -( $at_check_trace; cat input.output +$as_echo "$at_srcdir/actions.at:355: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:355" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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] +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:355" +$at_failed && at_fn_log_failure +$at_traceon; } - OP shift, and go to state 4 +{ set +x +$as_echo "$at_srcdir/actions.at:355: \$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:355" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:355" +$at_failed && at_fn_log_failure +$at_traceon; } - OP [reduce using rule 1 (exp)] - \$default reduce using rule 1 (exp) +{ set +x +$as_echo "$at_srcdir/actions.at:355: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:355" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "1.1 +2.1-9 +3.1-4.0 +5.1-6.9 +7.2 +8.0 " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:561" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:355" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/actions.at:355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:355" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:355" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_185 -#AT_START_186 -at_fn_group_banner 186 'conflicts.at:653' \ - "Resolved SR Conflicts" " " 10 +#AT_STOP_222 +#AT_START_223 +at_fn_group_banner 223 'actions.at:365' \ + "Exotic Dollars" " " 10 at_xfail=no ( - $as_echo "186. $at_setup_line: testing $at_desc ..." + $as_echo "223. $at_setup_line: testing $at_desc ..." $at_traceon - cat >input.y <<'_ATEOF' -%token NUM OP -%left OP +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%define parse.error verbose +%debug +%code { +#include + +static void yyerror (const char *msg); +static int yylex (void); +# define USE(Var) +} + +%union +{ + int val; +}; + +%type a_1 a_2 a_5 + sum_of_the_five_previous_values + %% -exp: exp OP exp | NUM; +exp: a_1 a_2 { $$ = 3; } { $$ = $3 + 1; } a_5 + sum_of_the_five_previous_values + { + USE (($1, $2, $3, $4, $5)); + printf ("%d\n", $6); + } +; +a_1: { $$ = 1; }; +a_2: { $$ = 2; }; +a_5: { $$ = 5; }; + +sum_of_the_five_previous_values: + { + $$ = $0 + $-1 + $-2 + $-3 + $-4; + } +; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:664" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:409: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:409" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:664" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:409" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:664" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:409: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:409" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:664" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:409" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:664: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:409: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:664" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:409" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -55990,16 +58262,16 @@ at_status=$? at_failed=false $at_check_filter 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:664" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:409" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:664: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:409: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:664" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:409" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -56008,7 +58280,7 @@ at_status=$? at_failed=false $at_check_filter 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:664" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:409" $at_failed && at_fn_log_failure $at_traceon; } @@ -56016,176 +58288,177 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:664: bison -o input.c --report=all input.y" -at_fn_check_prepare_trace "conflicts.at:664" -( $at_check_trace; bison -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:409: bison -fno-caret -d -v -o input.c input.y" +at_fn_check_prepare_trace "actions.at:409" +( $at_check_trace; bison -fno-caret -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:664" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:409" $at_failed && at_fn_log_failure $at_traceon; } - -# Check the contents of the report. { set +x -$as_echo "$at_srcdir/conflicts.at:667: cat input.output" -at_fn_check_prepare_trace "conflicts.at:667" -( $at_check_trace; cat input.output +$as_echo "$at_srcdir/actions.at:410: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:410" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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] +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:410" +$at_failed && at_fn_log_failure +$at_traceon; } - \$default reduce using rule 1 (exp) +{ set +x +$as_echo "$at_srcdir/actions.at:410: \$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:410" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:410" +$at_failed && at_fn_log_failure +$at_traceon; } - Conflict between rule 1 and token OP resolved as reduce (%left OP). +{ set +x +$as_echo "$at_srcdir/actions.at:413: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:413" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "15 " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:667" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:413" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_186 -#AT_START_187 -at_fn_group_banner 187 'conflicts.at:775' \ - "Defaulted Conflicted Reduction" " " 10 -at_xfail=no -( - $as_echo "187. $at_setup_line: testing $at_desc ..." - $at_traceon +{ set +x +$as_echo "$at_srcdir/actions.at:413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:413" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:413" +$at_failed && at_fn_log_failure +$at_traceon; } +# Make sure that fields after $n or $-n are parsed correctly. At one +# point while implementing dashes in symbol names, we were dropping +# fields after $-n. cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + + +%{ +#include + +static void yyerror (const char *msg); +static int yylex (void); + typedef struct { int val; } stype; +# define YYSTYPE stype +%} + %% -exp: num | id; -num: '0'; -id : '0'; +start: one two { $$.val = $1.val + $2.val; } sum ; +one: { $$.val = 1; } ; +two: { $$.val = 2; } ; +sum: { printf ("%d\n", $0.val + $-1.val + $-2.val); } ; + %% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:786" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:439" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:786" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:439" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:786" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:439" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:786" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:439" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:786: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:439: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:786" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:439" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -56194,16 +58467,16 @@ at_status=$? at_failed=false $at_check_filter 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:786" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:439" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:786: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:439: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:786" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:439" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -56212,7 +58485,7 @@ at_status=$? at_failed=false $at_check_filter 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:786" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:439" $at_failed && at_fn_log_failure $at_traceon; } @@ -56220,348 +58493,407 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:786: bison -o input.c --report=all input.y" -at_fn_check_prepare_trace "conflicts.at:786" -( $at_check_trace; bison -o input.c --report=all input.y +$as_echo "$at_srcdir/actions.at:439: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:439" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:786" -$at_failed && at_fn_log_failure -$at_traceon; } - -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - - # To avoid expanding it repeatedly, store specified stdout. - : >expout - - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror" "conflicts.at:786" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:786" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:439" $at_failed && at_fn_log_failure $at_traceon; } - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y: conflicts: 1 reduce/reduce -input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0' -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/conflicts.at:786: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:786" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 + { set +x +$as_echo "$at_srcdir/actions.at:439: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:439" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 0 $at_status "$at_srcdir/conflicts.at:786" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:439" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error" "conflicts.at:786" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=error +{ set +x +$as_echo "$at_srcdir/actions.at:439: \$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:439" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:786" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:439" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror" "conflicts.at:786" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y -Wnone -Werror +{ set +x +$as_echo "$at_srcdir/actions.at:442: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:442" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:786" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "6 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:442" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:786: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror" "conflicts.at:786" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c --report=all input.y --warnings=none -Werror +{ set +x +$as_echo "$at_srcdir/actions.at:442: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:442" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:786" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:442" $at_failed && at_fn_log_failure $at_traceon; } - at_restore_special_files -fi - -# Check the contents of the report. -{ set +x -$as_echo "$at_srcdir/conflicts.at:792: cat input.output" -at_fn_check_prepare_trace "conflicts.at:792" -( $at_check_trace; cat input.output -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_223 +#AT_START_224 +at_fn_group_banner 224 'actions.at:924' \ + "Printers and Destructors" " " 10 +at_xfail=no +( + $as_echo "224. $at_setup_line: testing $at_desc ..." + $at_traceon -Grammar - 0 \$accept: exp \$end - 1 exp: num - 2 | id +# Make sure complex $n work. - 3 num: '0' +# 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. - 4 id: '0' +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%code requires { +#include +#include +#include +#include -Terminals, with rules where they appear +#define YYINITDEPTH 10 +#define YYMAXDEPTH 10 +#define RANGE(Location) (Location).first_line, (Location).last_line -\$end (0) 0 -'0' (48) 3 4 -error (256) +/* Display the symbol type Symbol. */ +#define V(Symbol, Value, Location, Sep) \ + fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) +} +%define parse.error verbose +%debug +%verbose +%locations -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 +%code { -State 0 +static int yylex (void); +#include - 0 \$accept: . exp \$end - 1 exp: . num - 2 | . id - 3 num: . '0' - 4 id: . '0' +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif - '0' shift, and go to state 1 +static void yyerror (const char *msg); +} - exp go to state 2 - num go to state 3 - id go to state 4 -State 1 +/* FIXME: This %printer isn't actually tested. */ +%printer + { + fprintf (yyo, "%d", $$); + } + '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END - 3 num: '0' . [\$end] - 4 id: '0' . [\$end] +%destructor + { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } + input - \$end reduce using rule 3 (num) - \$end [reduce using rule 4 (id)] - \$default reduce using rule 3 (num) +%destructor + { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } + line +%destructor + { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } + thing -State 2 +%destructor + { fprintf (stderr, "Freeing raise thing (%d@%d-%d)\n", $$, RANGE (@$)); } + raise - 0 \$accept: exp . \$end +%destructor + { fprintf (stderr, "Freeing check-spontaneous-errors thing (%d@%d-%d)\n", $$, RANGE (@$)); } + check-spontaneous-errors - \$end shift, and go to state 5 +%destructor + { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'x' +%destructor + { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'y' -State 3 +%token END 0 +%destructor + { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } + END - 1 exp: num . +%% +/* + 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. +*/ - \$default reduce using rule 1 (exp) +input: + %empty + { + $$ = 0; + V(input, $$, @$, ": /* Nothing */\n"); + } +| line input /* Right recursive to load the stack so that popping at + END can be exercised. */ + { + $$ = 2; + V(input, $$, @$, ": "); + V(line, $1, @1, " "); + V(input, $2, @2, "\n"); + } +| '!' check-spontaneous-errors + { + $$ = $2; + } +; +check-spontaneous-errors: + raise { abort(); $$ = $1; } +| '(' raise ')' { abort(); $$ = $2; } +| error + { + $$ = 5; + V(check-spontaneous-errors, $$, @$, ": "); + fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); + } +; -State 4 +raise: + %empty + { + $$ = 4; + V(raise, $$, @$, ": %empty\n"); + YYERROR; + } +| '!' '!' + { + $$ = 5; + V(raise, $$, @$, ": "); + V(!, $1, @2, " "); + V(!, $2, @2, "\n"); + YYERROR; + } +; - 2 exp: id . +line: + thing thing thing ';' + { + $$ = $1; + V(line, $$, @$, ": "); + V(thing, $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(;, $4, @4, "\n"); + } +| '(' thing thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(')', $4, @4, "\n"); + } +| '(' thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(')', $3, @3, "\n"); + } +| '(' error ')' + { + $$ = -1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); + V(')', $3, @3, "\n"); + } +; - \$default reduce using rule 2 (exp) +thing: + 'x' + { + $$ = $1; + V(thing, $$, @$, ": "); + V('x', $1, @1, "\n"); + } +; +%% +/* Alias to ARGV[1]. */ +const char *source = YY_NULLPTR; -State 5 - 0 \$accept: exp \$end . +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif - \$default accept -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:792" -$at_failed && at_fn_log_failure -$at_traceon; } +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} +static +int yylex (void) +{ + static unsigned int counter = 0; - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_187 -#AT_START_188 -at_fn_group_banner 188 'conflicts.at:894' \ - "%expect not enough" " " 10 -at_xfail=no -( - $as_echo "188. $at_setup_line: testing $at_desc ..." - $at_traceon + unsigned 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; + assert (c <= strlen (source)); + if (source[c]) + fprintf (stderr, "sending: '%c'", source[c]); + else + fprintf (stderr, "sending: END"); + fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); + return source[c]; +} -cat >input.y <<'_ATEOF' -%token NUM OP -%expect 0 -%% -exp: exp OP exp | NUM; +int +main (int argc, const char *argv[]) +{ + int status; + yydebug = !!getenv ("YYDEBUG"); + assert (argc == 2); (void) argc; + source = argv[1]; + status = yyparse (); + switch (status) + { + case 0: fprintf (stderr, "Successful parse.\n"); break; + case 1: fprintf (stderr, "Parsing FAILED.\n"); break; + default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; + } + return status; +} _ATEOF -{ set +x -$as_echo "$at_srcdir/conflicts.at:903: 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:903" -( $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" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce -input.y: error: 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:903" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_188 -#AT_START_189 -at_fn_group_banner 189 'conflicts.at:914' \ - "%expect right" " " 10 -at_xfail=no -( - $as_echo "189. $at_setup_line: testing $at_desc ..." - $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 at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:923: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:923" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:924: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:924" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:923" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:923: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:923" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:924: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:924" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:923" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:923: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:924: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:923" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:924" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -56570,16 +58902,16 @@ at_status=$? at_failed=false $at_check_filter 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:923" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:923: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:924: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:923" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:924" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -56588,7 +58920,7 @@ at_status=$? at_failed=false $at_check_filter 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:923" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } @@ -56596,392 +58928,776 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:923: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:923" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:924: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:924" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:923" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_189 -#AT_START_190 -at_fn_group_banner 190 'conflicts.at:931' \ - "%expect too much" " " 10 -at_xfail=no -( - $as_echo "190. $at_setup_line: testing $at_desc ..." - $at_traceon - + { set +x +$as_echo "$at_srcdir/actions.at:924: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:924" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:924" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input.y <<'_ATEOF' -%token NUM OP -%expect 2 -%% -exp: exp OP exp | NUM; -_ATEOF +{ set +x +$as_echo "$at_srcdir/actions.at:924: \$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:924" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:924" +$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/conflicts.at:940: 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:940" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:924: \$PREPARSER ./input '(x)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:924" +( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce -input.y: error: expected 2 shift/reduce conflicts -" | \ - $at_diff - "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:940" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_190 -#AT_START_191 -at_fn_group_banner 191 'conflicts.at:951' \ - "%expect with reduce conflicts" " " 10 -at_xfail=no -( - $as_echo "191. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' -%expect 0 -%% -program: a 'a' | a a; -a: 'a'; -_ATEOF - - - { set +x -$as_echo "$at_srcdir/conflicts.at:960: 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:960" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:924: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:924" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce -input.y: error: expected 0 reduce/reduce conflicts +echo >>"$at_stderr"; $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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:960" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_191 -#AT_START_192 -at_fn_group_banner 192 'conflicts.at:971' \ - "%prec with user string" " " 10 -at_xfail=no -( - $as_echo "192. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' -%% -exp: - "foo" %prec "foo" -; -_ATEOF - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:980: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:980" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +# Check the location of empty reductions raising an error +# ------------------------------------------------------- +# Here, the error is after token "!@0-9", so the error is raised from +# @9-9, and the error recovery detects that it starts from @9-9 and +# ends where starts the next token: END@10-19. +# +# So error recovery reports error@9-19. +{ set +x +$as_echo "$at_srcdir/actions.at:924: \$PREPARSER ./input '!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:924" +( $at_check_trace; $PREPARSER ./input '!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:980" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:980: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:980" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +{ set +x +$as_echo "$at_srcdir/actions.at:924: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:924" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:980" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: END (1@10-19) +raise (4@9-9): %empty +check-spontaneous-errors (5@9-19): error (@9-19) +Freeing token END (1@10-19) +Freeing nterm input (5@0-19) +Successful parse. +" | \ + $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:924" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.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' "conflicts.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 + + +# Check the location of not empty reductions raising an error +# ----------------------------------------------------------- +# This time the error is raised from a rule with 2 rhs symbols: @10-29. +# It is recovered @10-29. +{ set +x +$as_echo "$at_srcdir/actions.at:924: \$PREPARSER ./input '!!!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:924" +( $at_check_trace; $PREPARSER ./input '!!!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:980" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.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 | sort +{ set +x +$as_echo "$at_srcdir/actions.at:924: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:924" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:980" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: '!' (1@10-19) +sending: '!' (2@20-29) +raise (5@10-29): ! (1@20-29) ! (2@20-29) +check-spontaneous-errors (5@10-29): error (@10-29) +sending: END (3@30-39) +Freeing token END (3@30-39) +Freeing nterm input (5@0-29) +Successful parse. +" | \ + $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:924" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi -{ set +x -$as_echo "$at_srcdir/conflicts.at:980: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:980" -( $at_check_trace; bison -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- + + +# 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:924: \$PREPARSER ./input '(y)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:924" +( $at_check_trace; $PREPARSER ./input '(y)' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:980" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/actions.at:924: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:924" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) +sending: 'y' (1@10-19) +10.10-19.18: 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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" +$at_failed && at_fn_log_failure +$at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_192 -#AT_START_193 -at_fn_group_banner 193 'conflicts.at:988' \ - "%no-default-prec without %prec" " " 10 -at_xfail=no -( - $as_echo "193. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' -%left '+' -%left '*' - -%% -%no-default-prec; -e: e '+' e - | e '*' e - | '0' - ; -_ATEOF +# 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:924: \$PREPARSER ./input '(xxxxx)(x)(x)y'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:924" +( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:924" +$at_failed && at_fn_log_failure +$at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1004: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1004" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +{ set +x +$as_echo "$at_srcdir/actions.at:924: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:924" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1004" +echo >>"$at_stderr"; $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.30-39.38: 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.130-139.138: syntax error, unexpected 'y', expecting END +Freeing nterm input (2@0-129) +Freeing token 'y' (13@130-139) +Parsing FAILED. +" | \ + $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:924" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1004: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1004" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y + + + +# 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:924: \$PREPARSER ./input '(x)(x)x'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:924" +( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1004" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1004: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1004" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml +{ set +x +$as_echo "$at_srcdir/actions.at:924: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:924" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1004" +echo >>"$at_stderr"; $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.70-79.78: 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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1004: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1004" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort + + + +# 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:924: \$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:924" +( $at_check_trace; $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1004" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/conflicts.at:1004: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:1004" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:924: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:924" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 4 shift/reduce +echo >>"$at_stderr"; $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.200-209.208: 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1004" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:924" $at_failed && at_fn_log_failure $at_traceon; } + + + + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_193 -#AT_START_194 -at_fn_group_banner 194 'conflicts.at:1014' \ - "%no-default-prec with %prec" " " 10 +#AT_STOP_224 +#AT_START_225 +at_fn_group_banner 225 'actions.at:925' \ + "Printers and Destructors with union" " " 10 at_xfail=no ( - $as_echo "194. $at_setup_line: testing $at_desc ..." + $as_echo "225. $at_setup_line: testing $at_desc ..." $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. + cat >input.y <<'_ATEOF' -%left '+' -%left '*' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code requires { +#include +#include +#include +#include + +#define YYINITDEPTH 10 +#define YYMAXDEPTH 10 +#define RANGE(Location) (Location).first_line, (Location).last_line + +/* Display the symbol type Symbol. */ +#define V(Symbol, Value, Location, Sep) \ + fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) +} + +%define parse.error verbose +%debug +%verbose +%locations + +%union +{ + int ival; +} + +%code provides { + +static int yylex (void); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); +} + +%type '(' 'x' 'y' ')' ';' thing line input + '!' raise check-spontaneous-errors END + +/* FIXME: This %printer isn't actually tested. */ +%printer + { + fprintf (yyo, "%d", $$); + } + '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END + +%destructor + { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } + input + +%destructor + { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } + line + +%destructor + { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } + thing + +%destructor + { fprintf (stderr, "Freeing raise thing (%d@%d-%d)\n", $$, RANGE (@$)); } + raise + +%destructor + { fprintf (stderr, "Freeing check-spontaneous-errors thing (%d@%d-%d)\n", $$, RANGE (@$)); } + check-spontaneous-errors + +%destructor + { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'x' + +%destructor + { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'y' + +%token END 0 +%destructor + { fprintf (stderr, "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. +*/ -%no-default-prec; +input: + %empty + { + $$ = 0; + V(input, $$, @$, ": /* Nothing */\n"); + } +| line input /* Right recursive to load the stack so that popping at + END can be exercised. */ + { + $$ = 2; + V(input, $$, @$, ": "); + V(line, $1, @1, " "); + V(input, $2, @2, "\n"); + } +| '!' check-spontaneous-errors + { + $$ = $2; + } +; -e: e '+' e %prec '+' - | e '*' e %prec '*' - | '0' - ; +check-spontaneous-errors: + raise { abort(); $$ = $1; } +| '(' raise ')' { abort(); $$ = $2; } +| error + { + $$ = 5; + V(check-spontaneous-errors, $$, @$, ": "); + fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); + } +; + +raise: + %empty + { + $$ = 4; + V(raise, $$, @$, ": %empty\n"); + YYERROR; + } +| '!' '!' + { + $$ = 5; + V(raise, $$, @$, ": "); + V(!, $1, @2, " "); + V(!, $2, @2, "\n"); + YYERROR; + } +; + +line: + thing thing thing ';' + { + $$ = $1; + V(line, $$, @$, ": "); + V(thing, $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(;, $4, @4, "\n"); + } +| '(' thing thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(')', $4, @4, "\n"); + } +| '(' thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(')', $3, @3, "\n"); + } +| '(' error ')' + { + $$ = -1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); + V(')', $3, @3, "\n"); + } +; + +thing: + 'x' + { + $$ = $1; + V(thing, $$, @$, ": "); + V('x', $1, @1, "\n"); + } +; +%% +/* Alias to ARGV[1]. */ +const char *source = YY_NULLPTR; + + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} + +static +int yylex (void) +{ + static unsigned int counter = 0; + + unsigned 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; + assert (c <= strlen (source)); + if (source[c]) + fprintf (stderr, "sending: '%c'", source[c]); + else + fprintf (stderr, "sending: END"); + fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); + return source[c]; +} + + +int +main (int argc, const char *argv[]) +{ + int status; + yydebug = !!getenv ("YYDEBUG"); + assert (argc == 2); (void) argc; + source = argv[1]; + status = yyparse (); + switch (status) + { + case 0: fprintf (stderr, "Successful parse.\n"); break; + case 1: fprintf (stderr, "Parsing FAILED.\n"); break; + default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; + } + return status; +} _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1030: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1030" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/actions.at:925: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:925" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1030" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:1030: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1030" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/actions.at:925: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:925" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1030" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:1030: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:925: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1030" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:925" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -56990,16 +59706,16 @@ at_status=$? at_failed=false $at_check_filter 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:1030" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:1030: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:925: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1030" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:925" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -57008,7 +59724,7 @@ at_status=$? at_failed=false $at_check_filter 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:1030" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } @@ -57016,575 +59732,697 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:1030: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:1030" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:925: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:925" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1030" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_194 -#AT_START_195 -at_fn_group_banner 195 'conflicts.at:1038' \ - "%default-prec" " " 10 -at_xfail=no -( - $as_echo "195. $at_setup_line: testing $at_desc ..." - $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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1054: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1054" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y + { set +x +$as_echo "$at_srcdir/actions.at:925: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:925" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1054" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1054: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1054" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +{ set +x +$as_echo "$at_srcdir/actions.at:925: \$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:925" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1054" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.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' "conflicts.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 + + +# 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:925: \$PREPARSER ./input '(x)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:925" +( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1054" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.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 | sort +{ set +x +$as_echo "$at_srcdir/actions.at:925: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:925" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1054" +echo >>"$at_stderr"; $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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + + +# Check the location of empty reductions raising an error +# ------------------------------------------------------- +# Here, the error is after token "!@0-9", so the error is raised from +# @9-9, and the error recovery detects that it starts from @9-9 and +# ends where starts the next token: END@10-19. +# +# So error recovery reports error@9-19. { set +x -$as_echo "$at_srcdir/conflicts.at:1054: bison -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:1054" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/actions.at:925: \$PREPARSER ./input '!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:925" +( $at_check_trace; $PREPARSER ./input '!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1054" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_195 -#AT_START_196 -at_fn_group_banner 196 'conflicts.at:1062' \ - "Unreachable States After Conflict Resolution" " " 10 -at_xfail=no -( - $as_echo "196. $at_setup_line: testing $at_desc ..." - $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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1106" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all input.y +{ set +x +$as_echo "$at_srcdir/actions.at:925: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:925" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1106" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: END (1@10-19) +raise (4@9-9): %empty +check-spontaneous-errors (5@9-19): error (@9-19) +Freeing token END (1@10-19) +Freeing nterm input (5@0-19) +Successful parse. +" | \ + $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:925" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" "conflicts.at:1106" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y + + +# Check the location of not empty reductions raising an error +# ----------------------------------------------------------- +# This time the error is raised from a rule with 2 rhs symbols: @10-29. +# It is recovered @10-29. +{ set +x +$as_echo "$at_srcdir/actions.at:925: \$PREPARSER ./input '!!!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:925" +( $at_check_trace; $PREPARSER ./input '!!!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1106" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1106: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1106" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml +{ set +x +$as_echo "$at_srcdir/actions.at:925: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:925" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1106" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: '!' (1@10-19) +sending: '!' (2@20-29) +raise (5@10-29): ! (1@20-29) ! (2@20-29) +check-spontaneous-errors (5@10-29): error (@10-29) +sending: END (3@30-39) +Freeing token END (3@30-39) +Freeing nterm input (5@0-29) +Successful parse. +" | \ + $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:925" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1106: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1106" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort + + +# 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:925: \$PREPARSER ./input '(y)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:925" +( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1106" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/conflicts.at:1106: bison --report=all input.y" -at_fn_check_prepare_trace "conflicts.at:1106" -( $at_check_trace; bison --report=all input.y +$as_echo "$at_srcdir/actions.at:925: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:925" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 */ +echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) +sending: 'y' (1@10-19) +10.10-19.18: 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1106" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - # To avoid expanding it repeatedly, store specified stdout. - : >expout - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Werror" "conflicts.at:1106" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y -Werror + +# 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:925: \$PREPARSER ./input '(xxxxx)(x)(x)y'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:925" +( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1106" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -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 */ -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/conflicts.at:1106: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1106" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 +{ set +x +$as_echo "$at_srcdir/actions.at:925: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:925" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $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.30-39.38: 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.130-139.138: syntax error, unexpected 'y', expecting END +Freeing nterm input (2@0-129) +Freeing token 'y' (13@130-139) +Parsing FAILED. +" | \ + $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:1106" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error" "conflicts.at:1106" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y --warnings=error + + +# 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:925: \$PREPARSER ./input '(x)(x)x'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:925" +( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1106" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror" "conflicts.at:1106" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y -Wnone -Werror +{ set +x +$as_echo "$at_srcdir/actions.at:925: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:925" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1106" +echo >>"$at_stderr"; $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.70-79.78: 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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1106: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror" "conflicts.at:1106" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all input.y --warnings=none -Werror + + + +# 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:925: \$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:925" +( $at_check_trace; $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1106" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/actions.at:925" $at_failed && at_fn_log_failure $at_traceon; } - - at_restore_special_files -fi - { set +x -$as_echo "$at_srcdir/conflicts.at:1117: cat input.output" -at_fn_check_prepare_trace "conflicts.at:1117" -( $at_check_trace; cat input.output +$as_echo "$at_srcdir/actions.at:925: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:925" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 +echo >>"$at_stderr"; $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.200-209.208: 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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:925" +$at_failed && at_fn_log_failure +$at_traceon; } - 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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_225 +#AT_START_226 +at_fn_group_banner 226 'actions.at:927' \ + "Printers and Destructors: %defines lalr1.cc" " " 10 +at_xfail=no +( + $as_echo "226. $at_setup_line: testing $at_desc ..." + $at_traceon -Grammar - 0 \$accept: start \$end - 1 start: resolved_conflict 'a' reported_conflicts 'a' +# Make sure complex $n work. - 2 resolved_conflict: 'a' unreachable1 - 3 | /* empty */ +# 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. - 4 unreachable1: 'a' unreachable2 - 5 | /* empty */ +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} - 6 unreachable2: /* empty */ - 7 | /* empty */ +%code requires { +#include +#include +#include +#include - 8 reported_conflicts: 'a' - 9 | 'a' - 10 | /* empty */ +#define YYINITDEPTH 10 +#define YYMAXDEPTH 10 +#define RANGE(Location) (Location).begin.line, (Location).end.line +/* Display the symbol type Symbol. */ +#define V(Symbol, Value, Location, Sep) \ + fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) +} -Terminals, with rules where they appear +%define parse.error verbose +%debug +%verbose +%locations +%defines %skeleton "lalr1.cc" -\$end (0) 0 -'a' (97) 1 2 4 8 9 -error (256) +%define global_tokens_and_yystype +%code { +typedef yy::location YYLTYPE; +static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} -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 +/* FIXME: This %printer isn't actually tested. */ +%printer + { + yyo << $$;; + } + '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END -State 0 +%destructor + { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } + input - 0 \$accept: . start \$end - 1 start: . resolved_conflict 'a' reported_conflicts 'a' - 2 resolved_conflict: . 'a' unreachable1 - 3 | . ['a'] +%destructor + { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } + line - \$default reduce using rule 3 (resolved_conflict) +%destructor + { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } + thing - start go to state 1 - resolved_conflict go to state 2 +%destructor + { fprintf (stderr, "Freeing raise thing (%d@%d-%d)\n", $$, RANGE (@$)); } + raise - Conflict between rule 3 and token 'a' resolved as reduce (%left 'a'). +%destructor + { fprintf (stderr, "Freeing check-spontaneous-errors thing (%d@%d-%d)\n", $$, RANGE (@$)); } + check-spontaneous-errors +%destructor + { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'x' -State 1 +%destructor + { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'y' - 0 \$accept: start . \$end +%token END 0 +%destructor + { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } + END - \$end shift, and go to state 3 +%% +/* + 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: + %empty + { + $$ = 0; + V(input, $$, @$, ": /* Nothing */\n"); + } +| line input /* Right recursive to load the stack so that popping at + END can be exercised. */ + { + $$ = 2; + V(input, $$, @$, ": "); + V(line, $1, @1, " "); + V(input, $2, @2, "\n"); + } +| '!' check-spontaneous-errors + { + $$ = $2; + } +; -State 2 +check-spontaneous-errors: + raise { abort(); $$ = $1; } +| '(' raise ')' { abort(); $$ = $2; } +| error + { + $$ = 5; + V(check-spontaneous-errors, $$, @$, ": "); + fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); + } +; - 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' +raise: + %empty + { + $$ = 4; + V(raise, $$, @$, ": %empty\n"); + YYERROR; + } +| '!' '!' + { + $$ = 5; + V(raise, $$, @$, ": "); + V(!, $1, @2, " "); + V(!, $2, @2, "\n"); + YYERROR; + } +; - 'a' shift, and go to state 7 +line: + thing thing thing ';' + { + $$ = $1; + V(line, $$, @$, ": "); + V(thing, $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(;, $4, @4, "\n"); + } +| '(' thing thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(')', $4, @4, "\n"); + } +| '(' thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(')', $3, @3, "\n"); + } +| '(' error ')' + { + $$ = -1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); + V(')', $3, @3, "\n"); + } +; +thing: + 'x' + { + $$ = $1; + V(thing, $$, @$, ": "); + V('x', $1, @1, "\n"); + } +; +%% +/* Alias to ARGV[1]. */ +const char *source = YY_NULLPTR; -State 7 +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} - 1 start: resolved_conflict 'a' reported_conflicts 'a' . +static +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + static unsigned int counter = 0; - \$default reduce using rule 1 (start) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1117" -$at_failed && at_fn_log_failure -$at_traceon; } + unsigned 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; + assert (c <= strlen (source)); + if (source[c]) + fprintf (stderr, "sending: '%c'", source[c]); + else + fprintf (stderr, "sending: END"); + fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp))); + return source[c]; +} +static bool yydebug; +int +yyparse () +{ + yy::parser parser; + parser.set_debug_level (yydebug); + return parser.parse (); +} -cat >input-keep.y <<'_ATEOF' -%define lr.keep-unreachable-states +int +main (int argc, const char *argv[]) +{ + int status; + yydebug = !!getenv ("YYDEBUG"); + assert (argc == 2); (void) argc; + source = argv[1]; + status = yyparse (); + switch (status) + { + case 0: fprintf (stderr, "Successful parse.\n"); break; + case 1: fprintf (stderr, "Parsing FAILED.\n"); break; + default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; + } + return status; +} _ATEOF -{ set +x -$as_echo "$at_srcdir/conflicts.at:1256: cat input.y >> input-keep.y" -at_fn_check_prepare_trace "conflicts.at:1256" -( $at_check_trace; cat input.y >> input-keep.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:1256" -$at_failed && at_fn_log_failure -$at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then @@ -57593,39 +60431,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1258" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot input-keep.y +$as_echo "$at_srcdir/actions.at:927: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:927" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1258" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y" "conflicts.at:1258" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml input-keep.y +$as_echo "$at_srcdir/actions.at:927: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:927" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1258" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:1258: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:927: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1258" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:927" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -57634,16 +60472,16 @@ at_status=$? at_failed=false $at_check_filter 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:1258" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:1258: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:927: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1258" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:927" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -57652,7 +60490,7 @@ at_status=$? at_failed=false $at_check_filter 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:1258" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } @@ -57660,573 +60498,671 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:1258: bison input-keep.y" -at_fn_check_prepare_trace "conflicts.at:1258" -( $at_check_trace; bison input-keep.y +$as_echo "$at_srcdir/actions.at:927: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "actions.at:927" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1258" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - # To avoid expanding it repeatedly, store specified stdout. - : >expout - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Werror" "conflicts.at:1258" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y -Werror +{ set +x +$as_echo "$at_srcdir/actions.at:927: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:927" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1258" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -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 */ -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/conflicts.at:1258: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1258" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 +{ set +x +$as_echo "$at_srcdir/actions.at:927: \$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:927" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 0 $at_status "$at_srcdir/conflicts.at:1258" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=error" "conflicts.at:1258" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y --warnings=error -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1258" -$at_failed && at_fn_log_failure -$at_traceon; } - - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror" "conflicts.at:1258" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y -Wnone -Werror +# 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:927: \$PREPARSER ./input '(x)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:927" +( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1258" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror" "conflicts.at:1258" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input-keep.y --warnings=none -Werror +{ set +x +$as_echo "$at_srcdir/actions.at:927: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:927" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1258" +echo >>"$at_stderr"; $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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - at_restore_special_files -fi - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_196 -#AT_START_197 -at_fn_group_banner 197 'conflicts.at:1273' \ - "Solved conflicts report for multiple reductions in a state" "" 10 -at_xfail=no -( - $as_echo "197. $at_setup_line: testing $at_desc ..." - $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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1299" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all -o input.c input.y +# Check the location of empty reductions raising an error +# ------------------------------------------------------- +# Here, the error is after token "!@0-9", so the error is raised from +# @9-9, and the error recovery detects that it starts from @9-9 and +# ends where starts the next token: END@10-19. +# +# So error recovery reports error@9-19. +{ set +x +$as_echo "$at_srcdir/actions.at:927: \$PREPARSER ./input '!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:927" +( $at_check_trace; $PREPARSER ./input '!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1299" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1299: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1299" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y +{ set +x +$as_echo "$at_srcdir/actions.at:927: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:927" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1299" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: END (1@10-19) +raise (4@9-9): %empty +check-spontaneous-errors (5@9-19): error (@9-19) +Freeing token END (1@10-19) +Freeing nterm input (5@0-19) +Successful parse. +" | \ + $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:927" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1299: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1299" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml + + +# Check the location of not empty reductions raising an error +# ----------------------------------------------------------- +# This time the error is raised from a rule with 2 rhs symbols: @10-29. +# It is recovered @10-29. +{ set +x +$as_echo "$at_srcdir/actions.at:927: \$PREPARSER ./input '!!!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:927" +( $at_check_trace; $PREPARSER ./input '!!!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1299" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1299: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1299" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort +{ set +x +$as_echo "$at_srcdir/actions.at:927: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:927" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1299" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: '!' (1@10-19) +sending: '!' (2@20-29) +raise (5@10-29): ! (1@20-29) ! (2@20-29) +check-spontaneous-errors (5@10-29): error (@10-29) +sending: END (3@30-39) +Freeing token END (3@30-39) +Freeing nterm input (5@0-29) +Successful parse. +" | \ + $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:927" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + + +# 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/conflicts.at:1299: bison --report=all -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:1299" -( $at_check_trace; bison --report=all -o input.c input.y +$as_echo "$at_srcdir/actions.at:927: \$PREPARSER ./input '(y)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:927" +( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1299" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1300: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1300" -( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p' +$as_echo "$at_srcdir/actions.at:927: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:927" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 +echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) +sending: 'y' (1@10-19) +10.10-19.18: 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/conflicts.at:1300" + $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:927" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_197 -#AT_START_198 -at_fn_group_banner 198 'conflicts.at:1353' \ - "%nonassoc error actions for multiple reductions in a state" "" 10 -at_xfail=no -( - $as_echo "198. $at_setup_line: testing $at_desc ..." - $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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1375: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1375" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all -o input.c input.y +# 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:927: \$PREPARSER ./input '(xxxxx)(x)(x)y'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:927" +( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1375" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1375: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1375" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all -o input.c input.y +{ set +x +$as_echo "$at_srcdir/actions.at:927: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:927" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1375" +echo >>"$at_stderr"; $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.30-39.38: 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.130-139.138: syntax error, unexpected 'y', expecting END +Freeing nterm input (2@0-129) +Freeing token 'y' (13@130-139) +Parsing FAILED. +" | \ + $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:927" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1375: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1375" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1375" -$at_failed && at_fn_log_failure -$at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1375: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1375" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort + + +# 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:927: \$PREPARSER ./input '(x)(x)x'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:927" +( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1375" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/conflicts.at:1375: bison --report=all -o input.c input.y" -at_fn_check_prepare_trace "conflicts.at:1375" -( $at_check_trace; bison --report=all -o input.c input.y +$as_echo "$at_srcdir/actions.at:927: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:927" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo >>"$at_stderr"; $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.70-79.78: 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1375" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:927" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/conflicts.at:1376: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'" -at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1376" -( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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)] +# Check destruction upon stack overflow +# ------------------------------------- +# Upon stack overflow, all symbols on the stack should be destroyed. +# Only check for yacc.c. - 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:1376" -$at_failed && at_fn_log_failure -$at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_198 -#AT_START_199 -at_fn_group_banner 199 'conflicts.at:1422' \ - "-W versus %expect and %expect-rr" " " 10 +#AT_STOP_226 +#AT_START_227 +at_fn_group_banner 227 'actions.at:928' \ + "Printers and Destructors with union: %defines lalr1.cc" "" 10 at_xfail=no ( - $as_echo "199. $at_setup_line: testing $at_desc ..." + $as_echo "227. $at_setup_line: testing $at_desc ..." $at_traceon -cat >sr-rr.y <<'_ATEOF' -%glr-parser -%% -start: 'a' | A 'a' | B 'a' ; -A: ; -B: ; -_ATEOF -cat >sr.y <<'_ATEOF' -%glr-parser +# 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. + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code requires { +#include +#include +#include +#include + +#define YYINITDEPTH 10 +#define YYMAXDEPTH 10 +#define RANGE(Location) (Location).begin.line, (Location).end.line + +/* Display the symbol type Symbol. */ +#define V(Symbol, Value, Location, Sep) \ + fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) +} + +%define parse.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 (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); + +} + +%type '(' 'x' 'y' ')' ';' thing line input + '!' raise check-spontaneous-errors END + +/* FIXME: This %printer isn't actually tested. */ +%printer + { + yyo << $$;; + } + '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END + +%destructor + { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } + input + +%destructor + { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } + line + +%destructor + { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } + thing + +%destructor + { fprintf (stderr, "Freeing raise thing (%d@%d-%d)\n", $$, RANGE (@$)); } + raise + +%destructor + { fprintf (stderr, "Freeing check-spontaneous-errors thing (%d@%d-%d)\n", $$, RANGE (@$)); } + check-spontaneous-errors + +%destructor + { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'x' + +%destructor + { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'y' + +%token END 0 +%destructor + { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } + END + %% -start: 'a' | A 'a' ; -A: ; -_ATEOF +/* + 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. +*/ -cat >rr.y <<'_ATEOF' -%glr-parser +input: + %empty + { + $$ = 0; + V(input, $$, @$, ": /* Nothing */\n"); + } +| line input /* Right recursive to load the stack so that popping at + END can be exercised. */ + { + $$ = 2; + V(input, $$, @$, ": "); + V(line, $1, @1, " "); + V(input, $2, @2, "\n"); + } +| '!' check-spontaneous-errors + { + $$ = $2; + } +; + +check-spontaneous-errors: + raise { abort(); $$ = $1; } +| '(' raise ')' { abort(); $$ = $2; } +| error + { + $$ = 5; + V(check-spontaneous-errors, $$, @$, ": "); + fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); + } +; + +raise: + %empty + { + $$ = 4; + V(raise, $$, @$, ": %empty\n"); + YYERROR; + } +| '!' '!' + { + $$ = 5; + V(raise, $$, @$, ": "); + V(!, $1, @2, " "); + V(!, $2, @2, "\n"); + YYERROR; + } +; + +line: + thing thing thing ';' + { + $$ = $1; + V(line, $$, @$, ": "); + V(thing, $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(;, $4, @4, "\n"); + } +| '(' thing thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(')', $4, @4, "\n"); + } +| '(' thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(')', $3, @3, "\n"); + } +| '(' error ')' + { + $$ = -1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); + V(')', $3, @3, "\n"); + } +; + +thing: + 'x' + { + $$ = $1; + V(thing, $$, @$, ": "); + V('x', $1, @1, "\n"); + } +; %% -start: A | B ; -A: ; -B: ; +/* Alias to ARGV[1]. */ +const char *source = YY_NULLPTR; + +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} + +static +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + static unsigned int counter = 0; + + unsigned 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; + assert (c <= strlen (source)); + if (source[c]) + fprintf (stderr, "sending: '%c'", source[c]); + else + fprintf (stderr, "sending: END"); + fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp))); + return source[c]; +} +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); (void) argc; + source = argv[1]; + status = yyparse (); + switch (status) + { + case 0: fprintf (stderr, "Successful parse.\n"); break; + case 1: fprintf (stderr, "Parsing FAILED.\n"); break; + default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; + } + return status; +} _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1445: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot sr-rr.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1445" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot sr-rr.y +$as_echo "$at_srcdir/actions.at:928: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:928" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1445" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/conflicts.at:1445: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y" "conflicts.at:1445" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml sr-rr.y +$as_echo "$at_srcdir/actions.at:928: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:928" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1445" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/conflicts.at:1445: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:928: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1445" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:928" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -58235,16 +61171,16 @@ at_status=$? at_failed=false $at_check_filter 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:1445" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/conflicts.at:1445: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:928: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1445" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:928" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -58253,7 +61189,7 @@ at_status=$? at_failed=false $at_check_filter 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:1445" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } @@ -58261,480 +61197,391 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/conflicts.at:1445: bison sr-rr.y" -at_fn_check_prepare_trace "conflicts.at:1445" -( $at_check_trace; bison sr-rr.y +$as_echo "$at_srcdir/actions.at:928: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "actions.at:928" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 shift/reduce, 1 reduce/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1445" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Wno-conflicts-sr sr-rr.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1448" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Wno-conflicts-sr sr-rr.y + +{ set +x +$as_echo "$at_srcdir/actions.at:928: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:928" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1448" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" "conflicts.at:1448" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y +{ set +x +$as_echo "$at_srcdir/actions.at:928: \$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:928" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1448" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1448: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1448" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml + + +# 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:928: \$PREPARSER ./input '(x)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:928" +( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1448" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1448: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1448" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort +{ set +x +$as_echo "$at_srcdir/actions.at:928: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:928" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1448" +echo >>"$at_stderr"; $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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + + +# Check the location of empty reductions raising an error +# ------------------------------------------------------- +# Here, the error is after token "!@0-9", so the error is raised from +# @9-9, and the error recovery detects that it starts from @9-9 and +# ends where starts the next token: END@10-19. +# +# So error recovery reports error@9-19. { set +x -$as_echo "$at_srcdir/conflicts.at:1448: bison -Wno-conflicts-sr sr-rr.y" -at_fn_check_prepare_trace "conflicts.at:1448" -( $at_check_trace; bison -Wno-conflicts-sr sr-rr.y +$as_echo "$at_srcdir/actions.at:928: \$PREPARSER ./input '!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:928" +( $at_check_trace; $PREPARSER ./input '!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 reduce/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1448" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Wno-conflicts-rr sr-rr.y" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1451" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Wno-conflicts-rr sr-rr.y +{ set +x +$as_echo "$at_srcdir/actions.at:928: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:928" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1451" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: END (1@10-19) +raise (4@9-9): %empty +check-spontaneous-errors (5@9-19): error (@9-19) +Freeing token END (1@10-19) +Freeing nterm input (5@0-19) +Successful parse. +" | \ + $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:928" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" "conflicts.at:1451" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y + + +# Check the location of not empty reductions raising an error +# ----------------------------------------------------------- +# This time the error is raised from a rule with 2 rhs symbols: @10-29. +# It is recovered @10-29. +{ set +x +$as_echo "$at_srcdir/actions.at:928: \$PREPARSER ./input '!!!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:928" +( $at_check_trace; $PREPARSER ./input '!!!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1451" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1451: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1451" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml +{ set +x +$as_echo "$at_srcdir/actions.at:928: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:928" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1451" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: '!' (1@10-19) +sending: '!' (2@20-29) +raise (5@10-29): ! (1@20-29) ! (2@20-29) +check-spontaneous-errors (5@10-29): error (@10-29) +sending: END (3@30-39) +Freeing token END (3@30-39) +Freeing nterm input (5@0-29) +Successful parse. +" | \ + $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:928" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1451: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1451" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort + + +# 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:928: \$PREPARSER ./input '(y)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:928" +( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1451" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/conflicts.at:1451: bison -Wno-conflicts-rr sr-rr.y" -at_fn_check_prepare_trace "conflicts.at:1451" -( $at_check_trace; bison -Wno-conflicts-rr sr-rr.y +$as_echo "$at_srcdir/actions.at:928: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:928" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "sr-rr.y: conflicts: 1 shift/reduce +echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) +sending: 'y' (1@10-19) +10.10-19.18: 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1451" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } -for gram in sr-rr sr rr; do - for sr_exp_i in '' 0 1 2; do - for rr_exp_i in '' 0 1 2; do - test -z "$sr_exp_i" && test -z "$rr_exp_i" && continue - - # Build grammar file. - sr_exp=0 - rr_exp=0 - file=$gram - directives= - if test -n "$sr_exp_i"; then - sr_exp=$sr_exp_i - file=$file-expect-$sr_exp - directives="%expect $sr_exp" - fi - if test -n "$rr_exp_i"; then - rr_exp=$rr_exp_i - file=$file-expect-rr-$rr_exp - directives="$directives %expect-rr $rr_exp" - fi - file=$file.y - echo "$directives" > $file - cat $gram.y >> $file - - # Count actual conflicts. - conflicts= - sr_count=0 - rr_count=0 - if test $gram = sr || test $gram = sr-rr; then - conflicts="1 shift/reduce" - sr_count=1 - fi - if test $gram = rr || test $gram = sr-rr; then - if test -n "$conflicts"; then - conflicts="$conflicts, " - fi - conflicts="${conflicts}1 reduce/reduce" - rr_count=1 - fi - # Run tests. - if test $sr_count -eq $sr_exp && test $rr_count -eq $rr_exp; then - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Wnone \$file" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1497" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Wnone $file +# 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:928: \$PREPARSER ./input '(xxxxx)(x)(x)y'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:928" +( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1497" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/conflicts.at:1497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone \$file" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone $file" "conflicts.at:1497" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Wnone $file +{ set +x +$as_echo "$at_srcdir/actions.at:928: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:928" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1497" -$at_failed && at_fn_log_failure -$at_traceon; } - - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1497: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1497" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1497" -$at_failed && at_fn_log_failure -$at_traceon; } - - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1497: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1497" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1497" -$at_failed && at_fn_log_failure -$at_traceon; } - - rm -rf xml-tests expout - at_restore_special_files -fi -{ set +x -$as_echo "$at_srcdir/conflicts.at:1497: bison -Wnone \$file" -at_fn_check_prepare_dynamic "bison -Wnone $file" "conflicts.at:1497" -( $at_check_trace; bison -Wnone $file -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $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.30-39.38: 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.130-139.138: syntax error, unexpected 'y', expecting END +Freeing nterm input (2@0-129) +Freeing token 'y' (13@130-139) +Parsing FAILED. +" | \ + $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:1497" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Werror \$file" -at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1498" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Werror $file -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1498" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/conflicts.at:1498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror \$file" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror $file" "conflicts.at:1498" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Werror $file -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1498" -$at_failed && at_fn_log_failure -$at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1498: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1498" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1498" -$at_failed && at_fn_log_failure -$at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/conflicts.at:1498: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1498" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort +# 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:928: \$PREPARSER ./input '(x)(x)x'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:928" +( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1498" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/conflicts.at:1498: bison -Werror \$file" -at_fn_check_prepare_dynamic "bison -Werror $file" "conflicts.at:1498" -( $at_check_trace; bison -Werror $file +$as_echo "$at_srcdir/actions.at:928: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:928" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $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.70-79.78: 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1498" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:928" $at_failed && at_fn_log_failure $at_traceon; } - else - echo "$file: conflicts: $conflicts" > experr - if test $sr_count -ne $sr_exp; then - if test $sr_exp -ne 1; then s=s; else s= ; fi - echo "$file: error: expected $sr_exp shift/reduce conflict$s" >> experr - fi - if test $rr_count -ne $rr_exp; then - if test $rr_exp -ne 1; then s=s; else s= ; fi - echo "$file: error: expected $rr_exp reduce/reduce conflict$s" >> experr - fi -{ set +x -$as_echo "$at_srcdir/conflicts.at:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wnone \$file" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Wnone $file" "conflicts.at:1509" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Wnone $file -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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/conflicts.at:1509" -$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/conflicts.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror \$file" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -Werror $file" "conflicts.at:1510" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -Werror $file -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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/conflicts.at:1510" -$at_failed && at_fn_log_failure -$at_traceon; } - fi - done - done -done set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_199 -#AT_START_200 -at_fn_group_banner 200 'calc.at:597' \ - "Calculator " " " 11 +#AT_STOP_227 +#AT_START_228 +at_fn_group_banner 228 'actions.at:930' \ + "Printers and Destructors: %glr-parser" " " 10 at_xfail=no ( - $as_echo "200. $at_setup_line: testing $at_desc ..." + $as_echo "228. $at_setup_line: testing $at_desc ..." $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. - - - - - -cat >calc.y <<'_ATEOF' +cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -58743,284 +61590,308 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ - +%code requires { +#include +#include +#include +#include -%code requires -{ +#define YYINITDEPTH 10 +#define YYMAXDEPTH 10 +#define RANGE(Location) (Location).first_line, (Location).last_line - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; +/* Display the symbol type Symbol. */ +#define V(Symbol, Value, Location, Sep) \ + fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; +%define parse.error verbose +%debug +%verbose +%locations +%glr-parser -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} -%code -{ -#include -#include -#define USE(Var) +%code { -FILE *input; -static int power (int base, int exponent); +static int yylex (void); +#include -static void yyerror ( const char *msg); -int yylex (void); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); } -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp +/* FIXME: This %printer isn't actually tested. */ +%printer + { + fprintf (yyo, "%d", $$); + } + '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%destructor + { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } + input -/* Grammar follows */ -%% -input: +%destructor + { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } 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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} +%destructor + { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } + thing +%destructor + { fprintf (stderr, "Freeing raise thing (%d@%d-%d)\n", $$, RANGE (@$)); } + raise -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include +%destructor + { fprintf (stderr, "Freeing check-spontaneous-errors thing (%d@%d-%d)\n", $$, RANGE (@$)); } + check-spontaneous-errors -int yylex (void); -static int get_char (void); -static void unget_char ( int c); +%destructor + { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'x' +%destructor + { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'y' -static int -get_char (void) -{ - int res = getc (input); - ; +%token END 0 +%destructor + { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } + END - return res; -} +%% +/* + 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. +*/ -static void -unget_char ( int c) -{ - ; +input: + %empty + { + $$ = 0; + V(input, $$, @$, ": /* Nothing */\n"); + } +| line input /* Right recursive to load the stack so that popping at + END can be exercised. */ + { + $$ = 2; + V(input, $$, @$, ": "); + V(line, $1, @1, " "); + V(input, $2, @2, "\n"); + } +| '!' check-spontaneous-errors + { + $$ = $2; + } +; - ungetc (c, input); -} +check-spontaneous-errors: + raise { abort(); $$ = $1; } +| '(' raise ')' { abort(); $$ = $2; } +| error + { + $$ = 5; + V(check-spontaneous-errors, $$, @$, ": "); + fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); + } +; -static int -read_signed_integer (void) -{ - int c = get_char (); - int sign = 1; - int n = 0; +raise: + %empty + { + $$ = 4; + V(raise, $$, @$, ": %empty\n"); + YYERROR; + } +| '!' '!' + { + $$ = 5; + V(raise, $$, @$, ": "); + V(!, $1, @2, " "); + V(!, $2, @2, "\n"); + YYERROR; + } +; - ; - if (c == '-') +line: + thing thing thing ';' { - c = get_char (); - sign = -1; + $$ = $1; + V(line, $$, @$, ": "); + V(thing, $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(;, $4, @4, "\n"); } - - while (isdigit (c)) +| '(' thing thing ')' { - n = 10 * n + (c - '0'); - c = get_char (); + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(')', $4, @4, "\n"); } +| '(' thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(')', $3, @3, "\n"); + } +| '(' error ')' + { + $$ = -1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); + V(')', $3, @3, "\n"); + } +; - unget_char ( c); - - return sign * n; -} +thing: + 'x' + { + $$ = $1; + V(thing, $$, @$, ": "); + V('x', $1, @1, "\n"); + } +; +%% +/* Alias to ARGV[1]. */ +const char *source = YY_NULLPTR; -/*---------------------------------------------------------------. -| 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) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - int c; - /* Skip current token, then white spaces. */ - do + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) { - + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); } - while ((c = get_char ()) == ' ' || c == '\t'); - - /* process numbers */ - if (c == '.' || isdigit (c)) + if (0 <= yylocp->last_line) { - unget_char ( c); - (yylval).ival = read_signed_integer (); - return NUM; + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); } - - /* Return end-of-file. */ - if (c == EOF) - return CALC_EOF; - - /* Return single chars. */ - return c; + return res; } - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ #endif +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} +static +int yylex (void) +{ + static unsigned int counter = 0; + + unsigned 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; + assert (c <= strlen (source)); + if (source[c]) + fprintf (stderr, "sending: '%c'", source[c]); + else + fprintf (stderr, "sending: END"); + fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); + return source[c]; +} -semantic_value global_result = 0; -int global_count = 0; -/* A C main function. */ int -main (int argc, const char **argv) +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) + yydebug = !!getenv ("YYDEBUG"); + assert (argc == 2); (void) argc; + source = argv[1]; + status = yyparse (); + switch (status) { - perror (argv[1]); - return 3; + case 0: fprintf (stderr, "Successful parse.\n"); break; + case 1: fprintf (stderr, "Parsing FAILED.\n"); break; + default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } - - - status = yyparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); return status; } _ATEOF - - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:597" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:930: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:930" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:597" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:930: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:930" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:597: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:930: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:597" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:930" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -59029,16 +61900,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:597: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:930: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:597" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:930" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -59047,7 +61918,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } @@ -59055,950 +61926,1116 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:597: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:930: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:930" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:597: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:597" + { set +x +$as_echo "$at_srcdir/actions.at:930: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:930" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: \$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:597" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/actions.at:930: \$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:930" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:597" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:597: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:597" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $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 - +# 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/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:930: \$PREPARSER ./input '(x)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:930" +( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:930: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:930" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF - +# Check the location of empty reductions raising an error +# ------------------------------------------------------- +# Here, the error is after token "!@0-9", so the error is raised from +# @9-9, and the error recovery detects that it starts from @9-9 and +# ends where starts the next token: END@10-19. +# +# So error recovery reports error@9-19. { set +x -$as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:930: \$PREPARSER ./input '!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:930" +( $at_check_trace; $PREPARSER ./input '!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:930: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:930" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: END (1@10-19) +raise (4@9-9): %empty +check-spontaneous-errors (5@9-19): error (@9-19) +Freeing token END (1@10-19) +Freeing nterm input (5@0-19) +Successful parse. +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -1//2 -_ATEOF +# Check the location of not empty reductions raising an error +# ----------------------------------------------------------- +# This time the error is raised from a rule with 2 rhs symbols: @10-29. +# It is recovered @10-29. { set +x -$as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:930: \$PREPARSER ./input '!!!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:930" +( $at_check_trace; $PREPARSER ./input '!!!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:930: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:930" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: '!' (1@10-19) +sending: '!' (2@20-29) +raise (5@10-29): ! (1@20-29) ! (2@20-29) +check-spontaneous-errors (5@10-29): error (@10-29) +sending: END (3@30-39) +Freeing token END (3@30-39) +Freeing nterm input (5@0-29) +Successful parse. +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" -$at_failed && at_fn_log_failure -$at_traceon; } - - -cat >input <<'_ATEOF' -error -_ATEOF - +# 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/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:930: \$PREPARSER ./input '(y)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:930" +( $at_check_trace; $PREPARSER ./input '(y)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:930: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:930" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) +sending: 'y' (1@10-19) +10.10-19.18: 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" -$at_failed && at_fn_log_failure -$at_traceon; } - - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF +# 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/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:930: \$PREPARSER ./input '(xxxxx)(x)(x)y'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:930" +( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:930: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:930" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $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.30-39.38: 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.130-139.138: syntax error, unexpected 'y', expecting END +Freeing nterm input (2@0-129) +Freeing token 'y' (13@130-139) +Parsing FAILED. +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -+1 -_ATEOF +# 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/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:930: \$PREPARSER ./input '(x)(x)x'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:930" +( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:930: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:930" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $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.70-79.78: 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:930" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" -$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. -# Exercise error messages with EOF: work on an empty file. -{ set +x -$as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc /dev/null -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:597" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:597" -$at_failed && at_fn_log_failure -$at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_228 +#AT_START_229 +at_fn_group_banner 229 'actions.at:931' \ + "Printers and Destructors with union: %glr-parser" "" 10 +at_xfail=no +( + $as_echo "229. $at_setup_line: testing $at_desc ..." + $at_traceon -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" -$at_failed && at_fn_log_failure -$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. -# 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 +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -{ set +x -$as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:597" +%code requires { +#include +#include +#include +#include + +#define YYINITDEPTH 10 +#define YYMAXDEPTH 10 +#define RANGE(Location) (Location).first_line, (Location).last_line + +/* Display the symbol type Symbol. */ +#define V(Symbol, Value, Location, Sep) \ + fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) +} + +%define parse.error verbose +%debug +%verbose +%locations +%glr-parser +%union +{ + int ival; +} + +%code provides { + +static int yylex (void); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); +} + +%type '(' 'x' 'y' ')' ';' thing line input + '!' raise check-spontaneous-errors END + +/* FIXME: This %printer isn't actually tested. */ +%printer + { + fprintf (yyo, "%d", $$); + } + '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END + +%destructor + { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } + input + +%destructor + { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } + line + +%destructor + { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } + thing + +%destructor + { fprintf (stderr, "Freeing raise thing (%d@%d-%d)\n", $$, RANGE (@$)); } + raise + +%destructor + { fprintf (stderr, "Freeing check-spontaneous-errors thing (%d@%d-%d)\n", $$, RANGE (@$)); } + check-spontaneous-errors + +%destructor + { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'x' + +%destructor + { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } + 'y' + +%token END 0 +%destructor + { fprintf (stderr, "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: + %empty + { + $$ = 0; + V(input, $$, @$, ": /* Nothing */\n"); + } +| line input /* Right recursive to load the stack so that popping at + END can be exercised. */ + { + $$ = 2; + V(input, $$, @$, ": "); + V(line, $1, @1, " "); + V(input, $2, @2, "\n"); + } +| '!' check-spontaneous-errors + { + $$ = $2; + } +; + +check-spontaneous-errors: + raise { abort(); $$ = $1; } +| '(' raise ')' { abort(); $$ = $2; } +| error + { + $$ = 5; + V(check-spontaneous-errors, $$, @$, ": "); + fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); + } +; + +raise: + %empty + { + $$ = 4; + V(raise, $$, @$, ": %empty\n"); + YYERROR; + } +| '!' '!' + { + $$ = 5; + V(raise, $$, @$, ": "); + V(!, $1, @2, " "); + V(!, $2, @2, "\n"); + YYERROR; + } +; + +line: + thing thing thing ';' + { + $$ = $1; + V(line, $$, @$, ": "); + V(thing, $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(;, $4, @4, "\n"); + } +| '(' thing thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(')', $4, @4, "\n"); + } +| '(' thing ')' + { + $$ = $1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(')', $3, @3, "\n"); + } +| '(' error ')' + { + $$ = -1; + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); + V(')', $3, @3, "\n"); + } +; + +thing: + 'x' + { + $$ = $1; + V(thing, $$, @$, ": "); + V('x', $1, @1, "\n"); + } +; +%% +/* Alias to ARGV[1]. */ +const char *source = YY_NULLPTR; + + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} + +static +int yylex (void) +{ + static unsigned int counter = 0; + + unsigned 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; + assert (c <= strlen (source)); + if (source[c]) + fprintf (stderr, "sending: '%c'", source[c]); + else + fprintf (stderr, "sending: END"); + fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); + return source[c]; +} + + +int +main (int argc, const char *argv[]) +{ + int status; + yydebug = !!getenv ("YYDEBUG"); + assert (argc == 2); (void) argc; + source = argv[1]; + status = yyparse (); + switch (status) + { + case 0: fprintf (stderr, "Successful parse.\n"); break; + case 1: fprintf (stderr, "Parsing FAILED.\n"); break; + default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; + } + return status; +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:931: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:931" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:931" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/actions.at:931: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:931" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:597" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:931: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:931" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:931" +$at_failed && at_fn_log_failure +$at_traceon; } + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:931: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:931" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:931" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:931: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:931" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/actions.at:931: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:931" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:931" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/actions.at:931: \$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:931" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:931" +$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' -(!) + (1 2) = 1 -_ATEOF +# 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/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:931: \$PREPARSER ./input '(x)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:931" +( $at_check_trace; $PREPARSER ./input '(x)' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:931: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:931" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +# Check the location of empty reductions raising an error +# ------------------------------------------------------- +# Here, the error is after token "!@0-9", so the error is raised from +# @9-9, and the error recovery detects that it starts from @9-9 and +# ends where starts the next token: END@10-19. +# +# So error recovery reports error@9-19. +{ set +x +$as_echo "$at_srcdir/actions.at:931: \$PREPARSER ./input '!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:931" +( $at_check_trace; $PREPARSER ./input '!' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:931: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:931" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: END (1@10-19) +raise (4@9-9): %empty +check-spontaneous-errors (5@9-19): error (@9-19) +Freeing token END (1@10-19) +Freeing nterm input (5@0-19) +Successful parse. +" | \ + $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:931" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF +# Check the location of not empty reductions raising an error +# ----------------------------------------------------------- +# This time the error is raised from a rule with 2 rhs symbols: @10-29. +# It is recovered @10-29. { set +x -$as_echo "$at_srcdir/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:931: \$PREPARSER ./input '!!!'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:931" +( $at_check_trace; $PREPARSER ./input '!!!' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:931: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:931" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) +sending: '!' (1@10-19) +sending: '!' (2@20-29) +raise (5@10-29): ! (1@20-29) ! (2@20-29) +check-spontaneous-errors (5@10-29): error (@10-29) +sending: END (3@30-39) +Freeing token END (3@30-39) +Freeing nterm input (5@0-29) +Successful parse. +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +# 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:931: \$PREPARSER ./input '(y)'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:931" +( $at_check_trace; $PREPARSER ./input '(y)' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:931: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:931" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +echo >>"$at_stderr"; $as_echo "sending: '(' (0@0-9) +sending: 'y' (1@10-19) +10.10-19.18: 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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $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 +# 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/calc.at:597: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:597" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:931: \$PREPARSER ./input '(xxxxx)(x)(x)y'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:931" +( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:597" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:931" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:597: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:597" +$as_echo "$at_srcdir/actions.at:931: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:931" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $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.30-39.38: 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.130-139.138: syntax error, unexpected 'y', expecting END +Freeing nterm input (2@0-129) +Freeing token 'y' (13@130-139) +Parsing FAILED. +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +# 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/calc.at:597: cat stderr" -at_fn_check_prepare_trace "calc.at:597" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:931: \$PREPARSER ./input '(x)(x)x'" +at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:931" +( $at_check_trace; $PREPARSER ./input '(x)(x)x' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:597" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:931" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/actions.at:931: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:931" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $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.70-79.78: 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_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:931" $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 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_200 -#AT_START_201 -at_fn_group_banner 201 'calc.at:599' \ - "Calculator %defines" " " 11 +#AT_STOP_229 +#AT_START_230 +at_fn_group_banner 230 'actions.at:942' \ + "Default tagless %printer and %destructor" " " 10 at_xfail=no ( - $as_echo "201. $at_setup_line: testing $at_desc ..." + $as_echo "230. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - - -cat >calc.y <<'_ATEOF' +cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -60007,307 +63044,160 @@ cat >calc.y <<'_ATEOF' #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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%define parse.error verbose +%debug +%locations -%code -{ -#include -#include -#define USE(Var) +%code { +static int yylex (void); +#include -FILE *input; -static int power (int base, int exponent); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif -static void yyerror ( const char *msg); -int yylex (void); +static void yyerror (const char *msg); +# 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); +} <> -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp +%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' -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%destructor { + fprintf (yyoutput, "<*> destructor should not be called.\n"); +} <*> -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: 'a' 'b' 'c' 'd' 'e' { $$ = 'S'; USE(($1, $2, $3, $4, $5)); } ; -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 int -power (int base, int exponent) + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } return res; } +#endif - -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static int -get_char (void) +#include +static +int yylex (void) { - int res = getc (input); + static char const input[] = "abcd"; + static size_t toknum = 0; + int res; ; - + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + yylval = res; + (yylloc).first_line = (yylloc).last_line = 1; + (yylloc).first_column = (yylloc).last_column = toknum; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - - } - 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 - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:599" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:990: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:990" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:990" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:599" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:990: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:990" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:990" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:990: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:599" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:990" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -60316,16 +63206,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:990" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:990: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:599" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:990" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -60334,7 +63224,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:990" $at_failed && at_fn_log_failure $at_traceon; } @@ -60342,968 +63232,989 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:599: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:990: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:990" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "input.y:30.3-5: warning: useless %destructor for type <*> [-Wother] +input.y:30.3-5: warning: useless %printer for type <*> [-Wother] +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:990" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout - { set +x -$as_echo "$at_srcdir/calc.at:599: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:599" -( $at_check_trace; $BISON_C_WORKS + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:990: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:990" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:599" +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:990" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:599" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:30.3-5: warning: useless %destructor for type <*> [-Wother] +input.y:30.3-5: warning: useless %printer for type <*> [-Wother] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:990: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:990" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:599" +$at_diff experr "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:990" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:990: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:990" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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:599" +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:990" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:990: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:990" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:599" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:990" $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:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/actions.at:990: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:990" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +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:990" $at_failed && at_fn_log_failure $at_traceon; } + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:991: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:991" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:991" $at_failed && at_fn_log_failure $at_traceon; } - - - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:991: \$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:991" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:991" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1024: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1024" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +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:1024" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1024: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1024" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +echo >>"$at_stderr"; $as_echo "Starting parse +Entering state 0 +Reading a token: Next token is token 'a' (1.1: <> printer for 'a' @ 1) +Shifting token 'a' (1.1: <> printer for 'a' @ 1) +Entering state 1 +Reading a token: Next token is token 'b' (1.2: 'b'/'c' printer for 'b' @ 2) +Shifting token 'b' (1.2: 'b'/'c' printer for 'b' @ 2) +Entering state 3 +Reading a token: Next token is token 'c' (1.3: 'b'/'c' printer for 'c' @ 3) +Shifting token 'c' (1.3: 'b'/'c' printer for 'c' @ 3) +Entering state 5 +Reading a token: Next token is token 'd' (1.4: <> printer for 'd' @ 4) +Shifting token 'd' (1.4: <> printer for 'd' @ 4) +Entering state 6 +Reading a token: Now at end of input. +1.5: syntax error, unexpected \$end, expecting 'e' +Error: popping token 'd' (1.4: <> printer for 'd' @ 4) +Stack now 0 1 3 5 +Error: popping token 'c' (1.3: 'b'/'c' printer for 'c' @ 3) +Stack now 0 1 3 +Error: popping token 'b' (1.2: 'b'/'c' printer for 'b' @ 2) +Stack now 0 1 +Error: popping token 'a' (1.1: <> printer for 'a' @ 1) +Stack now 0 +Cleanup: discarding lookahead token \$end (1.5: ) +Stack now 0 +" | \ + $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:1024" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -1//2 + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_230 +#AT_START_231 +at_fn_group_banner 231 'actions.at:1035' \ + "Default tagged and per-type %printer and %destructor" "" 10 +at_xfail=no +( + $as_echo "231. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%define parse.error verbose +%debug + +%{ +#include + +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 start 'a' 'g' +%type 'e' +%type 'f' +%printer { + fprintf (yyoutput, "<*>//e printer"); +} <*> 'e' +%destructor { + fprintf (stdout, "<*>//e destructor.\n"); +} <*> 'e' + +%type 'b' +%printer { fprintf (yyoutput, " printer"); } +%destructor { fprintf (stdout, " destructor.\n"); } + +%type 'c' +%printer { fprintf (yyoutput, "'c' printer"); } 'c' +%destructor { fprintf (stdout, "'c' destructor.\n"); } 'c' + +%type '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'; + } + ; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "abcdef"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1097: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1097" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1097" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/actions.at:1097: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1097" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1097" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1097: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1097" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1097" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -error -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1097: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1097" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" +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:1097" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1097: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1097" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "input.y:22.3-4: warning: useless %destructor for type <> [-Wother] +input.y:22.3-4: warning: useless %printer for type <> [-Wother] +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1097" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:1097: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:1097" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1097" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -1 = 2 = 3 + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:22.3-4: warning: useless %destructor for type <> [-Wother] +input.y:22.3-4: warning: useless %printer for type <> [-Wother] _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:1097: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1097" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +$at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1097" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:1097: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:1097" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1097" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:1097: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:1097" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1097" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' - -+1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/actions.at:1097: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:1097" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" +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:1097" $at_failed && at_fn_log_failure $at_traceon; } + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1098: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1098" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1098" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1098: \$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:1098" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1098" $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:599: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc /dev/null +$as_echo "$at_srcdir/actions.at:1143: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1143" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" +echo >>"$at_stdout"; $as_echo "<*>//e destructor. +<*>//e destructor. +'d' destructor. +'c' destructor. + destructor. +<*>//e destructor. +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1143" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" +$as_echo "$at_srcdir/actions.at:1143: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1143" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "Starting parse +Entering state 0 +Reading a token: Next token is token 'a' (<*>//e printer) +Shifting token 'a' (<*>//e printer) +Entering state 1 +Reading a token: Next token is token 'b' ( printer) +Shifting token 'b' ( 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' (<*>//e printer) +Shifting token 'e' (<*>//e printer) +Entering state 7 +Reading a token: Next token is token 'f' (<*>//e printer) +Shifting token 'f' (<*>//e printer) +Entering state 8 +Reading a token: Now at end of input. +syntax error, unexpected \$end, expecting 'g' +Error: popping token 'f' (<*>//e printer) +Stack now 0 1 3 5 6 7 +Error: popping token 'e' (<*>//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' ( printer) +Stack now 0 1 +Error: popping token 'a' (<*>//e printer) +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 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1143" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" -$at_failed && at_fn_log_failure -$at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_231 +#AT_START_232 +at_fn_group_banner 232 'actions.at:1154' \ + "Default %printer and %destructor for user-defined end token" "" 10 +at_xfail=no +( + $as_echo "232. $at_setup_line: testing $at_desc ..." + $at_traceon +# AT_TEST(TYPED) +# -------------- -# 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 + + + + +cat >input0.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%define parse.error verbose +%debug +%locations + +%code { +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +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'; } ; + +%% +#include /* abort */ +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; +} + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1251: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1251" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input0.c input0.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/actions.at:1251: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y" "actions.at:1251" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1251: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1251" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1251" $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' -(!) + (1 2) = 1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1251: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1251" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +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:1251" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1251: bison -fno-caret -o input0.c input0.y" +at_fn_check_prepare_trace "actions.at:1251" +( $at_check_trace; bison -fno-caret -o input0.c input0.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "input0.y:30.3-5: warning: useless %destructor for type <*> [-Wother] +input0.y:30.3-5: warning: useless %printer for type <*> [-Wother] +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:1251: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Werror" "actions.at:1251" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input0.y:30.3-5: warning: useless %destructor for type <*> [-Wother] +input0.y:30.3-5: warning: useless %printer for type <*> [-Wother] _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:1251: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1251" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +$at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:1251: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=error" "actions.at:1251" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:1251: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Wnone -Werror" "actions.at:1251" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/actions.at:1251: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=none -Werror" "actions.at:1251" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1251" +$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 + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1251: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1251" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1251: \$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:1251" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:599" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1251" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:599: cat stderr" -at_fn_check_prepare_trace "calc.at:599" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1251: \$PREPARSER ./input0 --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input0 --debug" "actions.at:1251" +( $at_check_trace; $PREPARSER ./input0 --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" +echo stderr:; tee stderr <"$at_stderr" +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:1251" $at_failed && at_fn_log_failure $at_traceon; } - - - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_201 -#AT_START_202 -at_fn_group_banner 202 'calc.at:600' \ - "Calculator %locations" " " 11 -at_xfail=no -( - $as_echo "202. $at_setup_line: testing $at_desc ..." - $at_traceon - +{ set +x +$as_echo "$at_srcdir/actions.at:1251: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1251" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Starting parse +Entering state 0 +Reducing stack by rule 1 (line 49): +-> \$\$ = nterm start (1.1: <> for 'S' @ 1) +Stack now 0 +Entering state 1 +Reading a token: Now at end of input. +Shifting token END (1.1: <> for 'E' @ 1) +Entering state 2 +Stack now 0 1 2 +Cleanup: popping token END (1.1: <> for 'E' @ 1) +Cleanup: popping nterm start (1.1: <> for 'S' @ 1) +" | \ + $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:1251" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -61313,7 +64224,7 @@ at_xfail=no -cat >calc.y <<'_ATEOF' +cat >input1.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -61322,302 +64233,155 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ +%define parse.error verbose +%debug %locations -%code requires -{ +%code { +#include - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; -} - -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} - -%code -{ -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); - -static void yyerror ( const char *msg); -int yylex (void); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +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); +} <*> -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp +%printer { + fprintf (yyoutput, "<> printer should not be called.\n"); +} <> -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%union { char tag; } +%type start END -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: { $$ = 'S'; } ; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - - -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - YY_LOCATION_PRINT (stderr, (yylloc)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static YYLTYPE last_yylloc; - +#include /* abort */ static int -get_char (void) +yylex (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 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 -unget_char ( int c) -{ - ; - - /* Wrong when C == `\n'. */ - (yylloc) = last_yylloc; - - ungetc (c, input); -} -static int -read_signed_integer (void) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - int c = get_char (); - int sign = 1; - int n = 0; - - ; - if (c == '-') + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) { - c = get_char (); - sign = -1; + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); } - - while (isdigit (c)) + if (0 <= yylocp->last_line) { - n = 10 * n + (c - '0'); - c = get_char (); + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); } - - unget_char ( c); - - return sign * n; + return res; } +#endif - -/*---------------------------------------------------------------. -| 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) +/* A C error reporting function. */ +static +void yyerror (const char *msg) { - int c; - /* Skip current token, then white spaces. */ - do - { - (yylloc).first_column = (yylloc).last_column; - (yylloc).first_line = (yylloc).last_line; - - } - 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; + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); } - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:600" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1252: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1252" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input1.c input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:600" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1252: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y" "actions.at:1252" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:600: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:1252: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:600" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1252" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -61626,16 +64390,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:600: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:1252: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:600" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1252" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -61644,7 +64408,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } @@ -61652,914 +64416,1443 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:600: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1252: bison -fno-caret -o input1.c input1.y" +at_fn_check_prepare_trace "actions.at:1252" +( $at_check_trace; bison -fno-caret -o input1.c input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "input1.y:30.3-4: warning: useless %destructor for type <> [-Wother] +input1.y:30.3-4: warning: useless %printer for type <> [-Wother] +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout - { set +x -$as_echo "$at_srcdir/calc.at:600: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:600" -( $at_check_trace; $BISON_C_WORKS + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:1252: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Werror" "actions.at:1252" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:600" +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:600: \$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:600" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input1.y:30.3-4: warning: useless %destructor for type <> [-Wother] +input1.y:30.3-4: warning: useless %printer for type <> [-Wother] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:1252: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1252" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:600" +$at_diff experr "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:600: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:600" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:1252: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=error" "actions.at:1252" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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:600" +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:1252: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Wnone -Werror" "actions.at:1252" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1252" +$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 + { set +x +$as_echo "$at_srcdir/actions.at:1252: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=none -Werror" "actions.at:1252" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1252" +$at_failed && at_fn_log_failure +$at_traceon; } -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 -2^2^3 = 256 -(2^2)^3 = 64 -_ATEOF + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1252: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1252" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:600" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1252: \$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:1252" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:600" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } - - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1252: \$PREPARSER ./input1 --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input1 --debug" "actions.at:1252" +( $at_check_trace; $PREPARSER ./input1 --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" +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:1252" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" +$as_echo "$at_srcdir/actions.at:1252: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1252" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "Starting parse +Entering state 0 +Reducing stack by rule 1 (line 49): +-> \$\$ = nterm start (1.1: <*> for 'S' @ 1) +Stack now 0 +Entering state 1 +Reading a token: Now at end of input. +Shifting token END (1.1: <*> for 'E' @ 1) +Entering state 2 +Stack now 0 1 2 +Cleanup: popping token END (1.1: <*> for 'E' @ 1) +Cleanup: popping nterm start (1.1: <*> for 'S' @ 1) +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1252" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_232 +#AT_START_233 +at_fn_group_banner 233 'actions.at:1264' \ + "Default %printer and %destructor are not for error or \$undefined" "" 10 +at_xfail=no +( + $as_echo "233. $at_setup_line: testing $at_desc ..." + $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 +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%{ +# include +# include +#include + +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'; } + ; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "abd"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + yylval = res; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1312: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1312" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1312" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/actions.at:1312: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1312" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1312" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -1//2 -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1312: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1312" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1312" +$at_failed && at_fn_log_failure +$at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1312: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1312" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" +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:1312" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1312: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1312" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "input.y:23.6-8: warning: useless %destructor for type <*> [-Wother] +input.y:23.6-8: warning: useless %printer for type <*> [-Wother] +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1312" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:1312: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:1312" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1312" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -error + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:23.6-8: warning: useless %destructor for type <*> [-Wother] +input.y:23.6-8: warning: useless %printer for type <*> [-Wother] _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:1312: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1312" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +$at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1312" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:1312: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:1312" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:600" +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1312" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:1312: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:1312" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1312" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/actions.at:1312: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:1312" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" +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:1312" $at_failed && at_fn_log_failure $at_traceon; } + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1313: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1313" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:600" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1313" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1313: \$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:1313" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1313" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' - -+1 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1347: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1347" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1347" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" +$as_echo "$at_srcdir/actions.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1347" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1347" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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 '+' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_233 +#AT_START_234 +at_fn_group_banner 234 'actions.at:1357' \ + "Default %printer and %destructor are not for \$accept" "" 10 +at_xfail=no +( + $as_echo "234. $at_setup_line: testing $at_desc ..." + $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 $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 +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug /* So that %printer is actually compiled. */ + +%{ +# include +# include +#include + +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 start + +%% + +start: { USE($$); } ; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1410: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1410" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1410" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/actions.at:1410: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1410" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1410" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1410: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1410" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1410" $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:600: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc /dev/null + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1410: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1410" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:600" +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:1410" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1410: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1410" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "input.y:24.3-4: warning: useless %destructor for type <> [-Wother] +input.y:24.3-4: warning: useless %printer for type <> [-Wother] +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1410" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:1410: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:1410" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1410" $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 + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:24.3-4: warning: useless %destructor for type <> [-Wother] +input.y:24.3-4: warning: useless %printer for type <> [-Wother] _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:1410: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1410" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +$at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1410" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:1410: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:1410" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:600" +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1410" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:1410: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:1410" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1410" $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' -(!) + (1 2) = 1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/actions.at:1410: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:1410" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:600" +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:1410" $at_failed && at_fn_log_failure $at_traceon; } + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1411: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1411" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:600" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1411" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/actions.at:1411: \$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:1411" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1411" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_234 +#AT_START_235 +at_fn_group_banner 235 'actions.at:1421' \ + "Default %printer and %destructor for mid-rule values" "" 10 +at_xfail=no +( + $as_echo "235. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug /* So that %printer is actually compiled. */ + +%{ +#include + +static void yyerror (const char *msg); +static int yylex (void); +# define USE(SYM) +# define YYLTYPE int +# define YYLLOC_DEFAULT(Current, Rhs, N) (void)(Rhs) +# define 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; } + ; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1464: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1464" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1464" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/actions.at:1464: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1464" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1464" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1464: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1464" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1464" $at_failed && at_fn_log_failure $at_traceon; } + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1464: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1464" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1464" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1464: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1464" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "input.y:24.70-72: warning: useless %destructor for type <*> [-Wother] +input.y:24.70-72: warning: useless %printer for type <*> [-Wother] +input.y:33.3-23: warning: unset value: \$\$ [-Wother] +input.y:32.3-23: warning: unused value: \$3 [-Wother] +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1464" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:1464: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:1464" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1464" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:24.70-72: warning: useless %destructor for type <*> [-Wother] +input.y:24.70-72: warning: useless %printer for type <*> [-Wother] +input.y:33.3-23: warning: unset value: $$ [-Wother] +input.y:32.3-23: warning: unused value: $3 [-Wother] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:1464: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1464" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1464" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:1464: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:1464" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1464" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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. + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:1464: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:1464" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1464" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + { set +x +$as_echo "$at_srcdir/actions.at:1464: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:1464" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1464" $at_failed && at_fn_log_failure $at_traceon; } + at_restore_special_files +fi -# Check that yyerrok works properly: second error is not reported, -# third and fourth are. Parse status is succesfull. -cat >input <<'_ATEOF' -(* *) + (*) + (*) -_ATEOF +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -fcaret -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -fcaret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1479" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/actions.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "actions.at:1479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1479" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1479: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1479" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1479" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1479: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1479" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1479" +$at_failed && at_fn_log_failure +$at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:600: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:600" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1479: bison -fno-caret -fcaret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1479" +( $at_check_trace; bison -fno-caret -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "input.y:24.70-72: warning: useless %destructor for type <*> [-Wother] + %printer { fprintf (yyoutput, \"<*> printer should not be called\"); } <*> + ^^^ +input.y:24.70-72: warning: useless %printer for type <*> [-Wother] + %printer { fprintf (yyoutput, \"<*> printer should not be called\"); } <*> + ^^^ +input.y:33.3-23: warning: unset value: \$\$ [-Wother] + { @\$ = 4; } // Only used. + ^^^^^^^^^^^^^^^^^^^^^ +input.y:32.3-23: warning: unused value: \$3 [-Wother] + { USE (\$\$); @\$ = 3; } // Only set. + ^^^^^^^^^^^^^^^^^^^^^ +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1479" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:600: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/actions.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror" "actions.at:1479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1479" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:24.70-72: warning: useless %destructor for type <*> [-Wother] + %printer { fprintf (yyoutput, "<*> printer should not be called"); } <*> + ^^^ +input.y:24.70-72: warning: useless %printer for type <*> [-Wother] + %printer { fprintf (yyoutput, "<*> printer should not be called"); } <*> + ^^^ +input.y:33.3-23: warning: unset value: $$ [-Wother] + { @$ = 4; } // Only used. + ^^^^^^^^^^^^^^^^^^^^^ +input.y:32.3-23: warning: unused value: $3 [-Wother] + { USE ($$); @$ = 3; } // Only set. + ^^^^^^^^^^^^^^^^^^^^^ +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/actions.at:1479: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1479" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1479" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/actions.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error" "actions.at:1479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1479" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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. + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/actions.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror" "actions.at:1479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1479" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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:600: cat stderr" -at_fn_check_prepare_trace "calc.at:600" -( $at_check_trace; cat stderr + { set +x +$as_echo "$at_srcdir/actions.at:1479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror" "actions.at:1479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:600" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1479" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/actions.at:1481: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1481" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1481" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/actions.at:1481: \$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:1481" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1481" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/actions.at:1516: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1516" +( $at_check_trace; $PREPARSER ./input --debug +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1516" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/actions.at:1516: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1516" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/actions.at:1516" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -62567,25 +65860,17 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_202 -#AT_START_203 -at_fn_group_banner 203 'calc.at:602' \ - "Calculator %name-prefix=\"calc\"" " " 11 +#AT_STOP_235 +#AT_START_236 +at_fn_group_banner 236 'actions.at:1566' \ + "@\$ in %initial-action implies %locations" " " 10 at_xfail=no ( - $as_echo "203. $at_setup_line: testing $at_desc ..." + $as_echo "236. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - - -cat >calc.y <<'_ATEOF' +cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -62594,242 +65879,237 @@ cat >calc.y <<'_ATEOF' #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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ +%code { #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} - -%code -{ -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +#include -static void yyerror ( const char *msg); -int yylex (void); +static void yyerror (const char *msg); +static int yylex (void); } +%debug +%initial-action { + fprintf (stderr, "%d\n", @$.first_line); +} -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: ; -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 int -power (int base, int exponent) +yylex (void) { - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; + return 0; } -#include + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static int -get_char (void) +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) { - int res = getc (input); - ; - - return res; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } +_ATEOF -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 test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1566: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1566" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1566" +$at_failed && at_fn_log_failure +$at_traceon; } - ; - if (c == '-') - { - c = get_char (); - sign = -1; - } + { set +x +$as_echo "$at_srcdir/actions.at:1566: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1566" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1566" +$at_failed && at_fn_log_failure +$at_traceon; } - while (isdigit (c)) - { - n = 10 * n + (c - '0'); - c = get_char (); - } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1566: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1566" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1566" +$at_failed && at_fn_log_failure +$at_traceon; } - unget_char ( c); + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1566: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1566" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1566" +$at_failed && at_fn_log_failure +$at_traceon; } - return sign * n; -} + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/actions.at:1566: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1566" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1566" +$at_failed && at_fn_log_failure +$at_traceon; } -/*---------------------------------------------------------------. -| 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. | -`---------------------------------------------------------------*/ +{ set +x +$as_echo "$at_srcdir/actions.at:1566: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1566" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1566" +$at_failed && at_fn_log_failure +$at_traceon; } -int yylex (void) -{ - int c; - /* Skip current token, then white spaces. */ - do - { +{ set +x +$as_echo "$at_srcdir/actions.at:1566: \$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:1566" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1566" +$at_failed && at_fn_log_failure +$at_traceon; } - } - while ((c = get_char ()) == ' ' || c == '\t'); - /* process numbers */ - if (c == '.' || isdigit (c)) - { - unget_char ( c); - (yylval).ival = read_signed_integer (); - return NUM; - } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_236 +#AT_START_237 +at_fn_group_banner 237 'actions.at:1567' \ + "@\$ in %destructor implies %locations" " " 10 +at_xfail=no +( + $as_echo "237. $at_setup_line: testing $at_desc ..." + $at_traceon - /* Return end-of-file. */ - if (c == EOF) - return CALC_EOF; - /* Return single chars. */ - return c; +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc } -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - +%code { + #include +#include -semantic_value global_result = 0; -int global_count = 0; +static void yyerror (const char *msg); +static int yylex (void); +} -/* A C main function. */ -int -main (int argc, const char **argv) -{ - semantic_value result = 0; - int count = 0; - int status; +%debug - /* 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); +%destructor { + fprintf (stderr, "%d\n", @$.first_line); +} start - if (argc == 2) - input = fopen (argv[1], "r"); - else - input = stdin; +%% - if (!input) - { - perror (argv[1]); - return 3; - } +start: ; +%% - status = yyparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; +static int +yylex (void) +{ + return 0; } -_ATEOF - - +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} +_ATEOF @@ -62839,39 +66119,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:602" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1567: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1567" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1567" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:602" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1567: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1567" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1567" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:602: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:1567: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:602" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1567" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -62880,16 +66160,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1567" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:602: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:1567: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:602" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1567" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -62898,7 +66178,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1567" $at_failed && at_fn_log_failure $at_traceon; } @@ -62906,950 +66186,1082 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:602: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1567: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1567" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1567" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:602: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:602" +{ set +x +$as_echo "$at_srcdir/actions.at:1567: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1567" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1567" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:602: \$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:602" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/actions.at:1567: \$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:1567" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1567" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:602: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:602" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_237 +#AT_START_238 +at_fn_group_banner 238 'actions.at:1568' \ + "@\$ in %printer implies %locations" " " 10 +at_xfail=no +( + $as_echo "238. $at_setup_line: testing $at_desc ..." + $at_traceon -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:602" -$at_failed && at_fn_log_failure -$at_traceon; } +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%code { + #include +#include -# Test the priorities. -cat >input <<'_ATEOF' -1 + 2 * 3 = 7 -1 + 2 * -3 = -5 +static void yyerror (const char *msg); +static int yylex (void); +} --1^2 = -1 -(-1)^2 = 1 +%debug ----1 = -1 +%printer { + fprintf (stderr, "%d\n", @$.first_line); +} start -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 +%% -2^2^3 = 256 -(2^2)^3 = 64 +start: ; + +%% + +static int +yylex (void) +{ + return 0; +} + + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1568: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1568" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1568" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/actions.at:1568: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1568" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1568" $at_failed && at_fn_log_failure $at_traceon; } - - - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1568: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1568" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" +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:1568" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1568: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1568" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +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:1568" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1568: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1568" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1568" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -1//2 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1568: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1568" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1568" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1568: \$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:1568" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1568" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_238 +#AT_START_239 +at_fn_group_banner 239 'actions.at:1680' \ + "Qualified \$\$ in actions: yacc.c" " " 10 +at_xfail=no +( + $as_echo "239. $at_setup_line: testing $at_desc ..." + $at_traceon -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%skeleton "yacc.c" +%debug +%code requires +{ + typedef struct sem_type + { + int ival; + float fval; + } sem_type; + +# define YYSTYPE sem_type + + +# include + static void + report (FILE* yyo, int ival, float fval) + { + fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval); + } + +} + +%code +{ + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%token UNTYPED +%token INT +%type float +%printer { report (yyo, $$, $$); } ; +%printer { report (yyo, $$, $$ ); } ; +%printer { report (yyo, $$, $$); } <>; + +%initial-action +{ + $$ = 42; + $$ = 4.2; +} + +%% +float: UNTYPED INT +{ + $$ = $1 + $2; + $$ = $1 + $2; +}; +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static int const input[] = {UNTYPED, INT, EOF}; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1680" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1680" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/actions.at:1680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1680" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1680" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -error -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1680: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1680" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1680" +$at_failed && at_fn_log_failure +$at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1680: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1680" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" +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:1680" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1680: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1680" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1680" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/actions.at:1680: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1680" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1680" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1680: \$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:1680" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1680" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1680: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1680" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1680" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" +$as_echo "$at_srcdir/actions.at:1680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1680" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +# Don't be too picky on the traces, GLR is not exactly the same. Keep +# only the lines from the printer. { set +x -$as_echo "$at_srcdir/calc.at:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1680: sed -ne '/ival:/p' stderr" +at_fn_check_prepare_trace "actions.at:1680" +( $at_check_trace; sed -ne '/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) +Shifting token UNTYPED (ival: 10, fval: 0.1) +Reading a token: Next token is token INT (ival: 20, fval: 0.2) +Shifting token INT (ival: 20, fval: 0.2) + \$1 = token UNTYPED (ival: 10, fval: 0.1) + \$2 = token INT (ival: 20, fval: 0.2) +-> \$\$ = nterm float (ival: 30, fval: 0.3) +Cleanup: popping nterm float (ival: 30, fval: 0.3) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1680" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -+1 + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_239 +#AT_START_240 +at_fn_group_banner 240 'actions.at:1681' \ + "Qualified \$\$ in actions: glr.c" " " 10 +at_xfail=no +( + $as_echo "240. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%skeleton "glr.c" +%debug +%code requires +{ + typedef struct sem_type + { + int ival; + float fval; + } sem_type; + +# define YYSTYPE sem_type + + +# include + static void + report (FILE* yyo, int ival, float fval) + { + fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval); + } + +} + +%code +{ + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%token UNTYPED +%token INT +%type float +%printer { report (yyo, $$, $$); } ; +%printer { report (yyo, $$, $$ ); } ; +%printer { report (yyo, $$, $$); } <>; + +%initial-action +{ + $$ = 42; + $$ = 4.2; +} + +%% +float: UNTYPED INT +{ + $$ = $1 + $2; + $$ = $1 + $2; +}; +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static int const input[] = {UNTYPED, INT, EOF}; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1681" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1681" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/actions.at:1681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1681" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1681" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1681: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1681" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1681" $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:602: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc /dev/null + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1681: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1681" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" +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:1681" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1681: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1681" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1681" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/actions.at:1681: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1681" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1681" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1681: \$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:1681" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1681" $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:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1681: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1681" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1681" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" +$as_echo "$at_srcdir/actions.at:1681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1681" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +# Don't be too picky on the traces, GLR is not exactly the same. Keep +# only the lines from the printer. { set +x -$as_echo "$at_srcdir/calc.at:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1681: sed -ne '/ival:/p' stderr" +at_fn_check_prepare_trace "actions.at:1681" +( $at_check_trace; sed -ne '/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) +Shifting token UNTYPED (ival: 10, fval: 0.1) +Reading a token: Next token is token INT (ival: 20, fval: 0.2) +Shifting token INT (ival: 20, fval: 0.2) + \$1 = token UNTYPED (ival: 10, fval: 0.1) + \$2 = token INT (ival: 20, fval: 0.2) +-> \$\$ = nterm float (ival: 30, fval: 0.3) +Cleanup: popping nterm float (ival: 30, fval: 0.3) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1681" $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' -(!) + (1 2) = 1 + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_240 +#AT_START_241 +at_fn_group_banner 241 'actions.at:1682' \ + "Qualified \$\$ in actions: lalr1.cc" " " 10 +at_xfail=no +( + $as_echo "241. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%skeleton "lalr1.cc" +%debug +%code requires +{ + typedef struct sem_type + { + int ival; + float fval; + } sem_type; + +# define YYSTYPE sem_type + + +# include + namespace + { + void + report (std::ostream& yyo, int ival, float fval) + { + yyo << "ival: " << ival << ", fval: " << fval; + } + } + +} + +%code +{ + + static int yylex (yy::parser::semantic_type *lvalp); +} + +%token UNTYPED +%token INT +%type float +%printer { report (yyo, $$, $$); } ; +%printer { report (yyo, $$, $$ ); } ; +%printer { report (yyo, $$, $$); } <>; + +%initial-action +{ + $$ = 42; + $$ = 4.2; +} + +%% +float: UNTYPED INT +{ + $$ = $1 + $2; + $$ = $1 + $2; +}; +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static int const input[] = {yy::parser::token::UNTYPED, + yy::parser::token::INT, + EOF}; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1682" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1682" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/actions.at:1682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1682" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1682" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1682: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1682" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1682" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1682: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1682" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +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:1682" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1682: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "actions.at:1682" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1682" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1682: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1682" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1682" $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/actions.at:1682: \$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:1682" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1682" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1682: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1682" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1682" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:602" +$as_echo "$at_srcdir/actions.at:1682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1682" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:602" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1682" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +# Don't be too picky on the traces, GLR is not exactly the same. Keep +# only the lines from the printer. { set +x -$as_echo "$at_srcdir/calc.at:602: cat stderr" -at_fn_check_prepare_trace "calc.at:602" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1682: sed -ne '/ival:/p' stderr" +at_fn_check_prepare_trace "actions.at:1682" +( $at_check_trace; sed -ne '/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" +echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) +Shifting token UNTYPED (ival: 10, fval: 0.1) +Reading a token: Next token is token INT (ival: 20, fval: 0.2) +Shifting token INT (ival: 20, fval: 0.2) + \$1 = token UNTYPED (ival: 10, fval: 0.1) + \$2 = token INT (ival: 20, fval: 0.2) +-> \$\$ = nterm float (ival: 30, fval: 0.3) +Cleanup: popping nterm float (ival: 30, fval: 0.3) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1682" $at_failed && at_fn_log_failure $at_traceon; } - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_203 -#AT_START_204 -at_fn_group_banner 204 'calc.at:603' \ - "Calculator %verbose" " " 11 +#AT_STOP_241 +#AT_START_242 +at_fn_group_banner 242 'actions.at:1683' \ + "Qualified \$\$ in actions: glr.cc" " " 10 at_xfail=no ( - $as_echo "204. $at_setup_line: testing $at_desc ..." + $as_echo "242. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - -cat >calc.y <<'_ATEOF' +cat >input.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -63858,242 +67270,351 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%verbose - +%skeleton "glr.cc" +%debug %code requires { + typedef struct sem_type + { + int ival; + float fval; + } sem_type; - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; -} +# define YYSTYPE sem_type -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; +# include + namespace + { + void + report (std::ostream& yyo, int ival, float fval) + { + yyo << "ival: " << ival << ", fval: " << fval; + } + } + } %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); -static void yyerror ( const char *msg); -int yylex (void); + static int yylex (yy::parser::semantic_type *lvalp); } +%token UNTYPED +%token INT +%type float +%printer { report (yyo, $$, $$); } ; +%printer { report (yyo, $$, $$ ); } ; +%printer { report (yyo, $$, $$); } <>; +%initial-action +{ + $$ = 42; + $$ = 4.2; +} -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type 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; } -; +float: UNTYPED INT +{ + $$ = $1 + $2; + $$ = $1 + $2; +}; %% - -static int -power (int base, int exponent) +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; + std::cerr << m << '\n'; } - - -#include -/* A C error reporting function. */ +#include static -void yyerror ( const char *msg) +int yylex (yy::parser::semantic_type *lvalp) { - fprintf (stderr, "%s\n", msg); + static int const input[] = {yy::parser::token::UNTYPED, + yy::parser::token::INT, + EOF}; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;; + return res; } -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static int -get_char (void) +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) { - int res = getc (input); - ; - - return res; + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } +_ATEOF -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 test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1683" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1683" +$at_failed && at_fn_log_failure +$at_traceon; } - ; - if (c == '-') - { - c = get_char (); - sign = -1; - } + { set +x +$as_echo "$at_srcdir/actions.at:1683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1683" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1683" +$at_failed && at_fn_log_failure +$at_traceon; } - while (isdigit (c)) - { - n = 10 * n + (c - '0'); - c = get_char (); - } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1683: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1683" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1683" +$at_failed && at_fn_log_failure +$at_traceon; } - unget_char ( c); + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1683: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1683" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1683" +$at_failed && at_fn_log_failure +$at_traceon; } - return sign * n; -} + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/actions.at:1683: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "actions.at:1683" +( $at_check_trace; bison -fno-caret -o input.cc input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1683" +$at_failed && at_fn_log_failure +$at_traceon; } -/*---------------------------------------------------------------. -| 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { +{ set +x +$as_echo "$at_srcdir/actions.at:1683: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1683" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1683" +$at_failed && at_fn_log_failure +$at_traceon; } - } - while ((c = get_char ()) == ' ' || c == '\t'); +{ set +x +$as_echo "$at_srcdir/actions.at:1683: \$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:1683" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1683" +$at_failed && at_fn_log_failure +$at_traceon; } - /* process numbers */ - if (c == '.' || isdigit (c)) - { - unget_char ( c); - (yylval).ival = read_signed_integer (); - return NUM; - } +{ set +x +$as_echo "$at_srcdir/actions.at:1683: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1683" +( $at_check_trace; $PREPARSER ./input --debug +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1683" +$at_failed && at_fn_log_failure +$at_traceon; } - /* Return end-of-file. */ - if (c == EOF) - return CALC_EOF; +{ set +x +$as_echo "$at_srcdir/actions.at:1683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1683" +$at_failed && at_fn_log_failure +$at_traceon; } - /* Return single chars. */ - return c; -} -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +# Don't be too picky on the traces, GLR is not exactly the same. Keep +# only the lines from the printer. +{ set +x +$as_echo "$at_srcdir/actions.at:1683: sed -ne '/ival:/p' stderr" +at_fn_check_prepare_trace "actions.at:1683" +( $at_check_trace; sed -ne '/ival:/p' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) +Shifting token UNTYPED (ival: 10, fval: 0.1) +Reading a token: Next token is token INT (ival: 20, fval: 0.2) +Shifting token INT (ival: 20, fval: 0.2) + \$1 = token UNTYPED (ival: 10, fval: 0.1) + \$2 = token INT (ival: 20, fval: 0.2) +-> \$\$ = nterm float (ival: 30, fval: 0.3) +Cleanup: popping nterm float (ival: 30, fval: 0.3) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1683" +$at_failed && at_fn_log_failure +$at_traceon; } -semantic_value global_result = 0; -int global_count = 0; -/* A C main function. */ -int -main (int argc, const char **argv) -{ - semantic_value result = 0; - int count = 0; - int status; + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_242 +#AT_START_243 +at_fn_group_banner 243 'actions.at:1691' \ + "Destroying lookahead assigned by semantic action" "" 10 +at_xfail=no +( + $as_echo "243. $at_setup_line: testing $at_desc ..." + $at_traceon - /* 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; - } +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} - status = yyparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; +%code { + #include + #include +#include + +static void yyerror (const char *msg); +static int yylex (void); + #define USE(Var) } -_ATEOF +%destructor { fprintf (stderr, "'a' destructor\n"); } 'a' +%destructor { fprintf (stderr, "'b' destructor\n"); } 'b' + +%% +// In a previous version of Bison, yychar assigned by the semantic +// action below was not translated into yytoken before the lookahead was +// discarded and thus before its destructor (selected according to +// yytoken) was called in order to return from yyparse. This would +// happen even if YYACCEPT was performed in a later semantic action as +// long as only consistent states with default reductions were visited +// in between. However, we leave YYACCEPT in the same semantic action +// for this test in order to show that skeletons cannot simply translate +// immediately after every semantic action because a semantic action +// that has set yychar might not always return normally. Instead, +// skeletons must translate before every use of yytoken. +start: 'a' accept { USE($1); } ; +accept: %empty { + assert (yychar == YYEMPTY); + yychar = 'b'; + YYACCEPT; +} ; +%% +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "a"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF @@ -64103,39 +67624,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:603" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1733: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1733" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1733" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:603" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1733: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1733" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1733" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:1733: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:603" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1733" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -64144,16 +67665,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1733" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\ +$as_echo "$at_srcdir/actions.at:1733: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:603" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1733" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -64162,7 +67683,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1733" $at_failed && at_fn_log_failure $at_traceon; } @@ -64170,950 +67691,849 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:603: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/actions.at:1733: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1733" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1733" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:603: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:603" +{ set +x +$as_echo "$at_srcdir/actions.at:1734: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1734" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1734" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:603: \$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:603" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/actions.at:1734: \$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:1734" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:603" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:603: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:603" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1734" $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:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1738: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1738" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1738" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" +$as_echo "$at_srcdir/actions.at:1738: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1738" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "'b' destructor +'a' destructor +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1738" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_243 +#AT_START_244 +at_fn_group_banner 244 'actions.at:1746' \ + "YYBACKUP" " " 10 +at_xfail=no +( + $as_echo "244. $at_setup_line: testing $at_desc ..." + $at_traceon + + + -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + + +%error-verbose +%debug +%pure-parser +%code { +# include +# include +# include + + #include + +static void yyerror (const char *msg); + static int yylex (YYSTYPE *lvalp); +} +%% +input: + exp exp {} +; + +exp: + 'a' { printf ("a: %d\n", $1); } +| 'b' { YYBACKUP('a', 123); } +| 'c' 'd' { YYBACKUP('a', 456); } +; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (YYSTYPE *lvalp) +{ + static char const input[] = "bcd"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + *lvalp = (toknum + 1) * 10; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1781: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1781" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1781" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/actions.at:1781: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1781" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1781" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/actions.at:1781: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1781" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1781" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1//2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/actions.at:1781: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1781" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" +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:1781" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1781: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "actions.at:1781" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1781" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1782: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1782" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1782" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -error -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/actions.at:1782: \$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:1782" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1782" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/actions.at:1786: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1786" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +echo >>"$at_stdout"; $as_echo "a: 123 +a: 456 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1786" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/actions.at:1786: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "actions.at:1786" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1786" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -1 = 2 = 3 + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_244 +#AT_START_245 +at_fn_group_banner 245 'types.at:25' \ + "%union vs. api.value.type" " " 11 +at_xfail=no +( + $as_echo "245. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%union { int ival; } +%define api.value.type union-directive +%% +exp: %empty; _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" -$at_failed && at_fn_log_failure -$at_traceon; } + { set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:36: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "types.at:36" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stderr"; $as_echo "input.y:2.9-22: error: '%union' and '%define api.value.type' cannot be used together +" | \ + $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +at_fn_check_status 1 $at_status "$at_srcdir/types.at:36" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '=' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_245 +#AT_START_246 +at_fn_group_banner 246 'types.at:44' \ + "%yacc vs. api.value.type=union" " " 11 +at_xfail=no +( + $as_echo "246. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%yacc +%define api.value.type union +%% +exp: %empty; _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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:55: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "types.at:55" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +echo >>"$at_stderr"; $as_echo "input.y:2.9-22: error: '%yacc' and '%define api.value.type \"union\"' cannot be used together +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/types.at:55" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -+1 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_246 +#AT_START_247 +at_fn_group_banner 247 'types.at:253' \ + "yacc.c api.value.type={double}" " " 11 +at_xfail=no +( + $as_echo "247. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type {double} + + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval) = (res - '0') / 10.0; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:603: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc /dev/null + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_247 +#AT_START_248 +at_fn_group_banner 248 'types.at:253' \ + "yacc.c api.value.type={double} %defines" " " 11 +at_xfail=no +( + $as_echo "248. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" -$at_failed && at_fn_log_failure -$at_traceon; } +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -# The same, but this time exercising explicitly triggered syntax errors. -# POSIX says the lookahead causing the error should not be discarded. -cat >input <<'_ATEOF' -(!) + (1 2) = 1 +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type {double} %defines + + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval) = (res - '0') / 10.0; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:603" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:603: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:603" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:603: cat stderr" -at_fn_check_prepare_trace "calc.at:603" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_204 -#AT_START_205 -at_fn_group_banner 205 'calc.at:604' \ - "Calculator %yacc" " " 11 +#AT_STOP_248 +#AT_START_249 +at_fn_group_banner 249 'types.at:253' \ + "yacc.c api.value.type={variant}" " " 11 at_xfail=no ( - $as_echo "205. $at_setup_line: testing $at_desc ..." + $as_echo "249. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -65122,284 +68542,102 @@ cat >calc.y <<'_ATEOF' #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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include +#include -static void yyerror ( const char *msg); -int yylex (void); +static void yyerror (const char *msg); +static int yylex (void); } +%skeleton "yacc.c" + %define api.value.type {variant} +%code requires { typedef double variant; } - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static int -get_char (void) +#include +static +int yylex (void) { - int res = getc (input); + static char const input[] = "12"; + static size_t toknum = 0; + int res; ; - + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval) = (res - '0') / 10.0; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - - } - 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; -} - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:604" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:604" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:604" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -65408,16 +68646,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:604" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -65426,7 +68664,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -65434,950 +68672,1007 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:604: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:604: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:604" + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:604: \$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:604" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:604: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:604" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Test the priorities. -cat >input <<'_ATEOF' -1 + 2 * 3 = 7 -1 + 2 * -3 = -5 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_249 +#AT_START_250 +at_fn_group_banner 250 'types.at:253' \ + "yacc.c api.value.type={variant} %defines" " " 11 +at_xfail=no +( + $as_echo "250. $at_setup_line: testing $at_desc ..." + $at_traceon --1^2 = -1 -(-1)^2 = 1 ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -2^2^3 = 256 -(2^2)^3 = 64 +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type {variant} %defines +%code requires { typedef double variant; } + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval) = (res - '0') / 10.0; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } - - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1//2 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_250 +#AT_START_251 +at_fn_group_banner 251 'types.at:253' \ + "yacc.c api.value.type={struct foo}" " " 11 +at_xfail=no +( + $as_echo "251. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type {struct foo} +%code requires { struct foo { float fval; int ival; }; } + +%% + +start: '1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).ival = (res - '0') * 10; + (yylval).fval = (res - '0') / 10.f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -error -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" +echo >>"$at_stdout"; $as_echo "30 0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_251 +#AT_START_252 +at_fn_group_banner 252 'types.at:253' \ + "yacc.c api.value.type={struct foo} %defines" " " 11 +at_xfail=no +( + $as_echo "252. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" -$at_failed && at_fn_log_failure -$at_traceon; } -cat >input <<'_ATEOF' +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -+1 +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type {struct foo} %defines +%code requires { struct foo { float fval; int ival; }; } + +%% + +start: '1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).ival = (res - '0') * 10; + (yylval).fval = (res - '0') / 10.f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:604: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc /dev/null + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +echo >>"$at_stdout"; $as_echo "30 0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_252 +#AT_START_253 +at_fn_group_banner 253 'types.at:253' \ + "yacc.c api.value.type={struct bar}" " " 11 +at_xfail=no +( + $as_echo "253. $at_setup_line: testing $at_desc ..." + $at_traceon + -# 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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" -$at_failed && at_fn_log_failure -$at_traceon; } +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%debug -# The same, but this time exercising explicitly triggered syntax errors. -# POSIX says the lookahead causing the error should not be discarded. -cat >input <<'_ATEOF' -(!) + (1 2) = 1 +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type {struct bar} +%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { fprintf (yyo, "%d", $$); } ival> + + +%% + +start: '1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).up = (struct u *) malloc (sizeof *(yylval).up); + assert ((yylval).up); + (yylval).up->ival = res - '0';; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:604" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:604: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:604" +echo >>"$at_stdout"; $as_echo "1 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:604: cat stderr" -at_fn_check_prepare_trace "calc.at:604" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_205 -#AT_START_206 -at_fn_group_banner 206 'calc.at:605' \ - "Calculator %error-verbose" " " 11 +#AT_STOP_253 +#AT_START_254 +at_fn_group_banner 254 'types.at:253' \ + "yacc.c api.value.type={struct bar} %defines" " " 11 at_xfail=no ( - $as_echo "206. $at_setup_line: testing $at_desc ..." + $as_echo "254. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -66386,284 +69681,122 @@ cat >calc.y <<'_ATEOF' #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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include +#include -static void yyerror ( const char *msg); -int yylex (void); +static void yyerror (const char *msg); +static int yylex (void); } +%skeleton "yacc.c" + %define api.value.type {struct bar} %defines +%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { fprintf (yyo, "%d", $$); } ival> -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static int -get_char (void) +#include +static +int yylex (void) { - int res = getc (input); + static char const input[] = "12"; + static size_t toknum = 0; + int res; ; - + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).up = (struct u *) malloc (sizeof *(yylval).up); + assert ((yylval).up); + (yylval).up->ival = res - '0';; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - - } - 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; -} - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:605: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:605" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:605: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:605" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:605: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:605" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -66672,16 +69805,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:605: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:605" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -66690,7 +69823,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -66698,940 +69831,997 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:605: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:605: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:605" + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:605: \$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:605" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:605: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:605" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "1 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Test the priorities. -cat >input <<'_ATEOF' -1 + 2 * 3 = 7 -1 + 2 * -3 = -5 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_254 +#AT_START_255 +at_fn_group_banner 255 'types.at:253' \ + "yacc.c api.value.type={union foo}" " " 11 +at_xfail=no +( + $as_echo "255. $at_setup_line: testing $at_desc ..." + $at_traceon --1^2 = -1 -(-1)^2 = 1 ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -2^2^3 = 256 -(2^2)^3 = 64 +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type {union foo} +%code requires { union foo { float fval; int ival; }; } + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = .2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } - - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1//2 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_255 +#AT_START_256 +at_fn_group_banner 256 'types.at:253' \ + "yacc.c api.value.type={union foo} %defines" " " 11 +at_xfail=no +( + $as_echo "256. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type {union foo} %defines +%code requires { union foo { float fval; int ival; }; } + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = .2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -error -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' - -+1 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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 '+' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_256 +#AT_START_257 +at_fn_group_banner 257 'types.at:253' \ + "yacc.c %union { float fval; int ival; };" " " 11 +at_xfail=no +( + $as_echo "257. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %union { float fval; int ival; }; +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:605: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc /dev/null + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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' -(!) + (1 2) = 1 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_257 +#AT_START_258 +at_fn_group_banner 258 'types.at:253' \ + "yacc.c %union { float fval; int ival; }; %defines" "" 11 +at_xfail=no +( + $as_echo "258. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %union { float fval; int ival; }; %defines +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$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/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:605: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:605" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:605: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:605" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:605: cat stderr" -at_fn_check_prepare_trace "calc.at:605" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:605" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_206 -#AT_START_207 -at_fn_group_banner 207 'calc.at:607' \ - "Calculator %define api.pure full %locations" " " 11 +#AT_STOP_258 +#AT_START_259 +at_fn_group_banner 259 'types.at:253' \ + "yacc.c %union foo { float fval; int ival; };" " " 11 at_xfail=no ( - $as_echo "207. $at_setup_line: testing $at_desc ..." + $as_echo "259. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -67640,302 +70830,106 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%define api.pure full %locations - -%code requires -{ - - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; -} - -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include +#include -static void yyerror (YYLTYPE const * const llocp, const char *msg); -int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); +static void yyerror (const char *msg); +static int yylex (void); } +%skeleton "yacc.c" + %union foo { float fval; int ival; }; +%token '1'; + %token '2'; - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - -#include /* A C error reporting function. */ static -void yyerror (YYLTYPE const * const llocp, const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (*llocp)); - fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } -#include - -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) +#include +static +int yylex (void) { - 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++; - + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (*llocp).first_column = (*llocp).last_column; - (*llocp).first_line = (*llocp).last_line; - - } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); - - /* 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; -} - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:607" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:607" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:607" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -67944,16 +70938,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:607" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -67962,7 +70956,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -67970,940 +70964,1004 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:607: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:607: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:607" + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:607: \$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:607" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:607: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:607" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_259 +#AT_START_260 +at_fn_group_banner 260 'types.at:253' \ + "yacc.c %union foo { float fval; int ival; }; %defines" "" 11 +at_xfail=no +( + $as_echo "260. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %union foo { float fval; int ival; }; %defines +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } - - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1//2 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_260 +#AT_START_261 +at_fn_group_banner 261 'types.at:253' \ + "yacc.c api.value.union.name=foo; %union { float fval; int ival; };" "" 11 +at_xfail=no +( + $as_echo "261. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.union.name foo; %union { float fval; int ival; }; +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -error -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' - -+1 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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 '+' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_261 +#AT_START_262 +at_fn_group_banner 262 'types.at:253' \ + "yacc.c api.value.union.name=foo; %union { float fval; int ival; }; %defines" "" 11 +at_xfail=no +( + $as_echo "262. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.union.name foo; %union { float fval; int ival; }; %defines +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:607: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc /dev/null + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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' -(!) + (1 2) = 1 -_ATEOF - { set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_262 +#AT_START_263 +at_fn_group_banner 263 'types.at:253' \ + "yacc.c api.value.type=union" " " 11 +at_xfail=no +( + $as_echo "263. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "yacc.c" + %define api.value.type union +%token ONE 101; + %token TWO 102 THREE 103; + %printer { fprintf (yyo, "%d", $$); } + %printer { fprintf (yyo, "%f", $$); } + + +%% + +start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static int const input[] = { 101, 102, 103, EOF }; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == 101) + (yylval).ONE = 10; + else if (res == 102) + (yylval).TWO = .2f; + else if (res == 103) + (yylval).THREE = 3.3f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$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/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:607" +echo >>"$at_stdout"; $as_echo "10 0.2 3.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:607: cat stderr" -at_fn_check_prepare_trace "calc.at:607" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_207 -#AT_START_208 -at_fn_group_banner 208 'calc.at:608' \ - "Calculator %define api.push-pull both %define api.pure full %locations" "" 11 +#AT_STOP_263 +#AT_START_264 +at_fn_group_banner 264 'types.at:253' \ + "yacc.c api.value.type=union %defines" " " 11 at_xfail=no ( - $as_echo "208. $at_setup_line: testing $at_desc ..." + $as_echo "264. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -68912,302 +71970,111 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%define api.push-pull both %define api.pure full %locations +%debug -%code requires +%code { +# include +# include +#include - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; +static void yyerror (const char *msg); +static int yylex (void); } -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} - -%code -{ -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); - -static void yyerror (YYLTYPE const * const llocp, const char *msg); -int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); -} - - - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp +%skeleton "yacc.c" + %define api.value.type union %defines +%token ONE 101; + %token TWO 102 THREE 103; + %printer { fprintf (yyo, "%d", $$); } + %printer { fprintf (yyo, "%f", $$); } -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - -#include /* A C error reporting function. */ static -void yyerror (YYLTYPE const * const llocp, const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (*llocp)); - fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } -#include - -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) +#include +static +int yylex (void) { - 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++; - + static int const input[] = { 101, 102, 103, EOF }; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == 101) + (yylval).ONE = 10; + else if (res == 102) + (yylval).TWO = .2f; + else if (res == 103) + (yylval).THREE = 3.3f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (*llocp).first_column = (*llocp).last_column; - (*llocp).first_line = (*llocp).last_line; - - } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); - - /* 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; -} - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:608" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -69216,16 +72083,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:608" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -69234,7 +72101,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -69242,940 +72109,983 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:608: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:608" + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:608" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:608: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:608" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10 0.2 3.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Test the priorities. -cat >input <<'_ATEOF' -1 + 2 * 3 = 7 -1 + 2 * -3 = -5 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_264 +#AT_START_265 +at_fn_group_banner 265 'types.at:253' \ + "glr.c api.value.type={double}" " " 11 +at_xfail=no +( + $as_echo "265. $at_setup_line: testing $at_desc ..." + $at_traceon --1^2 = -1 -(-1)^2 = 1 ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -2^2^3 = 256 -(2^2)^3 = 64 +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %define api.value.type {double} + + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval) = (res - '0') / 10.0; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } - - -# Some syntax errors. -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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_265 +#AT_START_266 +at_fn_group_banner 266 'types.at:253' \ + "glr.c api.value.type={double} %defines" " " 11 +at_xfail=no +( + $as_echo "266. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %define api.value.type {double} %defines + + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval) = (res - '0') / 10.0; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:608" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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 '+' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_266 +#AT_START_267 +at_fn_group_banner 267 'types.at:253' \ + "glr.c api.value.type={variant}" " " 11 +at_xfail=no +( + $as_echo "267. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %define api.value.type {variant} +%code requires { typedef double variant; } + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval) = (res - '0') / 10.0; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 - + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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' -(!) + (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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_267 +#AT_START_268 +at_fn_group_banner 268 'types.at:253' \ + "glr.c api.value.type={variant} %defines" " " 11 +at_xfail=no +( + $as_echo "268. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %define api.value.type {variant} %defines +%code requires { typedef double variant; } + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval) = (res - '0') / 10.0; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$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/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { 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 +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:608: cat stderr" -at_fn_check_prepare_trace "calc.at:608" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_208 -#AT_START_209 -at_fn_group_banner 209 'calc.at:609' \ - "Calculator %error-verbose %locations" " " 11 +#AT_STOP_268 +#AT_START_269 +at_fn_group_banner 269 'types.at:253' \ + "glr.c api.value.type={struct foo}" " " 11 at_xfail=no ( - $as_echo "209. $at_setup_line: testing $at_desc ..." + $as_echo "269. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -70184,302 +73094,104 @@ cat >calc.y <<'_ATEOF' #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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include +#include -static void yyerror ( const char *msg); -int yylex (void); +static void yyerror (const char *msg); +static int yylex (void); } +%skeleton "glr.c" + %define api.value.type {struct foo} +%code requires { struct foo { float fval; int ival; }; } - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (yylloc)); - fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static YYLTYPE last_yylloc; - -static int -get_char (void) +#include +static +int yylex (void) { - int res = getc (input); + static char const input[] = "12"; + static size_t toknum = 0; + int res; ; - - last_yylloc = (yylloc); - if (res == '\n') - { - (yylloc).last_line++; - (yylloc).last_column = 1; - } - else - (yylloc).last_column++; - + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).ival = (res - '0') * 10; + (yylval).fval = (res - '0') / 10.f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (yylloc).first_column = (yylloc).last_column; - (yylloc).first_line = (yylloc).last_line; - - } - 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; -} - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:609" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:609: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -70488,16 +73200,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:609: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:609" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -70506,7 +73218,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -70514,930 +73226,802 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:609: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:609" + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:609" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "30 0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_269 +#AT_START_270 +at_fn_group_banner 270 'types.at:253' \ + "glr.c api.value.type={struct foo} %defines" " " 11 +at_xfail=no +( + $as_echo "270. $at_setup_line: testing $at_desc ..." + $at_traceon -# Some syntax errors. -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" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo 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; } -{ set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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; } +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include +static void yyerror (const char *msg); +static int yylex (void); +} +%skeleton "glr.c" + %define api.value.type {struct foo} %defines +%code requires { struct foo { float fval; int ival; }; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +%% + +start: '1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).ival = (res - '0') * 10; + (yylval).fval = (res - '0') / 10.f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -error -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:609" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "30 0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_270 +#AT_START_271 +at_fn_group_banner 271 'types.at:253' \ + "glr.c api.value.type={struct bar}" " " 11 +at_xfail=no +( + $as_echo "271. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%debug -cat >input <<'_ATEOF' +%code +{ +# include +# include +#include -+1 +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %define api.value.type {struct bar} +%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { fprintf (yyo, "%d", $$); } ival> + + +%% + +start: '1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).up = (struct u *) malloc (sizeof *(yylval).up); + assert ((yylval).up); + (yylval).up->ival = res - '0';; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "1 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_271 +#AT_START_272 +at_fn_group_banner 272 'types.at:253' \ + "glr.c api.value.type={struct bar} %defines" " " 11 +at_xfail=no +( + $as_echo "272. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug +%code +{ +# include +# include +#include +static void yyerror (const char *msg); +static int yylex (void); +} -# The same, but this time exercising explicitly triggered syntax errors. -# POSIX says the lookahead causing the error should not be discarded. -cat >input <<'_ATEOF' -(!) + (1 2) = 1 +%skeleton "glr.c" + %define api.value.type {struct bar} %defines +%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { fprintf (yyo, "%d", $$); } ival> + + +%% + +start: '1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (yylval).up = (struct u *) malloc (sizeof *(yylval).up); + assert ((yylval).up); + (yylval).up->ival = res - '0';; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "1 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:609: cat stderr" -at_fn_check_prepare_trace "calc.at:609" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_209 -#AT_START_210 -at_fn_group_banner 210 'calc.at:611' \ - "Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11 +#AT_STOP_272 +#AT_START_273 +at_fn_group_banner 273 'types.at:253' \ + "glr.c api.value.type={union foo}" " " 11 at_xfail=no ( - $as_echo "210. $at_setup_line: testing $at_desc ..." + $as_echo "273. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -71446,325 +74030,105 @@ cat >calc.y <<'_ATEOF' #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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include +#include -static void calcerror ( const char *msg); -int calclex (void); +static void yyerror (const char *msg); +static int yylex (void); } +%skeleton "glr.c" + %define api.value.type {union foo} +%code requires { union foo { float fval; int ival; }; } - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - -#include /* A C error reporting function. */ static -void calcerror ( const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (calclloc)); - fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include - -int calclex (void); -static int get_char (void); -static void unget_char ( int c); - - -static YYLTYPE last_yylloc; - -static int -get_char (void) +#include +static +int yylex (void) { - int res = getc (input); + static char const input[] = "12"; + static size_t toknum = 0; + int res; ; - - last_yylloc = (calclloc); - if (res == '\n') - { - (calclloc).last_line++; - (calclloc).last_column = 1; - } - else - (calclloc).last_column++; - + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = .2f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (calclloc).first_column = (calclloc).last_column; - (calclloc).first_line = (calclloc).last_line; - - } - 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; -} -_ATEOF - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 = calcparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:611" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -71773,16 +74137,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:611" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -71791,7 +74155,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -71799,958 +74163,998 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:611: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:611" + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:611" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:611: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:611: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_273 +#AT_START_274 +at_fn_group_banner 274 'types.at:253' \ + "glr.c api.value.type={union foo} %defines" " " 11 +at_xfail=no +( + $as_echo "274. $at_setup_line: testing $at_desc ..." + $at_traceon ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 -2^2^3 = 256 -(2^2)^3 = 64 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %define api.value.type {union foo} %defines +%code requires { union foo { float fval; int ival; }; } + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = .2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } - - -# Some syntax errors. -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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_274 +#AT_START_275 +at_fn_group_banner 275 'types.at:253' \ + "glr.c %union { float fval; int ival; };" " " 11 +at_xfail=no +( + $as_echo "275. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %union { float fval; int ival; }; +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -error -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -{ 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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_275 +#AT_START_276 +at_fn_group_banner 276 'types.at:253' \ + "glr.c %union { float fval; int ival; }; %defines" "" 11 +at_xfail=no +( + $as_echo "276. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%debug -cat >input <<'_ATEOF' +%code +{ +# include +# include +#include -+1 +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %union { float fval; int ival; }; %defines +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_276 +#AT_START_277 +at_fn_group_banner 277 'types.at:253' \ + "glr.c %union foo { float fval; int ival; };" " " 11 +at_xfail=no +( + $as_echo "277. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug +%code +{ +# include +# include +#include +static void yyerror (const char *msg); +static int yylex (void); +} -# The same, but this time exercising explicitly triggered syntax errors. -# POSIX says the lookahead causing the error should not be discarded. -cat >input <<'_ATEOF' -(!) + (1 2) = 1 +%skeleton "glr.c" + %union foo { float fval; int ival; }; +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:611: cat stderr" -at_fn_check_prepare_trace "calc.at:611" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_210 -#AT_START_211 -at_fn_group_banner 211 'calc.at:612' \ - "Calculator %error-verbose %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11 +#AT_STOP_277 +#AT_START_278 +at_fn_group_banner 278 'types.at:253' \ + "glr.c %union foo { float fval; int ival; }; %defines" "" 11 at_xfail=no ( - $as_echo "211. $at_setup_line: testing $at_desc ..." + $as_echo "278. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -72759,325 +75163,106 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%error-verbose %locations %defines %define api.prefix "calc" %verbose %yacc - -%code requires -{ - - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; -} - -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include +#include -static void calcerror ( const char *msg); -int calclex (void); +static void yyerror (const char *msg); +static int yylex (void); } +%skeleton "glr.c" + %union foo { float fval; int ival; }; %defines +%token '1'; + %token '2'; - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - -#include /* A C error reporting function. */ static -void calcerror ( const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (calclloc)); - fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include - -int calclex (void); -static int get_char (void); -static void unget_char ( int c); - - -static CALCLTYPE last_yylloc; - -static int -get_char (void) +#include +static +int yylex (void) { - int res = getc (input); + static char const input[] = "12"; + static size_t toknum = 0; + int res; ; - - last_yylloc = (calclloc); - if (res == '\n') - { - (calclloc).last_line++; - (calclloc).last_column = 1; - } - else - (calclloc).last_column++; - + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (calclloc).first_column = (calclloc).last_column; - (calclloc).first_line = (calclloc).last_line; - - } - 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; -} -_ATEOF - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 = calcparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:612" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:612: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -73086,16 +75271,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:612: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:612" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -73104,7 +75289,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -73112,958 +75297,777 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:612: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:612" + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:612" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:612: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:612: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_278 +#AT_START_279 +at_fn_group_banner 279 'types.at:253' \ + "glr.c api.value.union.name=foo; %union { float fval; int ival; };" "" 11 +at_xfail=no +( + $as_echo "279. $at_setup_line: testing $at_desc ..." + $at_traceon ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 -2^2^3 = 256 -(2^2)^3 = 64 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include +#include + +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %define api.value.union.name foo; %union { float fval; int ival; }; +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - - -# Some syntax errors. -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 + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_279 +#AT_START_280 +at_fn_group_banner 280 'types.at:253' \ + "glr.c api.value.union.name=foo; %union { float fval; int ival; }; %defines" "" 11 +at_xfail=no +( + $as_echo "280. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%debug -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF +%code +{ +# include +# include +#include -{ 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" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo 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; } +static void yyerror (const char *msg); +static int yylex (void); +} -{ set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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; } +%skeleton "glr.c" + %define api.value.union.name foo; %union { float fval; int ival; }; %defines +%token '1'; + %token '2'; +%% +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '=' +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (yylval).ival = 10; + else + (yylval).fval = 0.2f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -# Exercise error messages with EOF: work on an empty file. + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:612" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_280 +#AT_START_281 +at_fn_group_banner 281 'types.at:253' \ + "glr.c api.value.type=union" " " 11 +at_xfail=no +( + $as_echo "281. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%debug +%code +{ +# include +# include +#include -# The same, but this time exercising explicitly triggered syntax errors. -# POSIX says the lookahead causing the error should not be discarded. -cat >input <<'_ATEOF' -(!) + (1 2) = 1 +static void yyerror (const char *msg); +static int yylex (void); +} + +%skeleton "glr.c" + %define api.value.type union +%token ONE 101; + %token TWO 102 THREE 103; + %printer { fprintf (yyo, "%d", $$); } + %printer { fprintf (yyo, "%f", $$); } + + +%% + +start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static int const input[] = { 101, 102, 103, EOF }; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == 101) + (yylval).ONE = 10; + else if (res == 102) + (yylval).TWO = .2f; + else if (res == 103) + (yylval).THREE = 3.3f; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:612: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 3.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:612: cat stderr" -at_fn_check_prepare_trace "calc.at:612" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_211 -#AT_START_212 -at_fn_group_banner 212 'calc.at:614' \ - "Calculator %debug" " " 11 +#AT_STOP_281 +#AT_START_282 +at_fn_group_banner 282 'types.at:253' \ + "glr.c api.value.type=union %defines" " " 11 at_xfail=no ( - $as_echo "212. $at_setup_line: testing $at_desc ..." + $as_echo "282. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -74072,284 +76076,111 @@ cat >calc.y <<'_ATEOF' #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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} - %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include +#include -static void yyerror ( const char *msg); -int yylex (void); +static void yyerror (const char *msg); +static int yylex (void); } +%skeleton "glr.c" + %define api.value.type union %defines +%token ONE 101; + %token TWO 102 THREE 103; + %printer { fprintf (yyo, "%d", $$); } + %printer { fprintf (yyo, "%f", $$); } -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; -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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - -#include /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static int -get_char (void) +#include +static +int yylex (void) { - int res = getc (input); + static int const input[] = { 101, 102, 103, EOF }; + static size_t toknum = 0; + int res; ; - + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == 101) + (yylval).ONE = 10; + else if (res == 102) + (yylval).TWO = .2f; + else if (res == 103) + (yylval).THREE = 3.3f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - - } - 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; -} - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include /* getenv. */ +#include /* strcmp. */ int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF - - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:614" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.c test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:614" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:614" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -74358,16 +76189,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:614" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -74376,7 +76207,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -74384,950 +76215,1198 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:614: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.c test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:614: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:614" + { set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:253" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: \$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:614" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:253" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:614: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:614" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10 0.2 3.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Test the priorities. -cat >input <<'_ATEOF' -1 + 2 * 3 = 7 -1 + 2 * -3 = -5 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_282 +#AT_START_283 +at_fn_group_banner 283 'types.at:253' \ + "lalr1.cc api.value.type={double}" " " 11 +at_xfail=no +( + $as_echo "283. $at_setup_line: testing $at_desc ..." + $at_traceon --1^2 = -1 -(-1)^2 = 1 ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -2^2^3 = 256 -(2^2)^3 = 64 +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {double} + + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp) = (res - '0') / 10.0; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } - - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1//2 -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_283 +#AT_START_284 +at_fn_group_banner 284 'types.at:253' \ + "lalr1.cc api.value.type={double} %defines" " " 11 +at_xfail=no +( + $as_echo "284. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {double} %defines + + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp) = (res - '0') / 10.0; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -error -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '=' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_284 +#AT_START_285 +at_fn_group_banner 285 'types.at:253' \ + "lalr1.cc api.value.type={variant}" " " 11 +at_xfail=no +( + $as_echo "285. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {variant} +%code requires { typedef double variant; } + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp) = (res - '0') / 10.0; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' - -+1 -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$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:614: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc /dev/null +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_285 +#AT_START_286 +at_fn_group_banner 286 'types.at:253' \ + "lalr1.cc api.value.type={variant} %defines" " " 11 +at_xfail=no +( + $as_echo "286. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {variant} %defines +%code requires { typedef double variant; } + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp) = (res - '0') / 10.0; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$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:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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' -(!) + (1 2) = 1 -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_286 +#AT_START_287 +at_fn_group_banner 287 'types.at:253' \ + "lalr1.cc api.value.type={struct foo}" " " 11 +at_xfail=no +( + $as_echo "287. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {struct foo} +%code requires { struct foo { float fval; int ival; }; } + +%% + +start: '1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).ival = (res - '0') * 10; + (*lvalp).fval = (res - '0') / 10.f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:614" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:614: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:614" +echo >>"$at_stdout"; $as_echo "30 0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:614: cat stderr" -at_fn_check_prepare_trace "calc.at:614" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_212 -#AT_START_213 -at_fn_group_banner 213 'calc.at:615' \ - "Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11 +#AT_STOP_287 +#AT_START_288 +at_fn_group_banner 288 'types.at:253' \ + "lalr1.cc api.value.type={struct foo} %defines" " " 11 at_xfail=no ( - $as_echo "213. $at_setup_line: testing $at_desc ..." + $as_echo "288. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -75336,325 +77415,101 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc +%debug -%code requires +%code { +# include +# include - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; +static int yylex (yy::parser::semantic_type *lvalp); } -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; +%skeleton "lalr1.cc" + %define api.value.type {struct foo} %defines +%code requires { struct foo { float fval; int ival; }; } -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%% -%code +start: '1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { + std::cerr << m << '\n'; +} #include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); - -static void calcerror ( const char *msg); -int calclex (void); -} - - - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type 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 int -power (int base, int exponent) -{ - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; -} - - -#include -/* A C error reporting function. */ static -void calcerror ( const char *msg) -{ - YY_LOCATION_PRINT (stderr, (calclloc)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include - -int calclex (void); -static int get_char (void); -static void unget_char ( int c); - - -static YYLTYPE last_yylloc; - -static int -get_char (void) +int yylex (yy::parser::semantic_type *lvalp) { - int res = getc (input); - ; - - last_yylloc = (calclloc); - if (res == '\n') - { - (calclloc).last_line++; - (calclloc).last_column = 1; - } - else - (calclloc).last_column++; - + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).ival = (res - '0') * 10; + (*lvalp).fval = (res - '0') / 10.f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (calclloc).first_column = (calclloc).last_column; - (calclloc).first_line = (calclloc).last_line; - - } - 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; -} -_ATEOF - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include // getenv. +#include // strcmp. int -main (int argc, const char **argv) +main (int argc, char const* 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; - } - - calcdebug = 1; - status = calcparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:615" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -75663,16 +77518,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:615" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -75681,7 +77536,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -75689,958 +77544,1022 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:615: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:615" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:615" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:615: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "30 0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:615: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_288 +#AT_START_289 +at_fn_group_banner 289 'types.at:253' \ + "lalr1.cc api.value.type={struct bar}" " " 11 +at_xfail=no +( + $as_echo "289. $at_setup_line: testing $at_desc ..." + $at_traceon ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 -2^2^3 = 256 -(2^2)^3 = 64 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {struct bar} +%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { yyoutput << $$; } ival> + + +%% + +start: '1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).up = (struct u *) malloc (sizeof *(*lvalp).up); + assert ((*lvalp).up); + (*lvalp).up->ival = res - '0';; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } - - -# Some syntax errors. -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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1//2 -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { 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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "1 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_289 +#AT_START_290 +at_fn_group_banner 290 'types.at:253' \ + "lalr1.cc api.value.type={struct bar} %defines" " " 11 +at_xfail=no +( + $as_echo "290. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {struct bar} %defines +%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { yyoutput << $$; } ival> + + +%% + +start: '1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).up = (struct u *) malloc (sizeof *(*lvalp).up); + assert ((*lvalp).up); + (*lvalp).up->ival = res - '0';; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:615" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "1 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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 '+' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_290 +#AT_START_291 +at_fn_group_banner 291 'types.at:253' \ + "lalr1.cc api.value.type={union foo}" " " 11 +at_xfail=no +( + $as_echo "291. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {union foo} +%code requires { union foo { float fval; int ival; }; } + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).ival = 10; + else + (*lvalp).fval = .2f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 - + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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' -(!) + (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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_291 +#AT_START_292 +at_fn_group_banner 292 'types.at:253' \ + "lalr1.cc api.value.type={union foo} %defines" " " 11 +at_xfail=no +( + $as_echo "292. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type {union foo} %defines +%code requires { union foo { float fval; int ival; }; } + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).ival = 10; + else + (*lvalp).fval = .2f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -{ 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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:615: cat stderr" -at_fn_check_prepare_trace "calc.at:615" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_213 -#AT_START_214 -at_fn_group_banner 214 'calc.at:616' \ - "Calculator %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11 +#AT_STOP_292 +#AT_START_293 +at_fn_group_banner 293 'types.at:253' \ + "lalr1.cc %union { float fval; int ival; };" " " 11 at_xfail=no ( - $as_echo "214. $at_setup_line: testing $at_desc ..." + $as_echo "293. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -76649,325 +78568,103 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc - -%code requires -{ - - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; -} - -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include -static void calcerror ( const char *msg); -int calclex (void); +static int yylex (yy::parser::semantic_type *lvalp); } +%skeleton "lalr1.cc" + %union { float fval; int ival; }; +%token '1'; + %token '2'; - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; -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 int -power (int base, int exponent) +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; + std::cerr << m << '\n'; } - - -#include -/* A C error reporting function. */ +#include static -void calcerror ( const char *msg) -{ - YY_LOCATION_PRINT (stderr, (calclloc)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include - -int calclex (void); -static int get_char (void); -static void unget_char ( int c); - - -static CALCLTYPE last_yylloc; - -static int -get_char (void) +int yylex (yy::parser::semantic_type *lvalp) { - int res = getc (input); - ; - - last_yylloc = (calclloc); - if (res == '\n') - { - (calclloc).last_line++; - (calclloc).last_column = 1; - } - else - (calclloc).last_column++; - + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).ival = 10; + else + (*lvalp).fval = 0.2f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (calclloc).first_column = (calclloc).last_column; - (calclloc).first_line = (calclloc).last_line; - - } - 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; -} -_ATEOF - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include // getenv. +#include // strcmp. int -main (int argc, const char **argv) +main (int argc, char const* 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; - } - - calcdebug = 1; - status = calcparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:616: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:616" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:616: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -76976,16 +78673,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:616: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:616" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -76994,7 +78691,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -77002,958 +78699,777 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:616: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:616" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:616" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:616: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:616: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_293 +#AT_START_294 +at_fn_group_banner 294 'types.at:253' \ + "lalr1.cc %union { float fval; int ival; }; %defines" "" 11 +at_xfail=no +( + $as_echo "294. $at_setup_line: testing $at_desc ..." + $at_traceon ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 -2^2^3 = 256 -(2^2)^3 = 64 -_ATEOF +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -{ 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" 5>&- -at_status=$? at_failed=false -$at_check_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; } +%debug -{ set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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; } +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} +%skeleton "lalr1.cc" + %union { float fval; int ival; }; %defines +%token '1'; + %token '2'; +%% +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).ival = 10; + else + (*lvalp).fval = 0.2f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -error -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { 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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_294 +#AT_START_295 +at_fn_group_banner 295 'types.at:253' \ + "lalr1.cc api.value.type=union" " " 11 +at_xfail=no +( + $as_echo "295. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type union +%token ONE 101; + %token TWO 102 THREE 103; + %printer { yyoutput << $$; } + %printer { yyoutput << $$; } + + +%% + +start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static int const input[] = { 101, 102, 103, EOF }; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == 101) + (*lvalp).ONE = 10; + else if (res == 102) + (*lvalp).TWO = .2f; + else if (res == 103) + (*lvalp).THREE = 3.3f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' - -+1 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:616" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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 +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "10 0.2 3.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_295 +#AT_START_296 +at_fn_group_banner 296 'types.at:253' \ + "lalr1.cc api.value.type=union %defines" " " 11 +at_xfail=no +( + $as_echo "296. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%debug +%code +{ +# include +# include -# 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 +static int yylex (yy::parser::semantic_type *lvalp); +} -{ 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" 5>&- -at_status=$? at_failed=false -$at_check_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; } +%skeleton "lalr1.cc" + %define api.value.type union %defines +%token ONE 101; + %token TWO 102 THREE 103; + %printer { yyoutput << $$; } + %printer { yyoutput << $$; } -{ set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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; } +%% +start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static int const input[] = { 101, 102, 103, EOF }; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == 101) + (*lvalp).ONE = 10; + else if (res == 102) + (*lvalp).TWO = .2f; + else if (res == 103) + (*lvalp).THREE = 3.3f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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' -(!) + (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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 3.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:616: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:616" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_214 -#AT_START_215 -at_fn_group_banner 215 'calc.at:618' \ - "Calculator %define api.pure full %verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 11 +#AT_STOP_296 +#AT_START_297 +at_fn_group_banner 297 'types.at:253' \ + "lalr1.cc api.value.type=variant" " " 11 at_xfail=no ( - $as_echo "215. $at_setup_line: testing $at_desc ..." + $as_echo "297. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -77962,325 +79478,103 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%define api.pure full %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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include -static void calcerror (YYLTYPE const * const llocp, const char *msg); -int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); +static int yylex (yy::parser::semantic_type *lvalp); } +%skeleton "lalr1.cc" + %define api.value.type variant +%token '1'; + %token '2'; - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' { std::cout << $1 << ", " << $2 << '\n'; }; -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 int -power (int base, int exponent) +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; + std::cerr << m << '\n'; } - - -#include -/* A C error reporting function. */ +#include static -void calcerror (YYLTYPE const * const llocp, const char *msg) -{ - YY_LOCATION_PRINT (stderr, (*llocp)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include - -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 yylex (yy::parser::semantic_type *lvalp) { - 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++; - + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).build(10); + else + (*lvalp).build("two");; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (*llocp).first_column = (*llocp).last_column; - (*llocp).first_line = (*llocp).last_line; - - } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); - - /* 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 - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include // getenv. +#include // strcmp. int -main (int argc, const char **argv) +main (int argc, char const* 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; - } - - calcdebug = 1; - status = calcparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:618" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -78289,16 +79583,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:618" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -78307,7 +79601,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -78315,968 +79609,980 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:618: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:618" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:618" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:618: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10, two +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:618: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_297 +#AT_START_298 +at_fn_group_banner 298 'types.at:253' \ + "lalr1.cc api.value.type=variant %defines" " " 11 +at_xfail=no +( + $as_echo "298. $at_setup_line: testing $at_desc ..." + $at_traceon ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 -2^2^3 = 256 -(2^2)^3 = 64 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "lalr1.cc" + %define api.value.type variant %defines +%token '1'; + %token '2'; + +%% + +start: '1' '2' { std::cout << $1 << ", " << $2 << '\n'; }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).build(10); + else + (*lvalp).build("two");; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } - - -# Some syntax errors. -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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1//2 -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { 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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "10, two +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '!' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_298 +#AT_START_299 +at_fn_group_banner 299 'types.at:253' \ + "glr.cc api.value.type={double}" " " 11 +at_xfail=no +( + $as_echo "299. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "glr.cc" + %define api.value.type {double} + + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp) = (res - '0') / 10.0; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -error -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } -{ 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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { 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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_299 +#AT_START_300 +at_fn_group_banner 300 'types.at:253' \ + "glr.cc api.value.type={double} %defines" " " 11 +at_xfail=no +( + $as_echo "300. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include -cat >input <<'_ATEOF' +static int yylex (yy::parser::semantic_type *lvalp); +} -+1 +%skeleton "glr.cc" + %define api.value.type {double} %defines + + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp) = (res - '0') / 10.0; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { 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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_300 +#AT_START_301 +at_fn_group_banner 301 'types.at:253' \ + "glr.cc api.value.type={variant}" " " 11 +at_xfail=no +( + $as_echo "301. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug +%code +{ +# include +# include -# The same, but this time exercising explicitly triggered syntax errors. -# POSIX says the lookahead causing the error should not be discarded. -cat >input <<'_ATEOF' -(!) + (1 2) = 1 +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "glr.cc" + %define api.value.type {variant} +%code requires { typedef double variant; } + +%% + +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp) = (res - '0') / 10.0; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:618: cat stderr" -at_fn_check_prepare_trace "calc.at:618" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_215 -#AT_START_216 -at_fn_group_banner 216 'calc.at:619' \ - "Calculator %define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 11 +#AT_STOP_301 +#AT_START_302 +at_fn_group_banner 302 'types.at:253' \ + "glr.cc api.value.type={variant} %defines" " " 11 at_xfail=no ( - $as_echo "216. $at_setup_line: testing $at_desc ..." + $as_echo "302. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -79285,325 +80591,99 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%define api.push-pull both %define api.pure full %verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc - -%code requires -{ - - /* Exercise pre-prologue dependency to %union. */ - typedef int semantic_value; -} - -/* Exercise %union. */ -%union -{ - semantic_value ival; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include -static void calcerror (CALCLTYPE const * const llocp, const char *msg); -int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); +static int yylex (yy::parser::semantic_type *lvalp); } +%skeleton "glr.cc" + %define api.value.type {variant} %defines +%code requires { typedef double variant; } - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; -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 int -power (int base, int exponent) +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; + std::cerr << m << '\n'; } - - -#include -/* A C error reporting function. */ +#include static -void calcerror (CALCLTYPE const * const llocp, const char *msg) -{ - YY_LOCATION_PRINT (stderr, (*llocp)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include - -int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); -static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp); -static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c); - - -static CALCLTYPE last_yylloc; - -static int -get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp) +int yylex (yy::parser::semantic_type *lvalp) { - 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++; - + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp) = (res - '0') / 10.0; return res; } - -static void -unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c) -{ - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; - - ungetc (c, input); -} - -static int -read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *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 (CALCSTYPE *lvalp, CALCLTYPE *llocp) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (*llocp).first_column = (*llocp).last_column; - (*llocp).first_line = (*llocp).last_line; - - } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); - - /* 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 - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include // getenv. +#include // strcmp. int -main (int argc, const char **argv) +main (int argc, char const* 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; - } - - calcdebug = 1; - status = calcparse (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:619" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:619: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:619" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:619: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:619" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -79612,16 +80692,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:619: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:619" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -79630,7 +80710,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -79638,968 +80718,779 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:619: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:619: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:619" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:619: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:619" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:619: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:619" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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:619" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:619: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:619" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_302 +#AT_START_303 +at_fn_group_banner 303 'types.at:253' \ + "glr.cc api.value.type={struct foo}" " " 11 +at_xfail=no +( + $as_echo "303. $at_setup_line: testing $at_desc ..." + $at_traceon ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 -2^2^3 = 256 -(2^2)^3 = 64 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "glr.cc" + %define api.value.type {struct foo} +%code requires { struct foo { float fval; int ival; }; } + +%% + +start: '1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).ival = (res - '0') * 10; + (*lvalp).fval = (res - '0') / 10.f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" -$at_failed && at_fn_log_failure -$at_traceon; } - - -cat >input <<'_ATEOF' -1//2 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" +echo >>"$at_stdout"; $as_echo "30 0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_303 +#AT_START_304 +at_fn_group_banner 304 'types.at:253' \ + "glr.cc api.value.type={struct foo} %defines" " " 11 +at_xfail=no +( + $as_echo "304. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" -$at_failed && at_fn_log_failure -$at_traceon; } +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -cat >input <<'_ATEOF' -error -_ATEOF +%debug -{ set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" -$at_failed && at_fn_log_failure -$at_traceon; } +%code +{ +# include +# include -{ set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:619" -$at_failed && at_fn_log_failure -$at_traceon; } +static int yylex (yy::parser::semantic_type *lvalp); +} +%skeleton "glr.cc" + %define api.value.type {struct foo} %defines +%code requires { struct foo { float fval; int ival; }; } +%% -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +start: '1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).ival = (res - '0') * 10; + (*lvalp).fval = (res - '0') / 10.f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' - -+1 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:619: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc /dev/null +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:619" +echo >>"$at_stdout"; $as_echo "30 0.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" -$at_failed && at_fn_log_failure -$at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_304 +#AT_START_305 +at_fn_group_banner 305 'types.at:253' \ + "glr.cc api.value.type={struct bar}" " " 11 +at_xfail=no +( + $as_echo "305. $at_setup_line: testing $at_desc ..." + $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 +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -{ set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:619" -$at_failed && at_fn_log_failure -$at_traceon; } +%debug -{ set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:619" -$at_failed && at_fn_log_failure -$at_traceon; } +%code +{ +# include +# include +static int yylex (yy::parser::semantic_type *lvalp); +} +%skeleton "glr.cc" + %define api.value.type {struct bar} +%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { yyoutput << $$; } ival> -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" -$at_failed && at_fn_log_failure -$at_traceon; } +start: '1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }; +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).up = (struct u *) malloc (sizeof *(*lvalp).up); + assert ((*lvalp).up); + (*lvalp).up->ival = res - '0';; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} +_ATEOF -# The same, but this time exercising explicitly triggered syntax errors. -# POSIX says the lookahead causing the error should not be discarded. -cat >input <<'_ATEOF' -(!) + (1 2) = 1 -_ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (1 2) = 1 -_ATEOF - -{ set +x -$as_echo "$at_srcdir/calc.at:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:619" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:619: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:619" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:619: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:619" +echo >>"$at_stdout"; $as_echo "1 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:619: cat stderr" -at_fn_check_prepare_trace "calc.at:619" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:619" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_216 -#AT_START_217 -at_fn_group_banner 217 'calc.at:621' \ - "Calculator %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 11 +#AT_STOP_305 +#AT_START_306 +at_fn_group_banner 306 'types.at:253' \ + "glr.cc api.value.type={struct bar} %defines" " " 11 at_xfail=no ( - $as_echo "217. $at_setup_line: testing $at_desc ..." + $as_echo "306. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -80608,327 +81499,119 @@ cat >calc.y <<'_ATEOF' #undef realloc } -/* Infix notation calculator--calc */ -%define api.pure %error-verbose %debug %locations %defines %define api.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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include -static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); -int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); +static int yylex (yy::parser::semantic_type *lvalp); } +%skeleton "glr.cc" + %define api.value.type {struct bar} %defines +%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { yyoutput << $$; } ival> -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type 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; } -; +start: '1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }; -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 int -power (int base, int exponent) +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; + std::cerr << m << '\n'; } - - -#include -/* A C error reporting function. */ +#include static -void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) -{ - YYUSE(result); - YYUSE(count); - YY_LOCATION_PRINT (stderr, (*llocp)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); -} -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include - -int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); -static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp); -static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c); - - -static CALCLTYPE last_yylloc; - -static int -get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp) +int yylex (yy::parser::semantic_type *lvalp) { - 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++; - + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + (*lvalp).up = (struct u *) malloc (sizeof *(*lvalp).up); + assert ((*lvalp).up); + (*lvalp).up->ival = res - '0';; return res; } - -static void -unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c) -{ - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; - - ungetc (c, input); -} - -static int -read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *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 (CALCSTYPE *lvalp, CALCLTYPE *llocp) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - (*llocp).first_column = (*llocp).last_column; - (*llocp).first_line = (*llocp).last_line; - - } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); - - /* 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 - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include // getenv. +#include // strcmp. int -main (int argc, const char **argv) +main (int argc, char const* 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; - } - - calcdebug = 1; - status = calcparse (&result, &count); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:621: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:621" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:621: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -80937,16 +81620,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:621: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:621" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -80955,7 +81638,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -80963,958 +81646,765 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:621: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:621" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:621" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:621: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "1 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:621: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_306 +#AT_START_307 +at_fn_group_banner 307 'types.at:253' \ + "glr.cc api.value.type={union foo}" " " 11 +at_xfail=no +( + $as_echo "307. $at_setup_line: testing $at_desc ..." + $at_traceon ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 -2^2^3 = 256 -(2^2)^3 = 64 -_ATEOF +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -{ 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" 5>&- -at_status=$? at_failed=false -$at_check_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; } +%debug -{ set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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; } +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} +%skeleton "glr.cc" + %define api.value.type {union foo} +%code requires { union foo { float fval; int ival; }; } +%% +start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).ival = 10; + else + (*lvalp).fval = .2f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -error -_ATEOF +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } { 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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_307 +#AT_START_308 +at_fn_group_banner 308 'types.at:253' \ + "glr.cc api.value.type={union foo} %defines" " " 11 +at_xfail=no +( + $as_echo "308. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%debug -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF +%code +{ +# include +# include -{ 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" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo 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; } +static int yylex (yy::parser::semantic_type *lvalp); +} -{ set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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; } +%skeleton "glr.cc" + %define api.value.type {union foo} %defines +%code requires { union foo { float fval; int ival; }; } +%% +start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 '=' +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).ival = 10; + else + (*lvalp).fval = .2f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo 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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -# Exercise error messages with EOF: work on an empty file. + rm -rf xml-tests expout + at_restore_special_files +fi { 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 +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +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/calc.at:621" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_308 +#AT_START_309 +at_fn_group_banner 309 'types.at:253' \ + "glr.cc %union { float fval; int ival; };" " " 11 +at_xfail=no +( + $as_echo "309. $at_setup_line: testing $at_desc ..." + $at_traceon -# 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" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_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 >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} +%debug +%code +{ +# include +# include -# The same, but this time exercising explicitly triggered syntax errors. -# POSIX says the lookahead causing the error should not be discarded. -cat >input <<'_ATEOF' -(!) + (1 2) = 1 +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "glr.cc" + %union { float fval; int ival; }; +%token '1'; + %token '2'; + +%% + +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).ival = 10; + else + (*lvalp).fval = 0.2f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _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 + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - -cat >input <<'_ATEOF' -(- *) + (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 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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 +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:621" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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 +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_217 -#AT_START_218 -at_fn_group_banner 218 'calc.at:638' \ - "Calculator %glr-parser " " " 12 +#AT_STOP_309 +#AT_START_310 +at_fn_group_banner 310 'types.at:253' \ + "glr.cc %union { float fval; int ival; }; %defines" "" 11 at_xfail=no ( - $as_echo "218. $at_setup_line: testing $at_desc ..." + $as_echo "310. $at_setup_line: testing $at_desc ..." $at_traceon - - - - - - - -cat >calc.y <<'_ATEOF' +cat >test.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -81923,284 +82413,103 @@ cat >calc.y <<'_ATEOF' #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; -}; -%printer { fprintf (yyoutput, "%d", $$); } ; - -%code provides -{ - #include - /* The input. */ - extern FILE *input; - extern semantic_value global_result; - extern int global_count; -} +%debug %code { -#include -#include -#define USE(Var) - -FILE *input; -static int power (int base, int exponent); +# include +# include -static void yyerror ( const char *msg); -int yylex (void); +static int yylex (yy::parser::semantic_type *lvalp); } +%skeleton "glr.cc" + %union { float fval; int ival; }; %defines +%token '1'; + %token '2'; - -/* Bison Declarations */ -%token CALC_EOF 0 "end of input" -%token NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ %% -input: - line -| input line { } -; -line: - '\n' -| exp '\n' { USE ($1); } -; +start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; -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 int -power (int base, int exponent) +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - int res = 1; - assert (0 <= exponent); - for (/* Niente */; exponent; --exponent) - res *= base; - return res; + std::cerr << m << '\n'; } - - -#include -/* A C error reporting function. */ +#include static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include - -int yylex (void); -static int get_char (void); -static void unget_char ( int c); - - -static int -get_char (void) +int yylex (yy::parser::semantic_type *lvalp) { - int res = getc (input); - ; - + static char const input[] = "12"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == '1') + (*lvalp).ival = 10; + else + (*lvalp).fval = 0.2f; 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) -{ - int c; - /* Skip current token, then white spaces. */ - do - { - - } - 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; -} - -#include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - - - -semantic_value global_result = 0; -int global_count = 0; - -/* A C main function. */ +#include // getenv. +#include // strcmp. int -main (int argc, const char **argv) +main (int argc, char const* 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 (); - if (fclose (input)) - perror ("fclose"); - assert (global_result == result); - assert (global_count == count); - return status; + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF - - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:638: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:638" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:638" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:638: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:638" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -82209,16 +82518,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:638: \$XSLTPROC \\ +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:638" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -82227,7 +82536,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } @@ -82235,151 +82544,1100 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:638: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:638" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:638: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:638" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:638" -$at_failed && at_fn_log_failure -$at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: \$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:638" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:638: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:638" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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:638" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $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:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" -( $at_check_trace; $PREPARSER ./calc input +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +echo >>"$at_stdout"; $as_echo "10 0.2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_310 +#AT_START_311 +at_fn_group_banner 311 'types.at:253' \ + "glr.cc api.value.type=union" " " 11 +at_xfail=no +( + $as_echo "311. $at_setup_line: testing $at_desc ..." + $at_traceon -# Some syntax errors. -cat >input <<'_ATEOF' -1 2 -_ATEOF -{ set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" -( $at_check_trace; $PREPARSER ./calc input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "glr.cc" + %define api.value.type union +%token ONE 101; + %token TWO 102 THREE 103; + %printer { yyoutput << $$; } + %printer { yyoutput << $$; } + + +%% + +start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static int const input[] = { 101, 102, 103, EOF }; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == 101) + (*lvalp).ONE = 10; + else if (res == 102) + (*lvalp).TWO = .2f; + else if (res == 103) + (*lvalp).THREE = 3.3f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10 0.2 3.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_311 +#AT_START_312 +at_fn_group_banner 312 'types.at:253' \ + "glr.cc api.value.type=union %defines" " " 11 +at_xfail=no +( + $as_echo "312. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >test.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%debug + +%code +{ +# include +# include + +static int yylex (yy::parser::semantic_type *lvalp); +} + +%skeleton "glr.cc" + %define api.value.type union %defines +%token ONE 101; + %token TWO 102 THREE 103; + %printer { yyoutput << $$; } + %printer { yyoutput << $$; } + + +%% + +start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; + +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static int const input[] = { 101, 102, 103, EOF }; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + if (res == 101) + (*lvalp).ONE = 10; + else if (res == 102) + (*lvalp).TWO = .2f; + else if (res == 103) + (*lvalp).THREE = 3.3f; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o test.cc test.y" +at_fn_check_prepare_notrace 'an embedded newline' "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/types.at:253: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:253" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/types.at:253: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:253" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/types.at:253: bison -fno-caret -o test.cc test.y" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; bison -fno-caret -o test.cc test.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:253" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:253" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/types.at:253: \$PREPARSER ./test" +at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:253" +( $at_check_trace; $PREPARSER ./test +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "10 0.2 3.3 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/types.at:253: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "types.at:253" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/types.at:253" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_312 +#AT_START_313 +at_fn_group_banner 313 'types.at:275' \ + "lalr1.cc: Named %union" " " 11 +at_xfail=no +( + $as_echo "313. $at_setup_line: testing $at_desc ..." + $at_traceon + +cat >input.y <<'_ATEOF' +%skeleton "lalr1.cc" +%union foo { float fval; int ival; }; +%% +exp: %empty; +_ATEOF + + +{ set +x +$as_echo "$at_srcdir/types.at:275: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "types.at:275" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:2.8-10: error: named %union is invalid in C++ +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/types.at:275" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_313 +#AT_START_314 +at_fn_group_banner 314 'types.at:275' \ + "glr.cc: Named %union" " " 11 +at_xfail=no +( + $as_echo "314. $at_setup_line: testing $at_desc ..." + $at_traceon + +cat >input.y <<'_ATEOF' +%skeleton "glr.cc" +%union foo { float fval; int ival; }; +%% +exp: %empty; +_ATEOF + + +{ set +x +$as_echo "$at_srcdir/types.at:275: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "types.at:275" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:2.8-10: error: named %union is invalid in C++ +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/types.at:275" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_314 +#AT_START_315 +at_fn_group_banner 315 'calc.at:596' \ + "Calculator " " " 12 +at_xfail=no +( + $as_echo "315. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* 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; +}; +%printer { fprintf (yyoutput, "%d", $$); } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + +#include + +static void yyerror (const char *msg); +int yylex (void); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include + +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) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + 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; +} + +#include +#include + + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:596" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:596" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:596: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:596" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:596: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:596" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:596: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:596" +( $at_check_trace; bison -fno-caret -o calc.c calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:596" +$at_failed && at_fn_log_failure +$at_traceon; } + + + { set +x +$as_echo "$at_srcdir/calc.at:596: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:596" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:596" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:596: \$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:596" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:596" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:596: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:596" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:596" +$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:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:596" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:596" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82412,20 +83670,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82435,28 +83693,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82489,20 +83747,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82512,28 +83770,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82566,20 +83824,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82589,28 +83847,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82643,20 +83901,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82667,28 +83925,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82721,48 +83979,48 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $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:638: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82795,20 +84053,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82823,7 +84081,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -82835,28 +84093,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82893,20 +84151,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82919,28 +84177,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82974,20 +84232,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -82997,28 +84255,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -83053,20 +84311,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -83079,28 +84337,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:638: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -83135,20 +84393,20 @@ _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. +# 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:638: cat stderr" -at_fn_check_prepare_trace "calc.at:638" +$as_echo "$at_srcdir/calc.at:596: cat stderr" +at_fn_check_prepare_trace "calc.at:596" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:638" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -83160,13 +84418,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_218 -#AT_START_219 -at_fn_group_banner 219 'calc.at:640' \ - "Calculator %glr-parser %defines" " " 12 +#AT_STOP_315 +#AT_START_316 +at_fn_group_banner 316 'calc.at:598' \ + "Calculator %defines" " " 12 at_xfail=no ( - $as_echo "219. $at_setup_line: testing $at_desc ..." + $as_echo "316. $at_setup_line: testing $at_desc ..." $at_traceon @@ -83188,7 +84446,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %defines +%defines %code requires { @@ -83222,7 +84480,9 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void yyerror ( const char *msg); +#include + +static void yyerror (const char *msg); int yylex (void); } @@ -83233,11 +84493,11 @@ int yylex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -83283,10 +84543,11 @@ power (int base, int exponent) } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -83397,12 +84658,7 @@ cat >calc-main.c <<'_ATEOF' #include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -83417,10 +84673,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -83437,8 +84695,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -83455,39 +84713,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:640" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:598: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:598" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:640" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:598: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:598" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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' "calc.at:640" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 @@ -83496,16 +84754,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:640" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 | sort @@ -83514,7 +84772,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83522,101 +84780,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:640: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:640" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:598: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:598" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:640: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:640" + { set +x +$as_echo "$at_srcdir/calc.at:598: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:598" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:598" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:640" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:640: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:598: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:598" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83639,28 +84871,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83673,28 +84905,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83727,20 +84959,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83750,28 +84982,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83804,20 +85036,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83827,28 +85059,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83881,20 +85113,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83904,28 +85136,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83958,20 +85190,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -83982,28 +85214,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84036,48 +85268,48 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $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:640: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84110,20 +85342,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84138,7 +85370,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -84150,28 +85382,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84208,20 +85440,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84234,28 +85466,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84289,20 +85521,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84312,28 +85544,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84368,20 +85600,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84394,28 +85626,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84450,20 +85682,20 @@ _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. +# 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:640: cat stderr" -at_fn_check_prepare_trace "calc.at:640" +$as_echo "$at_srcdir/calc.at:598: cat stderr" +at_fn_check_prepare_trace "calc.at:598" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598" $at_failed && at_fn_log_failure $at_traceon; } @@ -84475,13 +85707,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_219 -#AT_START_220 -at_fn_group_banner 220 'calc.at:641' \ - "Calculator %glr-parser %locations" " " 12 +#AT_STOP_316 +#AT_START_317 +at_fn_group_banner 317 'calc.at:599' \ + "Calculator %locations" " " 12 at_xfail=no ( - $as_echo "220. $at_setup_line: testing $at_desc ..." + $as_echo "317. $at_setup_line: testing $at_desc ..." $at_traceon @@ -84503,7 +85735,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %locations +%locations %code requires { @@ -84537,7 +85769,16 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void yyerror ( const char *msg); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); int yylex (void); } @@ -84548,11 +85789,11 @@ int yylex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -84598,12 +85839,42 @@ power (int base, int exponent) } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (yylloc)); + LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -84639,7 +85910,7 @@ unget_char ( int c) { ; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (yylloc) = last_yylloc; ungetc (c, input); @@ -84706,12 +85977,7 @@ int yylex (void) } #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -84726,10 +85992,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -84746,8 +86014,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -84765,39 +86033,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:641" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:599" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:641" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:599" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:641" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:599" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -84806,16 +86074,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:641" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:599" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -84824,7 +86092,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -84832,64 +86100,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:641: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:641" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:599: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:599" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:641: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:641" + { set +x +$as_echo "$at_srcdir/calc.at:599: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:599" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: \$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:641" +$as_echo "$at_srcdir/calc.at:599: \$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:599" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:641: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:599: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:641" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -84897,12 +86168,11 @@ at_status=$? at_failed=false $at_check_filter at_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } - # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 @@ -84921,28 +86191,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -84955,28 +86225,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85008,20 +86278,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85031,28 +86301,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85084,20 +86354,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85107,28 +86377,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85160,20 +86430,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85183,28 +86453,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85236,20 +86506,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85260,28 +86530,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85313,48 +86583,48 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $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:641: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85386,20 +86656,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85414,7 +86684,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -85426,28 +86696,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85483,20 +86753,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85509,28 +86779,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85563,20 +86833,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85586,28 +86856,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85641,20 +86911,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85667,28 +86937,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85722,20 +86992,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:641: cat stderr" -at_fn_check_prepare_trace "calc.at:641" +$as_echo "$at_srcdir/calc.at:599: cat stderr" +at_fn_check_prepare_trace "calc.at:599" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599" $at_failed && at_fn_log_failure $at_traceon; } @@ -85747,13 +87017,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_220 -#AT_START_221 -at_fn_group_banner 221 'calc.at:642' \ - "Calculator %glr-parser %name-prefix \"calc\"" " " 12 +#AT_STOP_317 +#AT_START_318 +at_fn_group_banner 318 'calc.at:601' \ + "Calculator %name-prefix \"calc\"" " " 12 at_xfail=no ( - $as_echo "221. $at_setup_line: testing $at_desc ..." + $as_echo "318. $at_setup_line: testing $at_desc ..." $at_traceon @@ -85775,7 +87045,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %name-prefix "calc" +%name-prefix "calc" %code requires { @@ -85809,7 +87079,9 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void calcerror ( const char *msg); +#include + +static void calcerror (const char *msg); int calclex (void); } @@ -85820,11 +87092,11 @@ int calclex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -85870,10 +87142,11 @@ power (int base, int exponent) } -#include + + /* A C error reporting function. */ static -void calcerror ( const char *msg) +void calcerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -85960,12 +87233,7 @@ int calclex (void) } #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -85980,10 +87248,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -86000,8 +87270,8 @@ main (int argc, const char **argv) status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -86019,39 +87289,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:642" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:601: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:601" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:642" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:601: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:601" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:601: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:642" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:601" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -86060,16 +87330,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:601: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:642" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:601" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -86078,7 +87348,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86086,64 +87356,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:642: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:642" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:601: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:601" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:642: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:642" + { set +x +$as_echo "$at_srcdir/calc.at:601: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:601" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: \$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:642" +$as_echo "$at_srcdir/calc.at:601: \$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:601" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:642: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:601: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:642" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:601" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -86151,12 +87424,11 @@ at_status=$? at_failed=false $at_check_filter at_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } - # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 @@ -86175,28 +87447,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86209,28 +87481,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86263,20 +87535,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86286,28 +87558,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86340,20 +87612,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86363,28 +87635,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86417,20 +87689,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86440,28 +87712,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86494,20 +87766,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86518,28 +87790,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86572,48 +87844,48 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $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:642: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86646,20 +87918,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86674,7 +87946,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -86686,28 +87958,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86744,20 +88016,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86770,28 +88042,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86825,20 +88097,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86848,28 +88120,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86904,20 +88176,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86930,28 +88202,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -86986,20 +88258,20 @@ _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. +# 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:642: cat stderr" -at_fn_check_prepare_trace "calc.at:642" +$as_echo "$at_srcdir/calc.at:601: cat stderr" +at_fn_check_prepare_trace "calc.at:601" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601" $at_failed && at_fn_log_failure $at_traceon; } @@ -87011,13 +88283,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_221 -#AT_START_222 -at_fn_group_banner 222 'calc.at:643' \ - "Calculator %glr-parser %define api.prefix \"calc\"" "" 12 +#AT_STOP_318 +#AT_START_319 +at_fn_group_banner 319 'calc.at:602' \ + "Calculator %verbose" " " 12 at_xfail=no ( - $as_echo "222. $at_setup_line: testing $at_desc ..." + $as_echo "319. $at_setup_line: testing $at_desc ..." $at_traceon @@ -87039,7 +88311,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %define api.prefix "calc" +%verbose %code requires { @@ -87073,8 +88345,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void calcerror ( const char *msg); -int calclex (void); +#include + +static void yyerror (const char *msg); +int yylex (void); } @@ -87084,11 +88358,11 @@ int calclex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -87134,16 +88408,17 @@ power (int base, int exponent) } -#include + + /* A C error reporting function. */ static -void calcerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include -int calclex (void); +int yylex (void); static int get_char (void); static void unget_char ( int c); @@ -87197,7 +88472,7 @@ read_signed_integer (void) | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (void) +int yylex (void) { int c; /* Skip current token, then white spaces. */ @@ -87211,7 +88486,7 @@ int calclex (void) if (c == '.' || isdigit (c)) { unget_char ( c); - (calclval).ival = read_signed_integer (); + (yylval).ival = read_signed_integer (); return NUM; } @@ -87224,12 +88499,7 @@ int calclex (void) } #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -87244,10 +88514,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -87261,11 +88533,11 @@ main (int argc, const char **argv) } - status = calcparse (); + status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -87283,39 +88555,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:643" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:602" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:643" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:602" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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' "calc.at:643" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 @@ -87324,16 +88596,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:643" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 | sort @@ -87342,7 +88614,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87350,64 +88622,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:643: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:643" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:602: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:602" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:643: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:643" + { set +x +$as_echo "$at_srcdir/calc.at:602: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:602" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: \$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:643" +$as_echo "$at_srcdir/calc.at:602: \$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:602" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:643: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:602: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:643" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:602" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -87415,12 +88690,11 @@ at_status=$? at_failed=false $at_check_filter at_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } - # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 @@ -87439,28 +88713,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87473,28 +88747,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87527,20 +88801,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87550,28 +88824,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87604,20 +88878,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87627,28 +88901,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87681,20 +88955,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87704,28 +88978,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87758,20 +89032,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87782,28 +89056,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87836,48 +89110,48 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $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:643: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87910,20 +89184,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -87938,7 +89212,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -87950,28 +89224,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -88008,20 +89282,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -88034,28 +89308,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -88089,20 +89363,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -88112,28 +89386,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -88168,20 +89442,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -88194,28 +89468,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -88250,20 +89524,20 @@ _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. +# 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:643: cat stderr" -at_fn_check_prepare_trace "calc.at:643" +$as_echo "$at_srcdir/calc.at:602: cat stderr" +at_fn_check_prepare_trace "calc.at:602" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602" $at_failed && at_fn_log_failure $at_traceon; } @@ -88275,13 +89549,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_222 -#AT_START_223 -at_fn_group_banner 223 'calc.at:644' \ - "Calculator %glr-parser %verbose" " " 12 +#AT_STOP_319 +#AT_START_320 +at_fn_group_banner 320 'calc.at:603' \ + "Calculator %yacc" " " 12 at_xfail=no ( - $as_echo "223. $at_setup_line: testing $at_desc ..." + $as_echo "320. $at_setup_line: testing $at_desc ..." $at_traceon @@ -88303,7 +89577,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %verbose +%yacc %code requires { @@ -88337,7 +89611,9 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void yyerror ( const char *msg); +#include + +static void yyerror (const char *msg); int yylex (void); } @@ -88348,11 +89624,11 @@ int yylex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -88398,10 +89674,11 @@ power (int base, int exponent) } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -88488,12 +89765,7 @@ int yylex (void) } #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -88508,10 +89780,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -88528,8 +89802,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -88547,39 +89821,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:644" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:603" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:644" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:603" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:603" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -88588,16 +89862,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:644" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:603" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -88606,7 +89880,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -88614,64 +89888,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:644: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:644" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:603: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:603" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:644: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:644" + { set +x +$as_echo "$at_srcdir/calc.at:603: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:603" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: \$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:644" +$as_echo "$at_srcdir/calc.at:603: \$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:603" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:644: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:603: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:644" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:603" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -88679,12 +89956,11 @@ at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } - # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 @@ -88703,28 +89979,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -88737,28 +90013,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -88791,20 +90067,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -88814,28 +90090,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -88868,20 +90144,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -88891,28 +90167,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -88945,20 +90221,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -88968,28 +90244,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89022,20 +90298,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89046,28 +90322,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89100,48 +90376,48 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89174,20 +90450,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89202,7 +90478,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -89214,28 +90490,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89272,20 +90548,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89298,28 +90574,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89353,20 +90629,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89376,28 +90652,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89432,20 +90708,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89458,28 +90734,28 @@ 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" +$as_echo "$at_srcdir/calc.at:603: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:644" +$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89514,20 +90790,20 @@ _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. +# 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" +$as_echo "$at_srcdir/calc.at:603: cat stderr" +at_fn_check_prepare_trace "calc.at:603" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:603" $at_failed && at_fn_log_failure $at_traceon; } @@ -89539,13 +90815,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_223 -#AT_START_224 -at_fn_group_banner 224 'calc.at:645' \ - "Calculator %glr-parser %yacc" " " 12 +#AT_STOP_320 +#AT_START_321 +at_fn_group_banner 321 'calc.at:604' \ + "Calculator parse.error=verbose" " " 12 at_xfail=no ( - $as_echo "224. $at_setup_line: testing $at_desc ..." + $as_echo "321. $at_setup_line: testing $at_desc ..." $at_traceon @@ -89567,7 +90843,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %yacc +%define parse.error verbose %code requires { @@ -89601,7 +90877,9 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void yyerror ( const char *msg); +#include + +static void yyerror (const char *msg); int yylex (void); } @@ -89612,11 +90890,11 @@ int yylex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -89662,10 +90940,11 @@ power (int base, int exponent) } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -89752,12 +91031,7 @@ int yylex (void) } #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -89772,10 +91046,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -89792,8 +91068,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -89811,39 +91087,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:645" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:604" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:645" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:604" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:604" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -89852,16 +91128,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:645" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:604" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -89870,7 +91146,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -89878,64 +91154,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:645: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:645" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:604: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:604" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:645: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:645" + { set +x +$as_echo "$at_srcdir/calc.at:604: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:604" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: \$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:645" +$as_echo "$at_srcdir/calc.at:604: \$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:604" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:645: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:604: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:645" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:604" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -89943,12 +91222,11 @@ at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } - # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 @@ -89967,28 +91245,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90001,28 +91279,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90055,20 +91333,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90078,28 +91355,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90132,20 +91409,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90155,28 +91431,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90209,20 +91485,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90232,28 +91507,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90286,20 +91561,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90310,28 +91584,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90364,48 +91638,47 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90438,20 +91711,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90466,7 +91738,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -90478,28 +91750,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90536,20 +91808,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90562,28 +91833,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90617,20 +91888,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90640,28 +91910,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90696,20 +91966,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90722,28 +91991,28 @@ 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" +$as_echo "$at_srcdir/calc.at:604: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:645" +$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90778,20 +92047,19 @@ _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 +# 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" +$as_echo "$at_srcdir/calc.at:604: cat stderr" +at_fn_check_prepare_trace "calc.at:604" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:604" $at_failed && at_fn_log_failure $at_traceon; } @@ -90803,13 +92071,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_224 -#AT_START_225 -at_fn_group_banner 225 'calc.at:646' \ - "Calculator %glr-parser %error-verbose" " " 12 +#AT_STOP_321 +#AT_START_322 +at_fn_group_banner 322 'calc.at:606' \ + "Calculator api.pure=full %locations" " " 12 at_xfail=no ( - $as_echo "225. $at_setup_line: testing $at_desc ..." + $as_echo "322. $at_setup_line: testing $at_desc ..." $at_traceon @@ -90831,7 +92099,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %error-verbose +%define api.pure full %locations %code requires { @@ -90865,8 +92133,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void yyerror ( const char *msg); -int yylex (void); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (YYLTYPE const * const llocp, const char *msg); +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } @@ -90876,11 +92153,11 @@ int yylex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -90926,58 +92203,104 @@ power (int base, int exponent) } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include -int yylex (void); -static int get_char (void); -static void unget_char ( int c); +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 (void) +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 ( int c) +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 (void) +read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { - int c = get_char (); + int c = get_char (lvalp, llocp); int sign = 1; int n = 0; - ; + (void) lvalp;(void) llocp; if (c == '-') { - c = get_char (); + c = get_char (lvalp, llocp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (); + c = get_char (lvalp, llocp); } - unget_char ( c); + unget_char (lvalp, llocp, c); return sign * n; } @@ -90989,21 +92312,23 @@ read_signed_integer (void) | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (void) +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { + (*llocp).first_column = (*llocp).last_column; + (*llocp).first_line = (*llocp).last_line; } - while ((c = get_char ()) == ' ' || c == '\t'); + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char ( c); - (yylval).ival = read_signed_integer (); + unget_char (lvalp, llocp, c); + (*lvalp).ival = read_signed_integer (lvalp, llocp); return NUM; } @@ -91016,12 +92341,7 @@ int yylex (void) } #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -91036,10 +92356,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -91056,8 +92378,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -91075,39 +92397,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:646: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:646" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:606: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:646" +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:646: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:646" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:606: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:606" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:646" +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:646: \$XSLTPROC \\ +$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:646" +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 @@ -91116,16 +92438,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:646: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:646" +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 | sort @@ -91134,7 +92456,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91142,64 +92464,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:646: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:646" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:606: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:606" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:646" +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:646: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:646" + { set +x +$as_echo "$at_srcdir/calc.at:606: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:606" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:646" +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:646: \$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:646" +$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" 5>&- at_status=$? at_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:646" +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:646: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:606: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:646" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:606" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -91207,12 +92532,11 @@ at_status=$? at_failed=false $at_check_filter at_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:646" +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 @@ -91231,28 +92555,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_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:646" +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:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91265,28 +92589,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91317,21 +92641,21 @@ cat >expout <<'_ATEOF' _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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91341,28 +92665,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91393,21 +92717,21 @@ cat >expout <<'_ATEOF' _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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91417,28 +92741,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91469,21 +92793,21 @@ cat >expout <<'_ATEOF' _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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91493,28 +92817,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91545,21 +92869,21 @@ cat >expout <<'_ATEOF' _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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91570,28 +92894,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91622,49 +92946,49 @@ cat >expout <<'_ATEOF' _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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +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:646: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91695,21 +93019,21 @@ cat >expout <<'_ATEOF' _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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91724,7 +93048,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -91736,28 +93060,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_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:646" +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:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91792,21 +93116,21 @@ 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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91819,28 +93143,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_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:646" +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:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91872,21 +93196,21 @@ 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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91896,28 +93220,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_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:646" +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:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91950,21 +93274,21 @@ 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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -91977,28 +93301,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:646: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_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:646" +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:646: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:646" +$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:606" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -92031,21 +93355,21 @@ cat >expout <<'_ATEOF' _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. +# 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:646: cat stderr" -at_fn_check_prepare_trace "calc.at:646" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:646" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606" $at_failed && at_fn_log_failure $at_traceon; } @@ -92057,13 +93381,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_225 -#AT_START_226 -at_fn_group_banner 226 'calc.at:648' \ - "Calculator %glr-parser %define api.pure %locations" "" 12 +#AT_STOP_322 +#AT_START_323 +at_fn_group_banner 323 'calc.at:607' \ + "Calculator api.push-pull=both api.pure=full %locations" "" 12 at_xfail=no ( - $as_echo "226. $at_setup_line: testing $at_desc ..." + $as_echo "323. $at_setup_line: testing $at_desc ..." $at_traceon @@ -92085,7 +93409,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %define api.pure %locations +%define api.push-pull both %define api.pure full %locations %code requires { @@ -92119,7 +93443,16 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void yyerror (YYLTYPE const * const llocp, const char *msg); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (YYLTYPE const * const llocp, const char *msg); int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } @@ -92130,11 +93463,11 @@ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -92180,12 +93513,42 @@ power (int base, int exponent) } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror (YYLTYPE const * const llocp, const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { - YY_LOCATION_PRINT (stderr, (*llocp)); + LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -92221,7 +93584,7 @@ unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (*llocp) = last_yylloc; ungetc (c, input); @@ -92288,12 +93651,7 @@ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) } #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -92308,10 +93666,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -92328,8 +93688,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -92347,39 +93707,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:648" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:607" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:648" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:607" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:648" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:607" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -92388,16 +93748,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:648" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:607" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -92406,7 +93766,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92414,64 +93774,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:648: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:648" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:607: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:607" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:648: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:648" + { set +x +$as_echo "$at_srcdir/calc.at:607: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:607" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: \$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:648" +$as_echo "$at_srcdir/calc.at:607: \$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:607" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:648: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:607: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:648" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:607" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -92479,12 +93842,11 @@ at_status=$? at_failed=false $at_check_filter at_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } - # Test the priorities. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 @@ -92503,28 +93865,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92537,28 +93899,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92590,20 +93952,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92613,28 +93975,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92666,20 +94028,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92689,28 +94051,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92742,20 +94104,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92765,28 +94127,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92818,20 +94180,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92842,28 +94204,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92895,48 +94257,48 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $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:648: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92968,20 +94330,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -92996,7 +94358,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -93008,28 +94370,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -93065,20 +94427,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -93091,28 +94453,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -93145,20 +94507,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -93168,28 +94530,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -93223,20 +94585,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -93249,28 +94611,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -93304,20 +94666,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:648: cat stderr" -at_fn_check_prepare_trace "calc.at:648" +$as_echo "$at_srcdir/calc.at:607: cat stderr" +at_fn_check_prepare_trace "calc.at:607" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607" $at_failed && at_fn_log_failure $at_traceon; } @@ -93329,13 +94691,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_226 -#AT_START_227 -at_fn_group_banner 227 'calc.at:649' \ - "Calculator %glr-parser %error-verbose %locations" "" 12 +#AT_STOP_323 +#AT_START_324 +at_fn_group_banner 324 'calc.at:608' \ + "Calculator parse.error=verbose %locations" " " 12 at_xfail=no ( - $as_echo "227. $at_setup_line: testing $at_desc ..." + $as_echo "324. $at_setup_line: testing $at_desc ..." $at_traceon @@ -93357,7 +94719,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %error-verbose %locations +%define parse.error verbose %locations %code requires { @@ -93391,7 +94753,16 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void yyerror ( const char *msg); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); int yylex (void); } @@ -93402,11 +94773,11 @@ int yylex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -93452,12 +94823,42 @@ power (int base, int exponent) } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (yylloc)); + LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -93493,7 +94894,7 @@ unget_char ( int c) { ; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (yylloc) = last_yylloc; ungetc (c, input); @@ -93560,12 +94961,7 @@ int yylex (void) } #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -93580,10 +94976,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -93600,8 +94998,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -93619,39 +95017,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:649" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:649: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:649" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:608" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:649: \$XSLTPROC \\ +$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:649" +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 @@ -93660,16 +95058,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:649: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:649" +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 | sort @@ -93678,7 +95076,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -93686,64 +95084,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:649: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:649" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:608: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:608" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_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:649: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:649" + { set +x +$as_echo "$at_srcdir/calc.at:608: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:608" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:649: \$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:649" +$as_echo "$at_srcdir/calc.at:608: \$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:608" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:649: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:608: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:649" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:608" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -93751,12 +95152,11 @@ at_status=$? at_failed=false $at_check_filter at_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_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 @@ -93775,28 +95175,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -93809,28 +95209,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -93862,19 +95262,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -93884,28 +95284,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -93937,19 +95337,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -93959,28 +95359,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94012,19 +95412,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94034,28 +95434,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94087,19 +95487,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94110,28 +95510,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94163,47 +95563,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_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:649: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:649" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94235,19 +95635,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94262,7 +95662,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -94274,28 +95674,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94331,19 +95731,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94356,28 +95756,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94410,19 +95810,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94432,28 +95832,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94487,19 +95887,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94512,28 +95912,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:649" +$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:608" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94567,19 +95967,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:608" $at_failed && at_fn_log_failure $at_traceon; } @@ -94591,13 +95991,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_227 -#AT_START_228 -at_fn_group_banner 228 'calc.at:651' \ - "Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12 +#AT_STOP_324 +#AT_START_325 +at_fn_group_banner 325 'calc.at:610' \ + "Calculator parse.error=verbose %locations %defines api.prefix={calc} %verbose %yacc" "" 12 at_xfail=no ( - $as_echo "228. $at_setup_line: testing $at_desc ..." + $as_echo "325. $at_setup_line: testing $at_desc ..." $at_traceon @@ -94619,7 +96019,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc +%define parse.error verbose %locations %defines %define api.prefix {calc} %verbose %yacc %code requires { @@ -94653,7 +96053,16 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void calcerror ( const char *msg); +#include + +#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (const char *msg); int calclex (void); } @@ -94664,11 +96073,11 @@ int calclex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -94714,12 +96123,42 @@ power (int base, int exponent) } -#include + + +# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, CALCLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void calcerror ( const char *msg) +void calcerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (calclloc)); + LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -94743,7 +96182,7 @@ static int get_char (void); static void unget_char ( int c); -static YYLTYPE last_yylloc; +static CALCLTYPE last_yylloc; static int get_char (void) @@ -94768,7 +96207,7 @@ unget_char ( int c) { ; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (calclloc) = last_yylloc; ungetc (c, input); @@ -94846,12 +96285,7 @@ cat >calc-main.c <<'_ATEOF' #include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -94866,10 +96300,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -94886,8 +96322,8 @@ main (int argc, const char **argv) status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -94904,39 +96340,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:651" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:610: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:651: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:651" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:610: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:610" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:651: \$XSLTPROC \\ +$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:651" +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 @@ -94945,16 +96381,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:651: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:651" +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 | sort @@ -94963,7 +96399,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -94971,101 +96407,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:651: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:651" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:610: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:610" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_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:651: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:651" + { set +x +$as_echo "$at_srcdir/calc.at:610: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:610" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:651: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:610" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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_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:651: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:610: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:610" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95088,28 +96498,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95122,28 +96532,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95175,19 +96585,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95197,28 +96607,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95250,19 +96660,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95272,28 +96682,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95325,19 +96735,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95347,28 +96757,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95400,19 +96810,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95423,28 +96833,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95476,47 +96886,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_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:651: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:651" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95548,19 +96958,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95575,7 +96985,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -95587,28 +96997,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95644,19 +97054,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95669,28 +97079,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95723,19 +97133,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95745,28 +97155,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95800,19 +97210,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95825,28 +97235,28 @@ 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" +$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" 5>&- at_status=$? at_failed=false $at_check_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_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:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:651" +$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:610" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95880,19 +97290,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:610" $at_failed && at_fn_log_failure $at_traceon; } @@ -95904,13 +97314,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_228 -#AT_START_229 -at_fn_group_banner 229 'calc.at:653' \ - "Calculator %glr-parser %debug" " " 12 +#AT_STOP_325 +#AT_START_326 +at_fn_group_banner 326 'calc.at:611' \ + "Calculator parse.error=verbose %locations %defines %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc" "" 12 at_xfail=no ( - $as_echo "229. $at_setup_line: testing $at_desc ..." + $as_echo "326. $at_setup_line: testing $at_desc ..." $at_traceon @@ -95932,7 +97342,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %debug +%define parse.error verbose %locations %defines %name-prefix "calc" %define api.token.prefix {TOK_} %verbose %yacc %code requires { @@ -95966,8 +97376,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void yyerror ( const char *msg); -int yylex (void); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (const char *msg); +int calclex (void); } @@ -95977,11 +97396,11 @@ int yylex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -96027,26 +97446,82 @@ power (int base, int exponent) } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void calcerror (const char *msg) { + LOCATION_PRINT (stderr, (calclloc)); + fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } +_ATEOF + + + +cat >calc-lex.c <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.h" + #include -int yylex (void); +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; } @@ -96055,6 +97530,9 @@ unget_char ( int c) { ; + /* Wrong when C == '\n'. */ + (calclloc) = last_yylloc; + ungetc (c, input); } @@ -96090,12 +97568,14 @@ read_signed_integer (void) | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (void) +int calclex (void) { int c; /* Skip current token, then white spaces. */ do { + (calclloc).first_column = (calclloc).last_column; + (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); @@ -96104,25 +97584,31 @@ int yylex (void) if (c == '.' || isdigit (c)) { unget_char ( c); - (yylval).ival = read_signed_integer (); - return NUM; + (calclval).ival = read_signed_integer (); + return TOK_NUM; } /* Return end-of-file. */ if (c == EOF) - return CALC_EOF; + return TOK_CALC_EOF; /* Return single chars. */ return c; } +_ATEOF + + +cat >calc-main.c <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -96137,10 +97623,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -96153,12 +97641,12 @@ main (int argc, const char **argv) return 3; } - yydebug = 1; - status = yyparse (); + + status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -96169,46 +97657,45 @@ _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:653" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:653" +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:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:653" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:611" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:653" +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:653: \$XSLTPROC \\ +$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:653" +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 @@ -96217,16 +97704,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:653" +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 | sort @@ -96235,7 +97722,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96243,77 +97730,79 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:653: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:653" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:611: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:611" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:653" +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:653: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:653" + { set +x +$as_echo "$at_srcdir/calc.at:611: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:611" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:653" +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:653: \$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:653" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS +$as_echo "$at_srcdir/calc.at:611: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:611" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:653" +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:653: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:611: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:653" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:653" +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 @@ -96332,28 +97821,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_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:653" +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:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96366,28 +97855,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96418,22 +97907,20 @@ cat >expout <<'_ATEOF' _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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96443,28 +97930,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96495,22 +97982,20 @@ cat >expout <<'_ATEOF' _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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96520,28 +98005,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96572,22 +98057,20 @@ cat >expout <<'_ATEOF' _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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96597,28 +98080,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96649,22 +98132,20 @@ cat >expout <<'_ATEOF' _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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96675,28 +98156,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96727,50 +98208,48 @@ cat >expout <<'_ATEOF' _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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +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:653: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96801,22 +98280,20 @@ cat >expout <<'_ATEOF' _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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96831,7 +98308,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -96843,28 +98320,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_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:653" +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:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96899,22 +98376,20 @@ 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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96927,28 +98402,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_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:653" +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:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -96980,22 +98455,20 @@ 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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -97005,28 +98478,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_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:653" +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:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -97059,22 +98532,20 @@ 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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -97087,28 +98558,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_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:653" +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:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:653" +$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:611" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -97141,22 +98612,20 @@ cat >expout <<'_ATEOF' _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 + +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:653: cat stderr" -at_fn_check_prepare_trace "calc.at:653" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611" $at_failed && at_fn_log_failure $at_traceon; } @@ -97168,13 +98637,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_229 -#AT_START_230 -at_fn_group_banner 230 'calc.at:654' \ - "Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12 +#AT_STOP_326 +#AT_START_327 +at_fn_group_banner 327 'calc.at:613' \ + "Calculator %debug" " " 12 at_xfail=no ( - $as_echo "230. $at_setup_line: testing $at_desc ..." + $as_echo "327. $at_setup_line: testing $at_desc ..." $at_traceon @@ -97196,7 +98665,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc +%debug %code requires { @@ -97230,8 +98699,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void calcerror ( const char *msg); -int calclex (void); +#include + +static void yyerror (const char *msg); +int yylex (void); } @@ -97241,11 +98712,11 @@ int calclex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -97291,52 +98762,27 @@ power (int base, int exponent) } -#include + + /* A C error reporting function. */ static -void calcerror ( const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (calclloc)); - fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } -_ATEOF - - - -cat >calc-lex.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" - #include -int calclex (void); +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 = (calclloc); - if (res == '\n') - { - (calclloc).last_line++; - (calclloc).last_column = 1; - } - else - (calclloc).last_column++; - return res; } @@ -97345,9 +98791,6 @@ unget_char ( int c) { ; - /* Wrong when C == `\n'. */ - (calclloc) = last_yylloc; - ungetc (c, input); } @@ -97383,14 +98826,12 @@ read_signed_integer (void) | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (void) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (calclloc).first_column = (calclloc).last_column; - (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); @@ -97399,7 +98840,7 @@ int calclex (void) if (c == '.' || isdigit (c)) { unget_char ( c); - (calclval).ival = read_signed_integer (); + (yylval).ival = read_signed_integer (); return NUM; } @@ -97410,25 +98851,9 @@ int calclex (void) /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.c <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -97443,10 +98868,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -97459,12 +98886,12 @@ main (int argc, const char **argv) return 3; } - calcdebug = 1; - status = calcparse (); + yydebug = 1; + status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -97475,45 +98902,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:654" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:613: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:654" +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:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:654" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:613: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:613" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:654" +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:654: \$XSLTPROC \\ +$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:654" +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 @@ -97522,16 +98950,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:654" +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 | sort @@ -97540,7 +98968,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97548,64 +98976,67 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:654: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:654" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:613: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:613" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:654" +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:654: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:654" + { set +x +$as_echo "$at_srcdir/calc.at:613: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:613" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:654" +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:654: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:654" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS +$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" 5>&- at_status=$? at_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:654" +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:654: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:613: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:613" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -97613,36 +99044,7 @@ at_status=$? at_failed=false $at_check_filter at_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:654" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:654: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97665,28 +99067,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_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:654" +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:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97699,28 +99101,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97751,20 +99153,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97774,28 +99178,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97826,20 +99230,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97849,28 +99255,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97901,20 +99307,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97924,28 +99332,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -97976,20 +99384,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98000,28 +99410,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98052,48 +99462,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +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:654: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98124,20 +99536,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98152,7 +99566,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -98164,28 +99578,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_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:654" +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:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98220,20 +99634,22 @@ 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/^[-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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98246,28 +99662,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_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:654" +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:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98299,20 +99715,22 @@ 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/^[-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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98322,28 +99740,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_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:654" +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:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98376,20 +99794,22 @@ 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/^[-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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98402,28 +99822,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_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:654" +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:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:654" +$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:613" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98456,20 +99876,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:654: cat stderr" -at_fn_check_prepare_trace "calc.at:654" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613" $at_failed && at_fn_log_failure $at_traceon; } @@ -98481,13 +99903,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_230 -#AT_START_231 -at_fn_group_banner 231 'calc.at:655' \ - "Calculator %glr-parser %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc" "" 12 +#AT_STOP_327 +#AT_START_328 +at_fn_group_banner 328 'calc.at:614' \ + "Calculator parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12 at_xfail=no ( - $as_echo "231. $at_setup_line: testing $at_desc ..." + $as_echo "328. $at_setup_line: testing $at_desc ..." $at_traceon @@ -98509,7 +99931,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc +%define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { @@ -98543,7 +99965,16 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void calcerror ( const char *msg); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (const char *msg); int calclex (void); } @@ -98554,11 +99985,11 @@ int calclex (void); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -98604,12 +100035,42 @@ power (int base, int exponent) } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void calcerror ( const char *msg) +void calcerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (calclloc)); + LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -98633,7 +100094,7 @@ static int get_char (void); static void unget_char ( int c); -static CALCLTYPE last_yylloc; +static YYLTYPE last_yylloc; static int get_char (void) @@ -98658,7 +100119,7 @@ unget_char ( int c) { ; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (calclloc) = last_yylloc; ungetc (c, input); @@ -98736,12 +100197,7 @@ cat >calc-main.c <<'_ATEOF' #include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -98756,10 +100212,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -98776,8 +100234,8 @@ main (int argc, const char **argv) status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -98794,39 +100252,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:655: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:655" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:614" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:655" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:614" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:655: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:655" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:614" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -98835,16 +100293,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:655: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:655" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:614" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -98853,7 +100311,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -98861,101 +100319,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:655: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:655" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:614: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:614" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:655: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:655" + { set +x +$as_echo "$at_srcdir/calc.at:614: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:614" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:614" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:655" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:655: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:655" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:614: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:655" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:614" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -98978,28 +100410,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99012,28 +100444,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99065,19 +100497,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99087,28 +100519,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99140,19 +100572,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99162,28 +100594,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99215,19 +100647,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99237,28 +100669,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99290,19 +100722,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99313,28 +100745,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99366,47 +100798,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $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:655: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99438,19 +100870,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99465,7 +100897,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -99477,28 +100909,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99534,19 +100966,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99559,28 +100991,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99613,19 +101045,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99635,28 +101067,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99690,19 +101122,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99715,28 +101147,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:655: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:655: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99770,19 +101202,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:655: cat stderr" -at_fn_check_prepare_trace "calc.at:655" +$as_echo "$at_srcdir/calc.at:614: cat stderr" +at_fn_check_prepare_trace "calc.at:614" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:655" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614" $at_failed && at_fn_log_failure $at_traceon; } @@ -99794,13 +101226,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_231 -#AT_START_232 -at_fn_group_banner 232 'calc.at:657' \ - "Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12 +#AT_STOP_328 +#AT_START_329 +at_fn_group_banner 329 'calc.at:615' \ + "Calculator parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc" "" 12 at_xfail=no ( - $as_echo "232. $at_setup_line: testing $at_desc ..." + $as_echo "329. $at_setup_line: testing $at_desc ..." $at_traceon @@ -99822,7 +101254,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc +%define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %code requires { @@ -99856,8 +101288,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void calcerror (YYLTYPE const * const llocp, const char *msg); -int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); +#include + +#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (const char *msg); +int calclex (void); } @@ -99867,11 +101308,11 @@ int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -99917,12 +101358,42 @@ power (int base, int exponent) } -#include + + +# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, CALCLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void calcerror (YYLTYPE const * const llocp, const char *msg) +void calcerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (*llocp)); + LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -99941,63 +101412,63 @@ cat >calc-lex.c <<'_ATEOF' #include -int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); -static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp); -static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c); +int calclex (void); +static int get_char (void); +static void unget_char ( int c); -static YYLTYPE last_yylloc; +static CALCLTYPE last_yylloc; static int -get_char (YYSTYPE *lvalp, YYLTYPE *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; + ; - last_yylloc = (*llocp); + last_yylloc = (calclloc); if (res == '\n') { - (*llocp).last_line++; - (*llocp).last_column = 1; + (calclloc).last_line++; + (calclloc).last_column = 1; } else - (*llocp).last_column++; + (calclloc).last_column++; return res; } static void -unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; + ; - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + /* Wrong when C == '\n'. */ + (calclloc) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -100009,23 +101480,23 @@ read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (YYSTYPE *lvalp, YYLTYPE *llocp) +int calclex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).first_column = (*llocp).last_column; - (*llocp).first_line = (*llocp).last_line; + (calclloc).first_column = (calclloc).last_column; + (calclloc).first_line = (calclloc).last_line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (calclval).ival = read_signed_integer (); return NUM; } @@ -100049,12 +101520,7 @@ cat >calc-main.c <<'_ATEOF' #include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -100069,10 +101535,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -100089,8 +101557,8 @@ main (int argc, const char **argv) status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -100107,39 +101575,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:657: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:657" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:657" +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:657: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:657" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:615" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:657" +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:657: \$XSLTPROC \\ +$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:657" +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 @@ -100148,16 +101616,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:657: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:657" +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 | sort @@ -100166,7 +101634,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100174,101 +101642,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:657: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:657" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:615: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:615" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:657" +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:657: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:657" + { set +x +$as_echo "$at_srcdir/calc.at:615: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:615" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:657" +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:657: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:615" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:657" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:657: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:657" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:657" +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:657: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:615: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:657" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100291,28 +101733,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_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:657" +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:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100325,28 +101767,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100378,19 +101820,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100400,28 +101842,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100453,19 +101895,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100475,28 +101917,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100528,19 +101970,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100550,28 +101992,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100603,19 +102045,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100626,28 +102068,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100679,47 +102121,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +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:657: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100751,19 +102193,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100778,7 +102220,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -100790,28 +102232,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_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:657" +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:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100847,19 +102289,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100872,28 +102314,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_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:657" +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:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100926,19 +102368,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -100948,28 +102390,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_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:657" +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:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -101003,19 +102445,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -101028,28 +102470,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:657: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_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:657" +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:657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:657" +$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:615" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -101083,19 +102525,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:657: cat stderr" -at_fn_check_prepare_trace "calc.at:657" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:657" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -101107,13 +102549,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_232 -#AT_START_233 -at_fn_group_banner 233 'calc.at:659' \ - "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}" "" 12 +#AT_STOP_329 +#AT_START_330 +at_fn_group_banner 330 'calc.at:617' \ + "Calculator api.pure=full parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12 at_xfail=no ( - $as_echo "233. $at_setup_line: testing $at_desc ..." + $as_echo "330. $at_setup_line: testing $at_desc ..." $at_traceon @@ -101135,7 +102577,7 @@ cat >calc.y <<'_ATEOF' } /* 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} +%define api.pure full %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { @@ -101169,7 +102611,16 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); +#include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (YYLTYPE const * const llocp, const char *msg); int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } @@ -101180,22 +102631,22 @@ int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% input: line -| input line { ++*count; ++global_count; } +| input line { } ; line: '\n' -| exp '\n' { *result = global_result = $1; } +| exp '\n' { USE ($1); } ; exp: @@ -101230,14 +102681,42 @@ power (int base, int exponent) } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) +void calcerror (YYLTYPE const * const llocp, const char *msg) { - YYUSE(result); - YYUSE(count); - YY_LOCATION_PRINT (stderr, (*llocp)); + LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -101286,7 +102765,7 @@ unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (*llocp) = last_yylloc; ungetc (c, input); @@ -101364,12 +102843,7 @@ cat >calc-main.c <<'_ATEOF' #include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -101384,10 +102858,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -101401,11 +102877,11 @@ main (int argc, const char **argv) } calcdebug = 1; - status = calcparse (&result, &count); + status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -101422,39 +102898,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:659" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:617: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:617" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:659" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:617: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:617" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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' "calc.at:659" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 @@ -101463,16 +102939,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:659" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 | sort @@ -101481,7 +102957,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101489,101 +102965,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:659: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:659" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:617: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:617" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:659: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:659" + { set +x +$as_echo "$at_srcdir/calc.at:617: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:617" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:617" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:659: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:617: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:617" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:659" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:659: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101606,28 +103056,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101640,28 +103090,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101693,19 +103143,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101715,28 +103165,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101768,19 +103218,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101790,28 +103240,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101843,19 +103293,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101865,28 +103315,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101918,19 +103368,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101941,28 +103391,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -101994,47 +103444,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $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:659: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102066,19 +103516,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102093,7 +103543,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -102105,28 +103555,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102162,19 +103612,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102187,28 +103637,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102241,19 +103691,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102263,28 +103713,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102318,19 +103768,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102343,28 +103793,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102398,19 +103848,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:659: cat stderr" -at_fn_check_prepare_trace "calc.at:659" +$as_echo "$at_srcdir/calc.at:617: cat stderr" +at_fn_check_prepare_trace "calc.at:617" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617" $at_failed && at_fn_log_failure $at_traceon; } @@ -102422,13 +103872,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_233 -#AT_START_234 -at_fn_group_banner 234 'calc.at:660' \ - "Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 12 +#AT_STOP_330 +#AT_START_331 +at_fn_group_banner 331 'calc.at:618' \ + "Calculator api.push-pull=both api.pure=full parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc" "" 12 at_xfail=no ( - $as_echo "234. $at_setup_line: testing $at_desc ..." + $as_echo "331. $at_setup_line: testing $at_desc ..." $at_traceon @@ -102450,7 +103900,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%glr-parser %define api.pure %error-verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} +%define api.push-pull both %define api.pure full %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %code requires { @@ -102484,7 +103934,16 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); -static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); +#include + +#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (CALCLTYPE const * const llocp, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } @@ -102495,22 +103954,22 @@ int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% input: line -| input line { ++*count; ++global_count; } +| input line { } ; line: '\n' -| exp '\n' { *result = global_result = $1; } +| exp '\n' { USE ($1); } ; exp: @@ -102545,14 +104004,42 @@ power (int base, int exponent) } -#include + + +# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, CALCLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) +void calcerror (CALCLTYPE const * const llocp, const char *msg) { - YYUSE(result); - YYUSE(count); - YY_LOCATION_PRINT (stderr, (*llocp)); + LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -102601,7 +104088,7 @@ unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c) { (void) lvalp;(void) llocp; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (*llocp) = last_yylloc; ungetc (c, input); @@ -102679,12 +104166,7 @@ cat >calc-main.c <<'_ATEOF' #include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include @@ -102699,10 +104181,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -102716,11 +104200,11 @@ main (int argc, const char **argv) } calcdebug = 1; - status = calcparse (&result, &count); + status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -102737,39 +104221,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:660: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:660" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:660" +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:660: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:660" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:618" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:660" +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:660: \$XSLTPROC \\ +$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:660" +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 @@ -102778,16 +104262,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:660: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:660" +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 | sort @@ -102796,7 +104280,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -102804,101 +104288,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:660: bison -o calc.c calc.y" -at_fn_check_prepare_trace "calc.at:660" -( $at_check_trace; bison -o calc.c calc.y +$as_echo "$at_srcdir/calc.at:618: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:618" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:660" +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:660: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:660" + { set +x +$as_echo "$at_srcdir/calc.at:618: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:618" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:660" +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:660: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:618" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:660" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:660: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.c -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:660" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.c - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:660" +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:660: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:618: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.h + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:660" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.h + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -102921,28 +104379,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_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:660" +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:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -102955,28 +104413,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103008,19 +104466,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103030,28 +104488,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103083,19 +104541,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103105,28 +104563,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103158,19 +104616,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103180,28 +104638,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103233,19 +104691,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103256,28 +104714,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103309,47 +104767,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +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:660: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103381,19 +104839,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103408,7 +104866,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -103420,28 +104878,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_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:660" +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:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103477,19 +104935,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103502,28 +104960,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_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:660" +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:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103556,19 +105014,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103578,28 +105036,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_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:660" +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:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103633,19 +105091,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103658,28 +105116,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:660: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_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:660" +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:660: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:660" +$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103713,19 +105171,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:660: cat stderr" -at_fn_check_prepare_trace "calc.at:660" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:660" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618" $at_failed && at_fn_log_failure $at_traceon; } @@ -103737,13 +105195,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_234 -#AT_START_235 -at_fn_group_banner 235 'calc.at:670' \ - "Calculator %skeleton \"lalr1.cc\" %defines %locations" "" 13 +#AT_STOP_331 +#AT_START_332 +at_fn_group_banner 332 'calc.at:620' \ + "Calculator api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 12 at_xfail=no ( - $as_echo "235. $at_setup_line: testing $at_desc ..." + $as_echo "332. $at_setup_line: testing $at_desc ..." $at_traceon @@ -103765,8 +105223,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%skeleton "lalr1.cc" %defines %locations -%define global_tokens_and_yystype +%define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} + %code requires { @@ -103779,7 +105237,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -103799,8 +105257,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); +int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } @@ -103810,22 +105277,22 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% input: line -| input line { } +| input line { ++*count; ++global_count; } ; line: '\n' -| exp '\n' { USE ($1); } +| exp '\n' { *result = global_result = $1; } ; exp: @@ -103860,37 +105327,71 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) + + +# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, CALCLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { - (void) l; - std::cerr << l << ": " << m << std::endl; + YYUSE(result); + YYUSE(count); + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); } _ATEOF -cat >calc-lex.cc <<'_ATEOF' +cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); +int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); +static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp); +static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c); -static yy::parser::location_type last_yylloc; +static CALCLTYPE last_yylloc; static int -get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; @@ -103898,28 +105399,28 @@ get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) last_yylloc = (*llocp); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (*llocp).last_line++; + (*llocp).last_column = 1; } else - (*llocp).end.column++; + (*llocp).last_column++; return res; } static void -unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c) { (void) lvalp;(void) llocp; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; @@ -103950,14 +105451,14 @@ read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (*llocp).first_column = (*llocp).last_column; + (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); @@ -103980,35 +105481,19 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) _ATEOF -cat >calc-main.cc <<'_ATEOF' +cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ yyparse that simulates the C signature. */ -int -yyparse () -{ - yy::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -104021,10 +105506,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -104037,12 +105524,12 @@ main (int argc, const char **argv) return 3; } - - status = yyparse (); + calcdebug = 1; + status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -104059,39 +105546,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:670: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:670" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:670" +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:670: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:670" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:620" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:670" +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:670: \$XSLTPROC \\ +$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:670" +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 @@ -104100,16 +105587,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:670: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:670" +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 | sort @@ -104118,7 +105605,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104126,102 +105613,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:670: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:670" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:620: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:620" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:670" +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:670: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:670" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:620: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:620" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:670" +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:670: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:670" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:620: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:620" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:670" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:670: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:670" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:670" +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:670: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:620: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:670" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:620" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104244,28 +105704,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_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:670" +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:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104278,28 +105738,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104331,20 +105791,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104354,28 +105813,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104407,20 +105866,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104430,28 +105888,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104483,20 +105941,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104506,28 +105963,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104559,20 +106016,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104583,28 +106039,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104636,48 +106092,47 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +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:670: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104709,20 +106164,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104737,7 +106191,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -104749,28 +106203,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_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:670" +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:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104806,20 +106260,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104832,28 +106285,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_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:670" +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:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104886,20 +106339,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104909,28 +106361,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_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:670" +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:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104964,20 +106416,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -104990,28 +106441,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:670: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_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:670" +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:670: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:670" +$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:620" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -105045,20 +106496,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:670: cat stderr" -at_fn_check_prepare_trace "calc.at:670" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:670" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620" $at_failed && at_fn_log_failure $at_traceon; } @@ -105070,13 +106520,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_235 -#AT_START_236 -at_fn_group_banner 236 'calc.at:679' \ - "Calculator %language \"C++\" %defines %locations " "" 13 +#AT_STOP_332 +#AT_START_333 +at_fn_group_banner 333 'calc.at:637' \ + "Calculator %glr-parser " " " 13 at_xfail=no ( - $as_echo "236. $at_setup_line: testing $at_desc ..." + $as_echo "333. $at_setup_line: testing $at_desc ..." $at_traceon @@ -105098,8 +106548,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %defines %locations -%define global_tokens_and_yystype +%glr-parser + %code requires { @@ -105112,7 +106562,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -105132,8 +106582,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static void yyerror (const char *msg); +int yylex (void); } @@ -105143,11 +106595,11 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -105193,85 +106645,59 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - - - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -#include "calc.hh" +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} #include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); +int yylex (void); +static int get_char (void); +static void unget_char ( int c); -static yy::parser::location_type last_yylloc; - static int -get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).end.line++; - (*llocp).end.column = 1; - } - else - (*llocp).end.column++; + ; return res; } static void -unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + ; ungetc (c, input); } static int -read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -105283,23 +106709,21 @@ read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (yylval).ival = read_signed_integer (); return NUM; } @@ -105310,38 +106734,11 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ yyparse that simulates the C signature. */ -int -yyparse () -{ - yy::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -105354,10 +106751,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -105374,8 +106773,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -105386,45 +106785,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:637: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:637" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:679" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:637: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:637" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:637: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:637" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -105433,16 +106833,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:637: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:679" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:637" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -105451,7 +106851,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105459,102 +106859,75 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/calc.at:637: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:637" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $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 + { set +x +$as_echo "$at_srcdir/calc.at:637: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:637" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $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 calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:679" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:637: \$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:637" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:679: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:637: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:637" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105577,28 +106950,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105611,28 +106984,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105663,21 +107036,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105687,28 +107061,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105739,21 +107113,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105763,28 +107138,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105815,21 +107190,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105839,28 +107215,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105891,21 +107267,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105916,28 +107293,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -105968,49 +107345,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo 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_fn_check_status 1 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106041,21 +107419,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106070,7 +107449,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -106082,28 +107461,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106138,21 +107517,22 @@ 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/^[-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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106165,28 +107545,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106218,21 +107598,22 @@ 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/^[-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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106242,28 +107623,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106296,21 +107677,22 @@ 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/^[-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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106323,28 +107705,28 @@ 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" +$as_echo "$at_srcdir/calc.at:637: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106377,21 +107759,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:679: cat stderr" -at_fn_check_prepare_trace "calc.at:679" +$as_echo "$at_srcdir/calc.at:637: cat stderr" +at_fn_check_prepare_trace "calc.at:637" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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_fn_check_status 0 $at_status "$at_srcdir/calc.at:637" $at_failed && at_fn_log_failure $at_traceon; } @@ -106403,13 +107786,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_236 -#AT_START_237 -at_fn_group_banner 237 'calc.at:680' \ - "Calculator %language \"C++\" %defines %locations %define api.location.type Span" "" 13 +#AT_STOP_333 +#AT_START_334 +at_fn_group_banner 334 'calc.at:639' \ + "Calculator %glr-parser %defines" " " 13 at_xfail=no ( - $as_echo "237. $at_setup_line: testing $at_desc ..." + $as_echo "334. $at_setup_line: testing $at_desc ..." $at_traceon @@ -106431,38 +107814,11 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %defines %locations %define api.location.type Span -%define global_tokens_and_yystype +%glr-parser %defines + %code requires { -# include - struct Point - { - int l; - int c; - }; - - struct Span - { - Point first; - Point last; - }; - -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first = YYRHSLOC (Rhs, 1).first; \ - (Current).last = YYRHSLOC (Rhs, N).last; \ - } \ - else \ - { \ - (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \ - } \ - while (false) - - /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } @@ -106472,7 +107828,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -106492,27 +107848,24 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static void yyerror (const char *msg); +int yylex (void); } -%initial-action -{ - @$.first.l = @$.first.c = 1; - @$.last = @$.first; -} /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -106558,96 +107911,72 @@ power (int base, int exponent) } - std::ostream& - operator<< (std::ostream& o, const Span& s) - { - o << s.first.l << '.' << s.first.c; - if (s.first.l != s.last.l) - o << '-' << s.last.l << '.' << s.last.c - 1; - else if (s.first.c != s.last.c - 1) - o << '-' << s.last.c - 1; - return o; - } -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) + +/* A C error reporting function. */ +static +void yyerror (const char *msg) { - (void) l; - std::cerr << l << ": " << m << std::endl; + fprintf (stderr, "%s\n", msg); } _ATEOF -cat >calc-lex.cc <<'_ATEOF' +cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); - +int yylex (void); +static int get_char (void); +static void unget_char ( int c); -static yy::parser::location_type last_yylloc; static int -get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).last.l++; - (*llocp).last.c = 1; - } - else - (*llocp).last.c++; + ; return res; } static void -unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + ; ungetc (c, input); } static int -read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -106659,23 +107988,21 @@ read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).first.c = (*llocp).last.c; - (*llocp).first.l = (*llocp).last.l; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (yylval).ival = read_signed_integer (); return NUM; } @@ -106689,35 +108016,19 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) _ATEOF -cat >calc-main.cc <<'_ATEOF' +cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ yyparse that simulates the C signature. */ -int -yyparse () -{ - yy::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -106730,10 +108041,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -106750,8 +108063,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -106768,39 +108081,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:680" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:639" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:680" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:639" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:639: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:680" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:639" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -106809,16 +108122,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:639: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:680" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:639" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -106827,7 +108140,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -106835,102 +108148,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:680: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:680" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:639: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:639" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:680: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:680" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:639: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:639" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:680" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:639: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:639" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:680" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:680: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:639: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:639" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -106953,28 +108239,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -106987,28 +108273,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107039,21 +108325,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107063,28 +108350,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107115,21 +108402,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107139,28 +108427,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107191,21 +108479,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107215,28 +108504,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107267,21 +108556,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107292,28 +108582,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107344,49 +108634,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $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:680: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107417,21 +108708,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107446,7 +108738,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -107458,28 +108750,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107514,21 +108806,22 @@ 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/^[-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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107541,28 +108834,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107594,21 +108887,22 @@ 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/^[-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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107618,28 +108912,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107672,21 +108966,22 @@ 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/^[-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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107699,28 +108994,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107753,21 +109048,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:680: cat stderr" -at_fn_check_prepare_trace "calc.at:680" +$as_echo "$at_srcdir/calc.at:639: cat stderr" +at_fn_check_prepare_trace "calc.at:639" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -107779,13 +109075,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_237 -#AT_START_238 -at_fn_group_banner 238 'calc.at:681' \ - "Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc" "" 13 +#AT_STOP_334 +#AT_START_335 +at_fn_group_banner 335 'calc.at:640' \ + "Calculator %glr-parser %locations" " " 13 at_xfail=no ( - $as_echo "238. $at_setup_line: testing $at_desc ..." + $as_echo "335. $at_setup_line: testing $at_desc ..." $at_traceon @@ -107807,8 +109103,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc -%define global_tokens_and_yystype +%glr-parser %locations + %code requires { @@ -107821,7 +109117,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -107841,8 +109137,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); +int yylex (void); } @@ -107852,11 +109157,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -107902,85 +109207,104 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); +int yylex (void); +static int get_char (void); +static void unget_char ( int c); -static calc::parser::location_type last_yylloc; +static YYLTYPE last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; + ; - last_yylloc = (*llocp); + last_yylloc = (yylloc); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (yylloc).last_line++; + (yylloc).last_column = 1; } else - (*llocp).end.column++; + (yylloc).last_column++; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; + ; - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + /* Wrong when C == '\n'. */ + (yylloc) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -107992,23 +109316,23 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (yylloc).first_column = (yylloc).last_column; + (yylloc).first_line = (yylloc).last_line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (yylval).ival = read_signed_integer (); return NUM; } @@ -108019,37 +109343,10 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse () -{ - calc::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} semantic_value global_result = 0; @@ -108063,10 +109360,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -108080,11 +109379,11 @@ main (int argc, const char **argv) } - status = calcparse (); + status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -108095,45 +109394,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:681" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:640" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:681" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:640" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:681" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:640" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -108142,16 +109442,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:681" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:640" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -108160,7 +109460,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108168,102 +109468,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:681: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:681" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:640: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:640" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:681: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:681" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:640: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:640" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:681" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:640: \$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:640" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:681" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:681: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:640: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108286,28 +109559,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108320,28 +109593,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108373,19 +109646,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108395,28 +109669,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108448,19 +109722,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108470,28 +109745,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108523,19 +109798,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108545,28 +109821,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108598,19 +109874,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108621,28 +109898,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108674,47 +109951,48 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $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:681: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108746,19 +110024,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108773,7 +110052,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -108785,28 +110064,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108842,19 +110121,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108867,28 +110147,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108921,19 +110201,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108943,28 +110224,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -108998,19 +110279,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -109023,28 +110305,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -109078,19 +110360,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +# 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:681: cat stderr" -at_fn_check_prepare_trace "calc.at:681" +$as_echo "$at_srcdir/calc.at:640: cat stderr" +at_fn_check_prepare_trace "calc.at:640" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640" $at_failed && at_fn_log_failure $at_traceon; } @@ -109102,13 +110385,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_238 -#AT_START_239 -at_fn_group_banner 239 'calc.at:682' \ - "Calculator %language \"C++\" %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc" "" 13 +#AT_STOP_335 +#AT_START_336 +at_fn_group_banner 336 'calc.at:641' \ + "Calculator %glr-parser %name-prefix \"calc\"" " " 13 at_xfail=no ( - $as_echo "239. $at_setup_line: testing $at_desc ..." + $as_echo "336. $at_setup_line: testing $at_desc ..." $at_traceon @@ -109130,8 +110413,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %defines %locations %error-verbose %define api.prefix "calc" %verbose %yacc -%define global_tokens_and_yystype +%glr-parser %name-prefix "calc" + %code requires { @@ -109144,7 +110427,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -109164,8 +110447,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void calcerror (const char *msg); +int calclex (void); } @@ -109175,11 +110460,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -109225,85 +110510,59 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" - +/* A C error reporting function. */ +static +void calcerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); - +int calclex (void); +static int get_char (void); +static void unget_char ( int c); -static calc::parser::location_type last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).end.line++; - (*llocp).end.column = 1; - } - else - (*llocp).end.column++; + ; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + ; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -109315,23 +110574,21 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int calclex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (calclval).ival = read_signed_integer (); return NUM; } @@ -109342,38 +110599,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse () -{ - calc::parser parser; -#if CALCDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -109386,10 +110616,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -109406,8 +110638,8 @@ main (int argc, const char **argv) status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -109418,45 +110650,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:682" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:641" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:682" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:641" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:682: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:682" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:641" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -109465,16 +110698,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:682: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:682" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:641" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -109483,7 +110716,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109491,102 +110724,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:682: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:682" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:641: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:641" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:682: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:682" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:641: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:641" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:682" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:641: \$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:641" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:682" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:682: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:682" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:641: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:682" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:641" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109609,28 +110815,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109643,28 +110849,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109695,20 +110901,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109718,28 +110926,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109770,20 +110978,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109793,28 +111003,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109845,20 +111055,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109868,28 +111080,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109920,20 +111132,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109944,28 +111158,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -109996,48 +111210,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $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:682: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -110068,20 +111284,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -110096,7 +111314,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -110108,28 +111326,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -110164,20 +111382,22 @@ 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/^[-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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -110190,28 +111410,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -110243,131 +111463,135 @@ 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:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:641" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:641" +$at_failed && at_fn_log_failure +$at_traceon; } -# 4. If error-verbose is not used, strip the`, unexpected....' part. + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $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' -(- *) + (1 2) = 1 +(* *) + (*) + (*) _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:682" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" -$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:682: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:682" -( $at_check_trace; $PREPARSER ./calc input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:682" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:682: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:682" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -110400,20 +111624,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:682: cat stderr" -at_fn_check_prepare_trace "calc.at:682" +$as_echo "$at_srcdir/calc.at:641: cat stderr" +at_fn_check_prepare_trace "calc.at:641" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:682" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641" $at_failed && at_fn_log_failure $at_traceon; } @@ -110425,13 +111651,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_239 -#AT_START_240 -at_fn_group_banner 240 'calc.at:683' \ - "Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 13 +#AT_STOP_336 +#AT_START_337 +at_fn_group_banner 337 'calc.at:642' \ + "Calculator %glr-parser api.prefix={calc}" " " 13 at_xfail=no ( - $as_echo "240. $at_setup_line: testing $at_desc ..." + $as_echo "337. $at_setup_line: testing $at_desc ..." $at_traceon @@ -110453,8 +111679,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc -%define global_tokens_and_yystype +%glr-parser %define api.prefix {calc} + %code requires { @@ -110467,7 +111693,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -110487,8 +111713,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void calcerror (const char *msg); +int calclex (void); } @@ -110498,11 +111726,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -110548,85 +111776,59 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" - +/* A C error reporting function. */ +static +void calcerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); - +int calclex (void); +static int get_char (void); +static void unget_char ( int c); -static calc::parser::location_type last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).end.line++; - (*llocp).end.column = 1; - } - else - (*llocp).end.column++; + ; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + ; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -110638,23 +111840,21 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int calclex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (calclval).ival = read_signed_integer (); return NUM; } @@ -110665,38 +111865,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse () -{ - calc::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -110709,10 +111882,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -110729,8 +111904,8 @@ main (int argc, const char **argv) status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -110741,45 +111916,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:683" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:642" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:683" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:642" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:683" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:642" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -110788,16 +111964,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:683" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:642" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -110806,7 +111982,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -110814,102 +111990,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:683: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:683" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:642: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:642" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:683: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:683" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:642: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:642" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:683" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:642: \$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:642" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:683" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:683: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:642: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:642" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -110932,28 +112081,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -110966,28 +112115,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111018,20 +112167,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111041,28 +112192,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111093,20 +112244,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111116,28 +112269,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111168,20 +112321,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111191,28 +112346,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111243,20 +112398,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111267,28 +112424,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111319,48 +112476,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $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:683: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111391,20 +112550,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111419,7 +112580,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -111431,28 +112592,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111487,20 +112648,22 @@ 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/^[-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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111513,28 +112676,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111566,20 +112729,22 @@ 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/^[-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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111589,28 +112754,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111643,20 +112808,22 @@ 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/^[-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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111669,28 +112836,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111723,20 +112890,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:683: cat stderr" -at_fn_check_prepare_trace "calc.at:683" +$as_echo "$at_srcdir/calc.at:642: cat stderr" +at_fn_check_prepare_trace "calc.at:642" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642" $at_failed && at_fn_log_failure $at_traceon; } @@ -111748,13 +112917,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_240 -#AT_START_241 -at_fn_group_banner 241 'calc.at:685' \ - "Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc" "" 13 +#AT_STOP_337 +#AT_START_338 +at_fn_group_banner 338 'calc.at:643' \ + "Calculator %glr-parser %verbose" " " 13 at_xfail=no ( - $as_echo "241. $at_setup_line: testing $at_desc ..." + $as_echo "338. $at_setup_line: testing $at_desc ..." $at_traceon @@ -111776,8 +112945,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %defines %locations %pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc -%define global_tokens_and_yystype +%glr-parser %verbose + %code requires { @@ -111790,7 +112959,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -111810,8 +112979,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void yyerror (const char *msg); +int yylex (void); } @@ -111821,11 +112992,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -111871,85 +113042,59 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - - - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -#include "calc.hh" +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); - +int yylex (void); +static int get_char (void); +static void unget_char ( int c); -static calc::parser::location_type last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).end.line++; - (*llocp).end.column = 1; - } - else - (*llocp).end.column++; + ; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + ; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -111961,23 +113106,21 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (yylval).ival = read_signed_integer (); return NUM; } @@ -111988,38 +113131,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse () -{ - calc::parser parser; -#if CALCDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -112032,10 +113148,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -112049,11 +113167,11 @@ main (int argc, const char **argv) } - status = calcparse (); + status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -112064,45 +113182,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:685: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:685" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:643" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:685" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:643" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:685: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:685" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:643" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -112111,16 +113230,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:685: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:685" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:643" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -112129,7 +113248,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112137,102 +113256,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:685: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:685" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:643: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:643" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:685: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:685" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:643: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:643" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:685" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:643: \$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:643" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:685" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:685: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:685" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:643: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:685" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:643" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112255,28 +113347,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112289,28 +113381,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112341,20 +113433,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112364,28 +113458,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112416,20 +113510,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112439,28 +113535,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112491,20 +113587,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112514,28 +113612,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112566,20 +113664,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112590,28 +113690,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112642,48 +113742,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $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:685: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112714,20 +113816,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112742,7 +113846,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -112754,28 +113858,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112810,20 +113914,22 @@ 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/^[-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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112836,28 +113942,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112889,20 +113995,22 @@ 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/^[-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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112912,28 +114020,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112966,20 +114074,22 @@ 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/^[-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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -112992,28 +114102,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:685: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:685: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -113046,20 +114156,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:685: cat stderr" -at_fn_check_prepare_trace "calc.at:685" +$as_echo "$at_srcdir/calc.at:643: cat stderr" +at_fn_check_prepare_trace "calc.at:643" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:685" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643" $at_failed && at_fn_log_failure $at_traceon; } @@ -113071,13 +114183,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_241 -#AT_START_242 -at_fn_group_banner 242 'calc.at:687' \ - "Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13 +#AT_STOP_338 +#AT_START_339 +at_fn_group_banner 339 'calc.at:644' \ + "Calculator %glr-parser %yacc" " " 13 at_xfail=no ( - $as_echo "242. $at_setup_line: testing $at_desc ..." + $as_echo "339. $at_setup_line: testing $at_desc ..." $at_traceon @@ -113099,8 +114211,8 @@ cat >calc.y <<'_ATEOF' } /* 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 +%glr-parser %yacc + %code requires { @@ -113113,7 +114225,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -113133,8 +114245,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void yyerror (const char *msg); +int yylex (void); } @@ -113144,22 +114258,22 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% input: line -| input line { ++*count; ++global_count; } +| input line { } ; line: '\n' -| exp '\n' { *result = global_result = $1; } +| exp '\n' { USE ($1); } ; exp: @@ -113194,85 +114308,59 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - - - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -#include "calc.hh" +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); - +int yylex (void); +static int get_char (void); +static void unget_char ( int c); -static calc::parser::location_type last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).end.line++; - (*llocp).end.column = 1; - } - else - (*llocp).end.column++; + ; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + ; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -113284,23 +114372,21 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (yylval).ival = read_signed_integer (); return NUM; } @@ -113311,37 +114397,10 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse (semantic_value *result, int *count) -{ - calc::parser parser (result, count); -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} semantic_value global_result = 0; @@ -113355,10 +114414,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -113372,11 +114433,11 @@ main (int argc, const char **argv) } - status = calcparse (&result, &count); + status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -113387,45 +114448,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:687" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:644" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:687" +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:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:687" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:644" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:687" +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:687: \$XSLTPROC \\ +$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:687" +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 @@ -113434,16 +114496,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:687" +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 | sort @@ -113452,7 +114514,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113460,102 +114522,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:687: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:687" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:644: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:644" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:687" +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:687: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:687" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:644: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:644" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:687" +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:687: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:687" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:644: \$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:644" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:687: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:687" +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:687: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:644: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:644" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113578,28 +114613,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_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:687" +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:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113612,28 +114647,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113664,20 +114699,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113687,28 +114724,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113739,20 +114776,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113762,28 +114801,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113814,20 +114853,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113837,28 +114878,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113889,20 +114930,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113913,28 +114956,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -113965,48 +115008,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +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:687: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -114037,20 +115082,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -114065,7 +115112,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -114077,28 +115124,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_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:687" +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:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -114133,20 +115180,22 @@ 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/^[-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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -114159,28 +115208,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_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:687" +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:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -114212,131 +115261,135 @@ 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:644: cat stderr" +at_fn_check_prepare_trace "calc.at:644" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_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) = 1 +_ATEOF -# 4. If error-verbose is not used, strip the`, unexpected....' part. +{ 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" 5>&- +at_status=$? at_failed=false +$at_check_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; } +{ set +x +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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. +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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +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' -(- *) + (1 2) = 1 +(* *) + (*) + (*) _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_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:687" +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:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" +$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:644" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:687" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Normalize the observed and expected error messages, depending upon the -# options. -# 1. Remove the traces from observed. -sed '/^Starting/d -/^Entering/d -/^Stack/d -/^Reading/d -/^Reducing/d -/^Return/d -/^Shifting/d -/^state/d -/^Cleanup:/d -/^Error:/d -/^Next/d -/^Now/d -/^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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" -( $at_check_trace; cat stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" -$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:687: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" -( $at_check_trace; $PREPARSER ./calc input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:687" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:687" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_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:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -114369,20 +115422,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:687: cat stderr" -at_fn_check_prepare_trace "calc.at:687" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644" $at_failed && at_fn_log_failure $at_traceon; } @@ -114394,13 +115449,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_242 -#AT_START_243 -at_fn_group_banner 243 'calc.at:688' \ - "Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13 +#AT_STOP_339 +#AT_START_340 +at_fn_group_banner 340 'calc.at:645' \ + "Calculator %glr-parser parse.error=verbose" " " 13 at_xfail=no ( - $as_echo "243. $at_setup_line: testing $at_desc ..." + $as_echo "340. $at_setup_line: testing $at_desc ..." $at_traceon @@ -114422,8 +115477,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %defines %locations %pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} -%define global_tokens_and_yystype +%glr-parser %define parse.error verbose + %code requires { @@ -114436,7 +115491,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -114456,8 +115511,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void yyerror (const char *msg); +int yylex (void); } @@ -114467,22 +115524,22 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% input: line -| input line { ++*count; ++global_count; } +| input line { } ; line: '\n' -| exp '\n' { *result = global_result = $1; } +| exp '\n' { USE ($1); } ; exp: @@ -114517,85 +115574,59 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" - +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); - +int yylex (void); +static int get_char (void); +static void unget_char ( int c); -static calc::parser::location_type last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).end.line++; - (*llocp).end.column = 1; - } - else - (*llocp).end.column++; + ; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + ; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -114607,23 +115638,21 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (yylval).ival = read_signed_integer (); return NUM; } @@ -114634,38 +115663,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse (semantic_value *result, int *count) -{ - calc::parser parser (result, count); -#if CALCDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -114678,10 +115680,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -114695,11 +115699,11 @@ main (int argc, const char **argv) } - status = calcparse (&result, &count); + status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -114710,45 +115714,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:645" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:645" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +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:688: \$XSLTPROC \\ +$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:688" +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 @@ -114757,16 +115762,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:688: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:688" +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 | sort @@ -114775,7 +115780,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -114783,102 +115788,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:688: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:688" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:645: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:645" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +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:688: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:688" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:645: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:645" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +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:688: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:688" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:645: \$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:645" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:688: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:688" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:688" +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:688: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:645: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:688" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:645" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -114901,28 +115879,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_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:688" +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:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -114935,28 +115913,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -114987,20 +115965,21 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115010,28 +115989,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115062,20 +116041,21 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115085,28 +116065,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115137,20 +116117,21 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115160,28 +116141,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115212,20 +116193,21 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115236,28 +116218,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115288,48 +116270,49 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +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:688: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115360,20 +116343,21 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115388,7 +116372,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -115400,28 +116384,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_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:688" +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:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115456,20 +116440,21 @@ 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/^[-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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115482,28 +116467,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_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:688" +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:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115535,20 +116520,21 @@ 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/^[-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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115558,28 +116544,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_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:688" +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:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115612,20 +116598,21 @@ 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/^[-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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115638,28 +116625,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:688: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_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:688" +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:688: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:688" +$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:645" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115692,20 +116679,21 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. +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:688: cat stderr" -at_fn_check_prepare_trace "calc.at:688" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:688" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645" $at_failed && at_fn_log_failure $at_traceon; } @@ -115717,13 +116705,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_243 -#AT_START_244 -at_fn_group_banner 244 'calc.at:699' \ - "Calculator %skeleton \"glr.cc\" %defines %locations" "" 14 +#AT_STOP_340 +#AT_START_341 +at_fn_group_banner 341 'calc.at:647' \ + "Calculator %glr-parser api.pure %locations" " " 13 at_xfail=no ( - $as_echo "244. $at_setup_line: testing $at_desc ..." + $as_echo "341. $at_setup_line: testing $at_desc ..." $at_traceon @@ -115745,8 +116733,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%skeleton "glr.cc" %defines %locations -%define global_tokens_and_yystype +%glr-parser %define api.pure %locations + %code requires { @@ -115759,7 +116747,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -115779,8 +116767,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (YYLTYPE const * const llocp, const char *msg); +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } @@ -115790,11 +116787,11 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -115840,37 +116837,56 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -#include "calc.hh" +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif +/* A C error reporting function. */ +static +void yyerror (YYLTYPE const * const llocp, const char *msg) +{ + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} #include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); +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 yy::parser::location_type last_yylloc; +static YYLTYPE last_yylloc; static int -get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; @@ -115878,28 +116894,28 @@ get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) last_yylloc = (*llocp); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (*llocp).last_line++; + (*llocp).last_column = 1; } else - (*llocp).end.column++; + (*llocp).last_column++; return res; } static void -unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; @@ -115930,14 +116946,14 @@ read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (*llocp).first_column = (*llocp).last_column; + (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); @@ -115957,38 +116973,11 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ yyparse that simulates the C signature. */ -int -yyparse () -{ - yy::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -116001,10 +116990,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -116021,8 +117012,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -116033,45 +117024,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:699: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:699" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:647: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:647" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:699" +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:699: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:699" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:647: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:647" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:699" +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:699: \$XSLTPROC \\ +$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:699" +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 @@ -116080,16 +117072,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:699: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:699" +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 | sort @@ -116098,7 +117090,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116106,102 +117098,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:699: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:699" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:647: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:647" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:699" +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:699: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:699" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:647: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:647" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:699" +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:699: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:699" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:647: \$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:647" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:699" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:699: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:699" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:699" +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:699: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:647: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:699" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:647" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116224,28 +117189,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_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:699" +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:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116258,28 +117223,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116311,20 +117276,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116334,28 +117299,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116387,20 +117352,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116410,28 +117375,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116463,20 +117428,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116486,28 +117451,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116539,20 +117504,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116563,28 +117528,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116616,48 +117581,48 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +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:699: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116689,20 +117654,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116717,7 +117682,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -116729,28 +117694,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_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:699" +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:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116786,20 +117751,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116812,28 +117777,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_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:699" +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:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116866,20 +117831,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116889,28 +117854,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_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:699" +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:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116944,20 +117909,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -116970,28 +117935,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:699: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_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:699" +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:699: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:699" +$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:647" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -117025,20 +117990,20 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 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:699: cat stderr" -at_fn_check_prepare_trace "calc.at:699" +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:699" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647" $at_failed && at_fn_log_failure $at_traceon; } @@ -117050,13 +118015,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_244 -#AT_START_245 -at_fn_group_banner 245 'calc.at:708' \ - "Calculator %language \"C++\" %glr-parser %defines %locations " "" 14 +#AT_STOP_341 +#AT_START_342 +at_fn_group_banner 342 'calc.at:648' \ + "Calculator %glr-parser parse.error=verbose %locations" "" 13 at_xfail=no ( - $as_echo "245. $at_setup_line: testing $at_desc ..." + $as_echo "342. $at_setup_line: testing $at_desc ..." $at_traceon @@ -117078,8 +118043,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %glr-parser %defines %locations -%define global_tokens_and_yystype +%glr-parser %define parse.error verbose %locations + %code requires { @@ -117092,7 +118057,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -117112,8 +118077,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); +int yylex (void); } @@ -117123,11 +118097,11 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -117173,85 +118147,104 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -#include "calc.hh" +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} #include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); +int yylex (void); +static int get_char (void); +static void unget_char ( int c); -static yy::parser::location_type last_yylloc; +static YYLTYPE last_yylloc; static int -get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; + ; - last_yylloc = (*llocp); + last_yylloc = (yylloc); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (yylloc).last_line++; + (yylloc).last_column = 1; } else - (*llocp).end.column++; + (yylloc).last_column++; return res; } static void -unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; + ; - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + /* Wrong when C == '\n'. */ + (yylloc) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -117263,23 +118256,23 @@ read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (yylloc).first_column = (yylloc).last_column; + (yylloc).first_line = (yylloc).last_line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (yylval).ival = read_signed_integer (); return NUM; } @@ -117290,37 +118283,10 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - +#include -/* A C++ yyparse that simulates the C signature. */ -int -yyparse () -{ - yy::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} semantic_value global_result = 0; @@ -117334,10 +118300,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -117354,8 +118322,8 @@ main (int argc, const char **argv) status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -117366,45 +118334,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:708: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:708" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:648" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:708" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:648" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:708: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:708" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:648" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -117413,16 +118382,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:708: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:708" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:648" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -117431,7 +118400,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117439,102 +118408,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:708: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:708" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:648: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:648" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:708: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:708" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:648: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:648" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:708" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:648: \$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:648" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:708" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:708: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:708" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:648: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:708" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:648" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117557,28 +118499,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117591,28 +118533,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117644,20 +118586,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117667,28 +118608,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117720,20 +118661,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117743,28 +118683,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117796,20 +118736,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117819,28 +118758,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117872,20 +118811,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117896,28 +118834,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -117949,48 +118887,47 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $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:708: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118022,20 +118959,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118050,7 +118986,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -118062,28 +118998,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118119,20 +119055,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118145,28 +119080,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118199,20 +119134,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118222,28 +119156,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118277,20 +119211,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118303,28 +119236,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:708: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:708: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118358,20 +119291,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:708: cat stderr" -at_fn_check_prepare_trace "calc.at:708" +$as_echo "$at_srcdir/calc.at:648: cat stderr" +at_fn_check_prepare_trace "calc.at:648" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:708" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648" $at_failed && at_fn_log_failure $at_traceon; } @@ -118383,13 +119315,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_245 -#AT_START_246 -at_fn_group_banner 246 'calc.at:709' \ - "Calculator %language \"C++\" %glr-parser %defines %locations %define api.location.type Span" "" 14 +#AT_STOP_342 +#AT_START_343 +at_fn_group_banner 343 'calc.at:650' \ + "Calculator %glr-parser parse.error=verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 13 at_xfail=no ( - $as_echo "246. $at_setup_line: testing $at_desc ..." + $as_echo "343. $at_setup_line: testing $at_desc ..." $at_traceon @@ -118411,38 +119343,11 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %glr-parser %defines %locations %define api.location.type Span -%define global_tokens_and_yystype +%glr-parser %define parse.error verbose %locations %defines %name-prefix "calc" %verbose %yacc + %code requires { -# include - struct Point - { - int l; - int c; - }; - - struct Span - { - Point first; - Point last; - }; - -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first = YYRHSLOC (Rhs, 1).first; \ - (Current).last = YYRHSLOC (Rhs, N).last; \ - } \ - else \ - { \ - (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \ - } \ - while (false) - - /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } @@ -118452,7 +119357,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -118472,27 +119377,31 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (const char *msg); +int calclex (void); } -%initial-action -{ - @$.first.l = @$.first.c = 1; - @$.last = @$.first; -} /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -118538,96 +119447,117 @@ power (int base, int exponent) } - std::ostream& - operator<< (std::ostream& o, const Span& s) - { - o << s.first.l << '.' << s.first.c; - if (s.first.l != s.last.l) - o << '-' << s.last.l << '.' << s.last.c - 1; - else if (s.first.c != s.last.c - 1) - o << '-' << s.last.c - 1; - return o; - } -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - (void) l; - std::cerr << l << ": " << m << std::endl; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void calcerror (const char *msg) +{ + LOCATION_PRINT (stderr, (calclloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); } _ATEOF -cat >calc-lex.cc <<'_ATEOF' +cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); +int calclex (void); +static int get_char (void); +static void unget_char ( int c); -static yy::parser::location_type last_yylloc; +static YYLTYPE last_yylloc; static int -get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; + ; - last_yylloc = (*llocp); + last_yylloc = (calclloc); if (res == '\n') { - (*llocp).last.l++; - (*llocp).last.c = 1; + (calclloc).last_line++; + (calclloc).last_column = 1; } else - (*llocp).last.c++; + (calclloc).last_column++; return res; } static void -unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; + ; - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + /* Wrong when C == '\n'. */ + (calclloc) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -118639,23 +119569,23 @@ read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +int calclex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).first.c = (*llocp).last.c; - (*llocp).first.l = (*llocp).last.l; + (calclloc).first_column = (calclloc).last_column; + (calclloc).first_line = (calclloc).last_line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (calclval).ival = read_signed_integer (); return NUM; } @@ -118669,34 +119599,18 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) _ATEOF -cat >calc-main.cc <<'_ATEOF' +cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - +#include -/* A C++ yyparse that simulates the C signature. */ -int -yyparse () -{ - yy::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} semantic_value global_result = 0; @@ -118710,10 +119624,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -118727,11 +119643,11 @@ main (int argc, const char **argv) } - status = yyparse (); + status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -118748,39 +119664,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:709: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:709" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:650: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:650" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:709" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:650: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:650" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:709: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:650: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:709" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:650" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -118789,16 +119705,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:709: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:650: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:709" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:650" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -118807,7 +119723,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -118815,102 +119731,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:709: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:709" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:650: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:650" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:709: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:709" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:650: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:650" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:709" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:650: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:650" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:709: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:650: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:709" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:650" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:709" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:709: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:709" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -118933,28 +119822,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -118967,28 +119856,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119020,20 +119909,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119043,28 +119931,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119096,20 +119984,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119119,28 +120006,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119172,20 +120059,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119195,28 +120081,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119248,20 +120134,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119272,28 +120157,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119325,48 +120210,47 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $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:709: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119398,20 +120282,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119426,7 +120309,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -119438,28 +120321,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119495,20 +120378,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119521,28 +120403,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119575,20 +120457,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119598,28 +120479,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119653,20 +120534,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119679,28 +120559,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:709: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119734,20 +120614,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:709: cat stderr" -at_fn_check_prepare_trace "calc.at:709" +$as_echo "$at_srcdir/calc.at:650: cat stderr" +at_fn_check_prepare_trace "calc.at:650" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:709" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650" $at_failed && at_fn_log_failure $at_traceon; } @@ -119759,13 +120638,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_246 -#AT_START_247 -at_fn_group_banner 247 'calc.at:710' \ - "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc" "" 14 +#AT_STOP_343 +#AT_START_344 +at_fn_group_banner 344 'calc.at:652' \ + "Calculator %glr-parser %debug" " " 13 at_xfail=no ( - $as_echo "247. $at_setup_line: testing $at_desc ..." + $as_echo "344. $at_setup_line: testing $at_desc ..." $at_traceon @@ -119787,8 +120666,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %glr-parser %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc -%define global_tokens_and_yystype +%glr-parser %debug + %code requires { @@ -119801,7 +120680,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -119821,8 +120700,10 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void yyerror (const char *msg); +int yylex (void); } @@ -119832,11 +120713,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -119882,85 +120763,59 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -_ATEOF - - - -cat >calc-lex.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -#include "calc.hh" +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); - +int yylex (void); +static int get_char (void); +static void unget_char ( int c); -static calc::parser::location_type last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).end.line++; - (*llocp).end.column = 1; - } - else - (*llocp).end.column++; + ; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + ; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -119972,23 +120827,21 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int yylex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (yylval).ival = read_signed_integer (); return NUM; } @@ -119999,38 +120852,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll /* Return single chars. */ return c; } -_ATEOF - - -cat >calc-main.cc <<'_ATEOF' -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc - -#include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse () -{ - calc::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -120043,10 +120869,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -120059,12 +120887,12 @@ main (int argc, const char **argv) return 3; } - - status = calcparse (); + yydebug = 1; + status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -120075,45 +120903,46 @@ _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:710" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:652: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:652" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:710" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:652: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:652" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:710: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:652: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:710" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:652" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -120122,16 +120951,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:710: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:652: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:710" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:652" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -120140,7 +120969,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120148,102 +120977,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:710: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:710" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:652: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:652" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:710: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:710" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:652: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:652" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:710" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:652: \$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:652" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:710: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:652: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:710" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:710" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:710: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:710" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:652" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120266,28 +121068,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120300,28 +121102,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120352,20 +121154,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120375,28 +121179,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120427,20 +121231,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120450,28 +121256,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120502,20 +121308,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120525,28 +121333,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120577,20 +121385,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120601,28 +121411,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120653,48 +121463,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $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:710: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120725,20 +121537,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120753,7 +121567,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -120765,28 +121579,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120821,20 +121635,22 @@ 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/^[-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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120847,28 +121663,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120900,20 +121716,22 @@ 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/^[-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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120923,28 +121741,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -120977,20 +121795,22 @@ 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/^[-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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -121003,28 +121823,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:710: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:710: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -121057,20 +121877,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:710: cat stderr" -at_fn_check_prepare_trace "calc.at:710" +$as_echo "$at_srcdir/calc.at:652: cat stderr" +at_fn_check_prepare_trace "calc.at:652" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:710" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652" $at_failed && at_fn_log_failure $at_traceon; } @@ -121082,13 +121904,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_247 -#AT_START_248 -at_fn_group_banner 248 'calc.at:711' \ - "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %define api.prefix \"calc\" %verbose %yacc" "" 14 +#AT_STOP_344 +#AT_START_345 +at_fn_group_banner 345 'calc.at:653' \ + "Calculator %glr-parser parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 13 at_xfail=no ( - $as_echo "248. $at_setup_line: testing $at_desc ..." + $as_echo "345. $at_setup_line: testing $at_desc ..." $at_traceon @@ -121110,8 +121932,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %glr-parser %defines %locations %error-verbose %define api.prefix "calc" %verbose %yacc -%define global_tokens_and_yystype +%glr-parser %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc + %code requires { @@ -121124,7 +121946,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -121144,8 +121966,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (const char *msg); +int calclex (void); } @@ -121155,11 +121986,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -121205,85 +122036,117 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) { - (void) l; - std::cerr << l << ": " << m << std::endl; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void calcerror (const char *msg) +{ + LOCATION_PRINT (stderr, (calclloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); } _ATEOF -cat >calc-lex.cc <<'_ATEOF' +cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); +int calclex (void); +static int get_char (void); +static void unget_char ( int c); -static calc::parser::location_type last_yylloc; +static YYLTYPE last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; + ; - last_yylloc = (*llocp); + last_yylloc = (calclloc); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (calclloc).last_line++; + (calclloc).last_column = 1; } else - (*llocp).end.column++; + (calclloc).last_column++; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; + ; - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + /* Wrong when C == '\n'. */ + (calclloc) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -121295,23 +122158,23 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int calclex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (calclloc).first_column = (calclloc).last_column; + (calclloc).first_line = (calclloc).last_line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char ( c); + (calclval).ival = read_signed_integer (); return NUM; } @@ -121325,35 +122188,19 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll _ATEOF -cat >calc-main.cc <<'_ATEOF' +cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse () -{ - calc::parser parser; -#if CALCDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -121366,10 +122213,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -121382,12 +122231,12 @@ main (int argc, const char **argv) return 3; } - + calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -121404,39 +122253,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:711" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:653" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:711" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:653" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:711: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:711" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:653" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -121445,16 +122294,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:711: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:711" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:653" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -121463,7 +122312,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121471,102 +122320,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:711: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:711" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:653: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:653" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:711: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:711" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:653: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:653" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:711" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:653: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:653" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:711" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:711: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:711" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:653: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:711" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:653" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121589,28 +122411,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121623,28 +122445,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121676,19 +122498,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121698,28 +122520,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121751,19 +122573,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121773,28 +122595,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121826,19 +122648,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121848,28 +122670,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121901,19 +122723,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121924,28 +122746,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -121977,47 +122799,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $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:711: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122049,19 +122871,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122076,7 +122898,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -122088,28 +122910,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122145,19 +122967,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122170,28 +122992,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122224,19 +123046,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122246,28 +123068,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122301,19 +123123,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122326,28 +123148,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:711: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:711: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122381,19 +123203,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:711: cat stderr" -at_fn_check_prepare_trace "calc.at:711" +$as_echo "$at_srcdir/calc.at:653: cat stderr" +at_fn_check_prepare_trace "calc.at:653" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:711" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653" $at_failed && at_fn_log_failure $at_traceon; } @@ -122405,13 +123227,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_248 -#AT_START_249 -at_fn_group_banner 249 'calc.at:713' \ - "Calculator %language \"C++\" %glr-parser %defines %locations %debug" "" 14 +#AT_STOP_345 +#AT_START_346 +at_fn_group_banner 346 'calc.at:654' \ + "Calculator %glr-parser parse.error=verbose %debug %locations %defines api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc" "" 13 at_xfail=no ( - $as_echo "249. $at_setup_line: testing $at_desc ..." + $as_echo "346. $at_setup_line: testing $at_desc ..." $at_traceon @@ -122433,8 +123255,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %glr-parser %defines %locations %debug -%define global_tokens_and_yystype +%glr-parser %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %define api.token.prefix {TOK_} %verbose %yacc + %code requires { @@ -122447,7 +123269,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -122467,8 +123289,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (const char *msg); +int calclex (void); } @@ -122478,11 +123309,11 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -122528,85 +123359,117 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) + + +# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, CALCLTYPE const * const yylocp) { - (void) l; - std::cerr << l << ": " << m << std::endl; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void calcerror (const char *msg) +{ + LOCATION_PRINT (stderr, (calclloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); } _ATEOF -cat >calc-lex.cc <<'_ATEOF' +cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); +int calclex (void); +static int get_char (void); +static void unget_char ( int c); -static yy::parser::location_type last_yylloc; +static CALCLTYPE last_yylloc; static int -get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +get_char (void) { int res = getc (input); - (void) lvalp;(void) llocp; + ; - last_yylloc = (*llocp); + last_yylloc = (calclloc); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (calclloc).last_line++; + (calclloc).last_column = 1; } else - (*llocp).end.column++; + (calclloc).last_column++; return res; } static void -unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +unget_char ( int c) { - (void) lvalp;(void) llocp; + ; - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + /* Wrong when C == '\n'. */ + (calclloc) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +read_signed_integer (void) { - int c = get_char (lvalp, llocp); + int c = get_char (); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + ; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (); } - unget_char (lvalp, llocp, c); + unget_char ( c); return sign * n; } @@ -122618,29 +123481,29 @@ read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +int calclex (void) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (calclloc).first_column = (calclloc).last_column; + (calclloc).first_line = (calclloc).last_line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char ()) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); - return NUM; + unget_char ( c); + (calclval).ival = read_signed_integer (); + return TOK_NUM; } /* Return end-of-file. */ if (c == EOF) - return CALC_EOF; + return TOK_CALC_EOF; /* Return single chars. */ return c; @@ -122648,35 +123511,19 @@ int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) _ATEOF -cat >calc-main.cc <<'_ATEOF' +cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ yyparse that simulates the C signature. */ -int -yyparse () -{ - yy::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -122689,10 +123536,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -122705,12 +123554,12 @@ main (int argc, const char **argv) return 3; } - - status = yyparse (); + calcdebug = 1; + status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -122727,39 +123576,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:713" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:654" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:713" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:654" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:713: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:713" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:654" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -122768,16 +123617,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:713: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:713" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:654" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -122786,7 +123635,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -122794,102 +123643,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:713: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:713" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:654: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:654" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:713: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:713" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:654: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:654" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:713" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:654: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:654" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:713" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:713: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:654: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -122912,28 +123734,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -122946,28 +123768,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -122999,20 +123821,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123022,28 +123843,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123075,20 +123896,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123098,28 +123918,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123151,20 +123971,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123174,28 +123993,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123227,20 +124046,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123251,28 +124069,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123304,48 +124122,47 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $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:713: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123377,20 +124194,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123405,7 +124221,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -123417,28 +124233,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123474,20 +124290,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123500,28 +124315,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123554,20 +124369,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123577,28 +124391,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123632,20 +124446,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123658,28 +124471,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123713,20 +124526,19 @@ _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 +# 4. If error-verbose is not used, strip the', unexpected....' part. + # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:713: cat stderr" -at_fn_check_prepare_trace "calc.at:713" +$as_echo "$at_srcdir/calc.at:654: cat stderr" +at_fn_check_prepare_trace "calc.at:654" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654" $at_failed && at_fn_log_failure $at_traceon; } @@ -123738,13 +124550,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_249 -#AT_START_250 -at_fn_group_banner 250 'calc.at:714' \ - "Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14 +#AT_STOP_346 +#AT_START_347 +at_fn_group_banner 347 'calc.at:656' \ + "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 13 at_xfail=no ( - $as_echo "250. $at_setup_line: testing $at_desc ..." + $as_echo "347. $at_setup_line: testing $at_desc ..." $at_traceon @@ -123766,8 +124578,8 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %glr-parser %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc -%define global_tokens_and_yystype +%glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc + %code requires { @@ -123780,7 +124592,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -123800,8 +124612,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (YYLTYPE const * const llocp, const char *msg); +int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } @@ -123811,11 +124632,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -123861,37 +124682,69 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void calcerror (YYLTYPE const * const llocp, const char *msg) { - (void) l; - std::cerr << l << ": " << m << std::endl; + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); } _ATEOF -cat >calc-lex.cc <<'_ATEOF' +cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); +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 calc::parser::location_type last_yylloc; +static YYLTYPE last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; @@ -123899,28 +124752,28 @@ get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp last_yylloc = (*llocp); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (*llocp).last_line++; + (*llocp).last_column = 1; } else - (*llocp).end.column++; + (*llocp).last_column++; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; @@ -123951,14 +124804,14 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int calclex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (*llocp).first_column = (*llocp).last_column; + (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); @@ -123981,34 +124834,18 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll _ATEOF -cat >calc-main.cc <<'_ATEOF' +cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif - +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse () -{ - calc::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} semantic_value global_result = 0; @@ -124022,10 +124859,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -124038,12 +124877,12 @@ main (int argc, const char **argv) return 3; } - + calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -124060,39 +124899,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:714" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:656: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:656" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:714" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:656: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:656" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:656: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:714" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:656" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -124101,16 +124940,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:656: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:714" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:656" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -124119,7 +124958,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124127,102 +124966,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:714: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:714" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:656: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:656" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:714: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:714" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:656: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:656" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:714" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:656: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:656" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/calc.at:714: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:656: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:656" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:714" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:714: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124245,28 +125057,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124279,28 +125091,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124332,19 +125144,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124354,28 +125166,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124407,19 +125219,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124429,28 +125241,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124482,19 +125294,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124504,28 +125316,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124557,19 +125369,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124580,28 +125392,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124633,47 +125445,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $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:714: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124705,19 +125517,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124732,7 +125544,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -124744,28 +125556,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124801,19 +125613,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124826,28 +125638,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124880,19 +125692,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124902,28 +125714,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124957,19 +125769,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -124982,28 +125794,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -125037,19 +125849,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:714: cat stderr" -at_fn_check_prepare_trace "calc.at:714" +$as_echo "$at_srcdir/calc.at:656: cat stderr" +at_fn_check_prepare_trace "calc.at:656" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656" $at_failed && at_fn_log_failure $at_traceon; } @@ -125061,13 +125873,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_250 -#AT_START_251 -at_fn_group_banner 251 'calc.at:716' \ - "Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14 +#AT_STOP_347 +#AT_START_348 +at_fn_group_banner 348 'calc.at:658' \ + "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13 at_xfail=no ( - $as_echo "251. $at_setup_line: testing $at_desc ..." + $as_echo "348. $at_setup_line: testing $at_desc ..." $at_traceon @@ -125089,8 +125901,8 @@ cat >calc.y <<'_ATEOF' } /* 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 +%glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} + %code requires { @@ -125103,7 +125915,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -125123,8 +125935,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); +int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } @@ -125134,22 +125955,22 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% input: line -| input line { } +| input line { ++*count; ++global_count; } ; line: '\n' -| exp '\n' { USE ($1); } +| exp '\n' { *result = global_result = $1; } ; exp: @@ -125184,37 +126005,71 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { - (void) l; - std::cerr << l << ": " << m << std::endl; + YYUSE(result); + YYUSE(count); + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); } _ATEOF -cat >calc-lex.cc <<'_ATEOF' +cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); +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 calc::parser::location_type last_yylloc; +static YYLTYPE last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (YYSTYPE *lvalp, YYLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; @@ -125222,28 +126077,28 @@ get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp last_yylloc = (*llocp); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (*llocp).last_line++; + (*llocp).last_column = 1; } else - (*llocp).end.column++; + (*llocp).last_column++; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c) { (void) lvalp;(void) llocp; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; @@ -125274,14 +126129,14 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int calclex (YYSTYPE *lvalp, YYLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (*llocp).first_column = (*llocp).last_column; + (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); @@ -125304,35 +126159,19 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll _ATEOF -cat >calc-main.cc <<'_ATEOF' +cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse () -{ - calc::parser parser; -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -125345,10 +126184,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -125361,12 +126202,12 @@ main (int argc, const char **argv) return 3; } - - status = calcparse (); + calcdebug = 1; + status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -125383,39 +126224,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:716" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:658: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:658" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:716" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:658: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:658" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:658: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:716" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:658" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -125424,16 +126265,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:658: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:716" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:658" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -125442,7 +126283,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125450,102 +126291,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:716: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:716" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:658: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:658" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:716: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:716" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:658: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:658" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:716" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:658: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:658" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:716" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:716: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:658: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:658" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125568,28 +126382,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125602,28 +126416,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125655,19 +126469,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125677,28 +126491,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125730,19 +126544,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125752,28 +126566,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125805,19 +126619,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125827,28 +126641,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125880,19 +126694,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125903,28 +126717,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -125956,47 +126770,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $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:716: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126028,19 +126842,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126055,7 +126869,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -126067,28 +126881,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126124,19 +126938,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126149,28 +126963,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126203,19 +127017,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126225,28 +127039,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126280,19 +127094,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126305,28 +127119,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126360,19 +127174,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:716: cat stderr" -at_fn_check_prepare_trace "calc.at:716" +$as_echo "$at_srcdir/calc.at:658: cat stderr" +at_fn_check_prepare_trace "calc.at:658" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658" $at_failed && at_fn_log_failure $at_traceon; } @@ -126384,13 +127198,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_251 -#AT_START_252 -at_fn_group_banner 252 'calc.at:718' \ - "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}" "" 14 +#AT_STOP_348 +#AT_START_349 +at_fn_group_banner 349 'calc.at:659' \ + "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13 at_xfail=no ( - $as_echo "252. $at_setup_line: testing $at_desc ..." + $as_echo "349. $at_setup_line: testing $at_desc ..." $at_traceon @@ -126412,8 +127226,8 @@ cat >calc.y <<'_ATEOF' } /* 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 +%glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} + %code requires { @@ -126426,7 +127240,7 @@ cat >calc.y <<'_ATEOF' { semantic_value ival; }; -%printer { yyoutput << $$; } ; +%printer { fprintf (yyoutput, "%d", $$); } ; %code provides { @@ -126446,8 +127260,17 @@ cat >calc.y <<'_ATEOF' FILE *input; static int power (int base, int exponent); +#include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); +int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } @@ -126457,11 +127280,11 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -126507,37 +127330,71 @@ power (int base, int exponent) } -/* A C++ error reporting function. */ -void -calc::parser::error (const location_type& l, const std::string& m) + + +# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, CALCLTYPE const * const yylocp) { - (void) l; - std::cerr << l << ": " << m << std::endl; + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) +{ + YYUSE(result); + YYUSE(count); + LOCATION_PRINT (stderr, (*llocp)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); } _ATEOF -cat >calc-lex.cc <<'_ATEOF' +cat >calc-lex.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); +int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); +static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp); +static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c); -static calc::parser::location_type last_yylloc; +static CALCLTYPE last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int res = getc (input); (void) lvalp;(void) llocp; @@ -126545,28 +127402,28 @@ get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp last_yylloc = (*llocp); if (res == '\n') { - (*llocp).end.line++; - (*llocp).end.column = 1; + (*llocp).last_line++; + (*llocp).last_column = 1; } else - (*llocp).end.column++; + (*llocp).last_column++; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c) { (void) lvalp;(void) llocp; - /* Wrong when C == `\n'. */ + /* Wrong when C == '\n'. */ (*llocp) = last_yylloc; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int sign = 1; @@ -126597,14 +127454,14 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; + (*llocp).first_column = (*llocp).last_column; + (*llocp).first_line = (*llocp).last_line; } while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); @@ -126627,35 +127484,19 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll _ATEOF -cat >calc-main.cc <<'_ATEOF' +cat >calc-main.c <<'_ATEOF' #include /* We don't need perfect functions for these tests. */ #undef malloc #undef memcmp #undef realloc -#include "calc.hh" +#include "calc.h" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ -int -calcparse (semantic_value *result, int *count) -{ - calc::parser parser (result, count); -#if YYDEBUG - parser.set_debug_level (1); -#endif - return parser.parse (); -} - semantic_value global_result = 0; int global_count = 0; @@ -126668,10 +127509,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -126684,12 +127527,12 @@ main (int argc, const char **argv) return 3; } - + calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -126706,39 +127549,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:718" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:659" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:718" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:659" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:718" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:659" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -126747,16 +127590,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:718" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:659" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -126765,7 +127608,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -126773,102 +127616,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:718: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:718" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:659: bison -fno-caret -o calc.c calc.y" +at_fn_check_prepare_trace "calc.at:659" +( $at_check_trace; bison -fno-caret -o calc.c calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } - -{ set +x -$as_echo "$at_srcdir/calc.at:718: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:718" -( $at_check_trace; $BISON_CXX_WORKS + { set +x +$as_echo "$at_srcdir/calc.at:659: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:659" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:718" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +$as_echo "$at_srcdir/calc.at:659: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:659" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:718" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:718: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:659: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.c calc.h " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -126891,28 +127707,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -126925,28 +127741,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -126978,19 +127794,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127000,28 +127816,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127053,19 +127869,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127075,28 +127891,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127128,19 +127944,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127150,28 +127966,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127203,19 +128019,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127226,28 +128042,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127279,47 +128095,47 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $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:718: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127351,19 +128167,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127378,7 +128194,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -127390,28 +128206,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127447,19 +128263,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127472,28 +128288,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127526,19 +128342,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127548,28 +128364,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127603,19 +128419,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127628,28 +128444,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127683,19 +128499,19 @@ _ATEOF # 3. If locations are not used, remove them. -# 4. If error-verbose is not used, strip the`, unexpected....' part. +# 4. If error-verbose is not used, strip the', unexpected....' part. # 5. Check { set +x -$as_echo "$at_srcdir/calc.at:718: cat stderr" -at_fn_check_prepare_trace "calc.at:718" +$as_echo "$at_srcdir/calc.at:659: cat stderr" +at_fn_check_prepare_trace "calc.at:659" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659" $at_failed && at_fn_log_failure $at_traceon; } @@ -127707,13 +128523,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_252 -#AT_START_253 -at_fn_group_banner 253 'calc.at:719' \ - "Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %define api.prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14 +#AT_STOP_349 +#AT_START_350 +at_fn_group_banner 350 'calc.at:669' \ + "Calculator lalr1.cc %defines" " " 14 at_xfail=no ( - $as_echo "253. $at_setup_line: testing $at_desc ..." + $as_echo "350. $at_setup_line: testing $at_desc ..." $at_traceon @@ -127735,7 +128551,7 @@ cat >calc.y <<'_ATEOF' } /* Infix notation calculator--calc */ -%language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} +%skeleton "lalr1.cc" %defines %define global_tokens_and_yystype %code requires { @@ -127770,7 +128586,7 @@ FILE *input; static int power (int base, int exponent); -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +int yylex (yy::parser::semantic_type *lvalp); } @@ -127780,22 +128596,22 @@ int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *ll %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% input: line -| input line { ++*count; ++global_count; } +| input line { } ; line: '\n' -| exp '\n' { *result = global_result = $1; } +| exp '\n' { USE ($1); } ; exp: @@ -127832,10 +128648,9 @@ power (int base, int exponent) /* A C++ error reporting function. */ void -calc::parser::error (const location_type& l, const std::string& m) +yy::parser::error (const std::string& m) { - (void) l; - std::cerr << l << ": " << m << std::endl; + std::cerr << m << '\n'; } _ATEOF @@ -127852,63 +128667,49 @@ cat >calc-lex.cc <<'_ATEOF' #include -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); -static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); - +int yylex (yy::parser::semantic_type *lvalp); +static int get_char (yy::parser::semantic_type *lvalp); +static void unget_char (yy::parser::semantic_type *lvalp, int c); -static calc::parser::location_type last_yylloc; static int -get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +get_char (yy::parser::semantic_type *lvalp) { int res = getc (input); - (void) lvalp;(void) llocp; - - last_yylloc = (*llocp); - if (res == '\n') - { - (*llocp).end.line++; - (*llocp).end.column = 1; - } - else - (*llocp).end.column++; + (void) lvalp;; return res; } static void -unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +unget_char (yy::parser::semantic_type *lvalp, int c) { - (void) lvalp;(void) llocp; - - /* Wrong when C == `\n'. */ - (*llocp) = last_yylloc; + (void) lvalp;; ungetc (c, input); } static int -read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +read_signed_integer (yy::parser::semantic_type *lvalp) { - int c = get_char (lvalp, llocp); + int c = get_char (lvalp); int sign = 1; int n = 0; - (void) lvalp;(void) llocp; + (void) lvalp;; if (c == '-') { - c = get_char (lvalp, llocp); + c = get_char (lvalp); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); - c = get_char (lvalp, llocp); + c = get_char (lvalp); } - unget_char (lvalp, llocp, c); + unget_char (lvalp, c); return sign * n; } @@ -127920,23 +128721,21 @@ read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_ | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ -int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +int yylex (yy::parser::semantic_type *lvalp) { int c; /* Skip current token, then white spaces. */ do { - (*llocp).begin.column = (*llocp).end.column; - (*llocp).begin.line = (*llocp).end.line; } - while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* process numbers */ if (c == '.' || isdigit (c)) { - unget_char (lvalp, llocp, c); - (*lvalp).ival = read_signed_integer (lvalp, llocp); + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); return NUM; } @@ -127960,20 +128759,15 @@ cat >calc-main.cc <<'_ATEOF' #include "calc.hh" #include -#if HAVE_UNISTD_H -# include -#else -# undef alarm -# define alarm(seconds) /* empty */ -#endif +#include -/* A C++ calcparse that simulates the C signature. */ +/* A C++ yyparse that simulates the C signature. */ int -calcparse (semantic_value *result, int *count) +yyparse () { - calc::parser parser (result, count); -#if CALCDEBUG + yy::parser parser; +#if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); @@ -127991,10 +128785,12 @@ main (int argc, const char **argv) 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); + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); if (argc == 2) input = fopen (argv[1], "r"); @@ -128008,11 +128804,11 @@ main (int argc, const char **argv) } - status = calcparse (&result, &count); + status = yyparse (); if (fclose (input)) perror ("fclose"); - assert (global_result == result); - assert (global_count == count); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF @@ -128029,39 +128825,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:719" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:669: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:669" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:719" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:669: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:669" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/calc.at:719: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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' "calc.at:719" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 @@ -128070,16 +128866,16 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/calc.at:719: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:719" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 | sort @@ -128088,7 +128884,7 @@ at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128096,102 +128892,76 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/calc.at:719: bison -o calc.cc calc.y" -at_fn_check_prepare_trace "calc.at:719" -( $at_check_trace; bison -o calc.cc calc.y +$as_echo "$at_srcdir/calc.at:669: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:669" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:669" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:669" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:719" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/calc.at:719: \$PERL -ne ' - chomp; - print \"\$.: {\$_}\\n\" - if (# No starting/ending empty lines. - (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.cc -" -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:719" -( $at_check_trace; $PERL -ne ' - chomp; - print "$.: {$_}\n" - if (# No starting/ending empty lines. - (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.cc - -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: \$PERL -ne ' +$as_echo "$at_srcdir/calc.at:669: \$PERL -ne ' chomp; - print \"\$.: {\$_}\\n\" + print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ - # No trailing space. FIXME: not ready for \"maint\". - # || /\\s\$/ - )' calc.hh + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc calc.hh " -at_fn_check_prepare_notrace 'an embedded newline' "calc.at:719" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:669" ( $at_check_trace; $PERL -ne ' chomp; - print "$.: {$_}\n" + print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ - # No trailing space. FIXME: not ready for "maint". - # || /\s$/ - )' calc.hh + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128214,28 +128984,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128248,28 +129018,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128300,20 +129070,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128323,28 +129095,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128375,20 +129147,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128398,28 +129172,28 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128450,20 +129224,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128473,28 +129249,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128525,20 +129301,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128549,28 +129327,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128601,48 +129379,50 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $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:719: \$PREPARSER ./calc /dev/null" -at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128673,20 +129453,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128701,7 +129483,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -128713,28 +129495,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128769,20 +129551,22 @@ 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/^[-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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128795,28 +129579,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128848,20 +129632,22 @@ 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/^[-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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128871,28 +129657,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128925,20 +129711,22 @@ 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/^[-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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -128951,28 +129739,28 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/calc.at:719: \$PREPARSER ./calc input" -at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/calc.at:719: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -129005,20 +129793,22 @@ cat >expout <<'_ATEOF' _ATEOF # 3. If locations are not used, remove them. - -# 4. If error-verbose is not used, strip the`, unexpected....' part. - +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:719: cat stderr" -at_fn_check_prepare_trace "calc.at:719" +$as_echo "$at_srcdir/calc.at:669: cat stderr" +at_fn_check_prepare_trace "calc.at:669" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/calc.at:719" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669" $at_failed && at_fn_log_failure $at_traceon; } @@ -129030,28 +129820,25 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_253 -#AT_START_254 -at_fn_group_banner 254 'torture.at:137' \ - "Big triangle" " " 15 +#AT_STOP_350 +#AT_START_351 +at_fn_group_banner 351 'calc.at:678' \ + "Calculator C++ " " " 14 at_xfail=no ( - $as_echo "254. $at_setup_line: testing $at_desc ..." + $as_echo "351. $at_setup_line: testing $at_desc ..." $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 <calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -129060,537 +129847,251 @@ print < -#include -#include -#define MAX $max -static int yylex (void); -static void yyerror ( const char *msg); -%} -%union +/* Infix notation calculator--calc */ +%language "C++" +%define global_tokens_and_yystype +%code requires { - int val; -}; - -%token END "end" -%type exp input -EOF - -for my $size (1 .. $max) - { - print "%token t$size $size \"$size\"\n"; - }; - -print < -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; } -static int -yylex (void) + +/* Exercise %union. */ +%union { - static int inner = 1; - static int outer = 0; - if (outer > MAX) - return 0; - else if (inner > outer) - { - inner = 1; - ++outer; - return END; - } - return inner++; -} -int -main (void) + semantic_value ival; +}; +%printer { yyoutput << $$; } ; + +%code provides { - yydebug = !!getenv ("YYDEBUG"); - return yyparse (); + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; } -EOF -_ATEOF - - - -{ set +x -$as_echo "$at_srcdir/torture.at:143: \$PERL -w ./gengram.pl 200 || exit 77" -at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 200 || exit 77" "torture.at:143" -( $at_check_trace; $PERL -w ./gengram.pl 200 || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:143" -$at_failed && at_fn_log_failure -$at_traceon; } - -mv stdout input.y - -{ set +x -$as_echo "$at_srcdir/torture.at:144: bison -v -o input.c input.y" -at_fn_check_prepare_trace "torture.at:144" -( $at_check_trace; bison -v -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:144" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/torture.at:145: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:145" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:145" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/torture.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" "torture.at:145" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:145" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/torture.at:146: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:146" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -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:146: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:146" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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; } +%code +{ +#include +#include +#define USE(Var) +FILE *input; +static int power (int base, int exponent); - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_254 -#AT_START_255 -at_fn_group_banner 255 'torture.at:227' \ - "Big horizontal" " " 15 -at_xfail=no -( - $as_echo "255. $at_setup_line: testing $at_desc ..." - $at_traceon +int yylex (yy::parser::semantic_type *lvalp); +} -# 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 +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp -use strict; -my $max = $ARGV[0] || 10; +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ -print < -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} +/* Grammar follows */ +%% +input: + line +| input line { } +; -%error-verbose -%debug -%{ -#include -#include -#define MAX $max -static int yylex (void); -static void yyerror ( const char *msg); -%} +line: + '\n' +| exp '\n' { USE ($1); } +; -%token -EOF -for my $size (1 .. $max) +exp: + NUM { $$ = $1; } +| exp '=' exp { - print " t$size $size \"$size\"\n"; - }; - -print < -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} static int -yylex (void) +power (int base, int exponent) { - static int counter = 1; - if (counter <= MAX) - return counter++; - assert (counter++ == MAX + 1); - return 0; + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; } -int -main (void) + +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - yydebug = !!getenv ("YYDEBUG"); - return yyparse (); + std::cerr << m << '\n'; } -EOF -_ATEOF - +#include -{ set +x -$as_echo "$at_srcdir/torture.at:241: \$PERL -w ./gengram.pl 1000 || exit 77" -at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:241" -( $at_check_trace; $PERL -w ./gengram.pl 1000 || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:241" -$at_failed && at_fn_log_failure -$at_traceon; } +int yylex (yy::parser::semantic_type *lvalp); +static int get_char (yy::parser::semantic_type *lvalp); +static void unget_char (yy::parser::semantic_type *lvalp, int c); -mv stdout input.y +static int +get_char (yy::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + return res; +} -# 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:245: ulimit -S -d 204000 || exit 77" -at_fn_check_prepare_trace "torture.at:245" -( $at_check_trace; ulimit -S -d 204000 || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:245" -$at_failed && at_fn_log_failure -$at_traceon; } +static void +unget_char (yy::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; - ulimit -S -d 204000 - fi -esac + ungetc (c, input); +} -{ set +x -$as_echo "$at_srcdir/torture.at:247: bison -v -o input.c input.y" -at_fn_check_prepare_trace "torture.at:247" -( $at_check_trace; bison -v -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:247" -$at_failed && at_fn_log_failure -$at_traceon; } +static int +read_signed_integer (yy::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } -{ set +x -$as_echo "$at_srcdir/torture.at:248: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:248" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:248" -$at_failed && at_fn_log_failure -$at_traceon; } + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } -{ set +x -$as_echo "$at_srcdir/torture.at:248: \$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:248" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:248" -$at_failed && at_fn_log_failure -$at_traceon; } + unget_char (lvalp, c); -{ set +x -$as_echo "$at_srcdir/torture.at:249: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:249" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:249" -$at_failed && at_fn_log_failure -$at_traceon; } + return sign * n; +} -{ set +x -$as_echo "$at_srcdir/torture.at:249: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:249" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:249" -$at_failed && at_fn_log_failure -$at_traceon; } +/*---------------------------------------------------------------. +| 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 (yy::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_255 -#AT_START_256 -at_fn_group_banner 256 'torture.at:364' \ - "Many lookahead tokens" " " 15 -at_xfail=no -( - $as_echo "256. $at_setup_line: testing $at_desc ..." - $at_traceon + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return NUM; + } + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; -cat >gengram.pl <<'_ATEOF' -#! /usr/bin/perl -w + /* Return single chars. */ + return c; +} -use strict; -use Text::Wrap; -my $max = $ARGV[0] || 10; +#include +#include -print < -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -# include -# include -# include -# define MAX $max -static int yylex (void); -static void yyerror ( const char *msg); -%} -%union +/* A C++ yyparse that simulates the C signature. */ +int +yyparse () { - int val; -}; - -%type input exp -%token token -EOF + yy::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} -print - wrap ("%type ", - " ", - map { "n$_" } (1 .. $max)), - "\n"; -print "%token\n"; -for my $count (1 .. $max) - { - print " t$count $count \"$count\"\n"; - }; +semantic_value global_result = 0; +int global_count = 0; -print < -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -static int -yylex (void) -{ - static int return_token = 1; - static int counter = 1; - if (counter > MAX) - { - assert (counter++ == MAX + 1); - return 0; - } - if (return_token) + if (!input) { - return_token = 0; - return token; + perror (argv[1]); + return 3; } - return_token = 1; - return counter++; -} -int -main (void) -{ - yydebug = !!getenv ("YYDEBUG"); - return yyparse (); + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; } -EOF _ATEOF -{ set +x -$as_echo "$at_srcdir/torture.at:366: \$PERL -w ./gengram.pl 1000 || exit 77" -at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:366" -( $at_check_trace; $PERL -w ./gengram.pl 1000 || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:366" -$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:370: ulimit -S -d 204000 || exit 77" -at_fn_check_prepare_trace "torture.at:370" -( $at_check_trace; ulimit -S -d 204000 || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:370" -$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 at_save_special_files @@ -129598,39 +130099,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:372: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:372" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -v -o input.c input.y +$as_echo "$at_srcdir/calc.at:678: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:678" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:372" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:372: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "torture.at:372" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y +$as_echo "$at_srcdir/calc.at:678: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:678" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:372" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/torture.at:372: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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' "torture.at:372" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 @@ -129639,16 +130140,16 @@ at_status=$? at_failed=false $at_check_filter 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:372" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/torture.at:372: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:372" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 | sort @@ -129657,7 +130158,7 @@ at_status=$? at_failed=false $at_check_filter 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:372" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } @@ -129665,663 +130166,923 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/torture.at:372: bison -v -o input.c input.y" -at_fn_check_prepare_trace "torture.at:372" -( $at_check_trace; bison -v -o input.c input.y +$as_echo "$at_srcdir/calc.at:678: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:372" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/torture.at:373: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:373" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:678: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:678" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:373" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:373: \$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:373" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:678: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:678" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:373" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:374: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:374" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:374" -$at_failed && at_fn_log_failure -$at_traceon; } +$as_echo "$at_srcdir/calc.at:678: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:678" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc -{ set +x -$as_echo "$at_srcdir/torture.at:374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:374" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:374" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } +# Test the priorities. +cat >input <<'_ATEOF' +1 + 2 * 3 = 7 +1 + 2 * -3 = -5 - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_256 -#AT_START_257 -at_fn_group_banner 257 'torture.at:466' \ - "Exploding the Stack Size with Alloca" " " 15 -at_xfail=no -( - $as_echo "257. $at_setup_line: testing $at_desc ..." - $at_traceon - - +-1^2 = -1 +(-1)^2 = 1 +---1 = -1 +1 - 2 - 3 = -4 +1 - (2 - 3) = 2 -# A grammar of parens growing the stack thanks to right recursion. -# exp: -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} +2^2^3 = 256 +(2^2)^3 = 64 +_ATEOF -%{ -#include -#include -#include -#include +{ set +x +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:678" +$at_failed && at_fn_log_failure +$at_traceon; } -#if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \ - || defined _AIX || defined _MSC_VER || defined _ALLOCA_H) -# define YYSTACK_USE_ALLOCA 1 -#endif +{ set +x +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:678" +$at_failed && at_fn_log_failure +$at_traceon; } - static int yylex (void); - static void yyerror ( const char *msg); -%} -%error-verbose -%debug -%token WAIT_FOR_EOF -%% -exp: WAIT_FOR_EOF exp | ; -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static int -yylex (void) -{ - assert (0 <= yylval); - if (yylval--) - return WAIT_FOR_EOF; - else - return EOF; -} -/* Return argv[1] as an int. */ -static int -get_args (int argc, const char **argv) -{ - int res; - char *endp; - assert (argc == 2); - res = strtol (argv[1], &endp, 10); - assert (argv[1] != endp); - assert (0 <= res); - assert (res <= INT_MAX); - assert (errno != ERANGE); - return res; -} -int -main (int argc, const char **argv) -{ - YYSTYPE yylval_init = get_args (argc, argv); - int status = 0; - int count; - yydebug = 1; - for (count = 0; count < 2; ++count) - { - int new_status; - yylval = yylval_init; - new_status = yyparse (); - if (count == 0) - status = new_status; - else - assert (new_status == status); - } - return status; -} +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 _ATEOF - - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:475: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:475" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +{ set +x +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:475" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/torture.at:475: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:475" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +{ set +x +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:475" +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:678" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/torture.at:475: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:475" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:475" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/torture.at:475: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:475" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:475" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/torture.at:475: bison -o input.c input.y" -at_fn_check_prepare_trace "torture.at:475" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/torture.at:475: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:475" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:475" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } + +cat >input <<'_ATEOF' +error +_ATEOF + { set +x -$as_echo "$at_srcdir/torture.at:475: \$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:475" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:475" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } - - -# Below the limit of 200. { set +x -$as_echo "$at_srcdir/torture.at:478: 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:478" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:478" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/torture.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:478" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/calc.at:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:478" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } -# Two enlargements: 2 * 2 * 200. +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + { set +x -$as_echo "$at_srcdir/torture.at:481: 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:481" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:481" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:481: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:481" +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:481" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $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). + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/torture.at:485: 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:485" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 +$as_echo "$at_srcdir/calc.at:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/torture.at:485" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:485: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:485" +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:485" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $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' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%{ -#include -#include -#include -#include - -#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 | ; -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static int -yylex (void) -{ - assert (0 <= yylval); - if (yylval--) - return WAIT_FOR_EOF; - else - return EOF; -} - -/* Return argv[1] as an int. */ -static int -get_args (int argc, const char **argv) -{ - int res; - char *endp; - assert (argc == 2); - res = strtol (argv[1], &endp, 10); - assert (argv[1] != endp); - assert (0 <= res); - assert (res <= INT_MAX); - assert (errno != ERANGE); - return res; -} - -int -main (int argc, const char **argv) -{ - YYSTYPE yylval_init = get_args (argc, argv); - int status = 0; - int count; - yypstate *ps = yypstate_new (); - yydebug = 1; - for (count = 0; count < 2; ++count) - { - int new_status; - yylval = yylval_init; - new_status = yypull_parse (ps); - if (count == 0) - status = new_status; - else - assert (new_status == status); - } - yypstate_delete (ps); - return status; -} +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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 - - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:491: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:491" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +# 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:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:491" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/torture.at:491: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:491" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y + +# Exercise error messages with EOF: work on an empty file. +{ set +x +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:491" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/torture.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' "torture.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 +{ set +x +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:491" +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:678" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/torture.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "torture.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 | sort + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:491" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + + +# 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/torture.at:491: bison -o input.c input.y" -at_fn_check_prepare_trace "torture.at:491" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:491" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/torture.at:491: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:491" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:491" +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:678" $at_failed && at_fn_log_failure $at_traceon; } + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/torture.at:491: \$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:491" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:491" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $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' +(!) + (1 2) = 1 +_ATEOF + { set +x -$as_echo "$at_srcdir/torture.at:494: 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:494" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:494" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:494: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:494" +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:494" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + { set +x -$as_echo "$at_srcdir/torture.at:496: 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:496" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:496" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:496: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:496" +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:496" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $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/torture.at:498: 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:498" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 +$as_echo "$at_srcdir/calc.at:678: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/torture.at:498" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:498: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:498" +$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:678" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:678: cat stderr" +at_fn_check_prepare_trace "calc.at:678" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678" $at_failed && at_fn_log_failure $at_traceon; } @@ -130333,22 +131094,25 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_257 -#AT_START_258 -at_fn_group_banner 258 'torture.at:512' \ - "Exploding the Stack Size with Malloc" " " 15 +#AT_STOP_351 +#AT_START_352 +at_fn_group_banner 352 'calc.at:679' \ + "Calculator C++ %locations" " " 14 at_xfail=no ( - $as_echo "258. $at_setup_line: testing $at_desc ..." + $as_echo "352. $at_setup_line: testing $at_desc ..." $at_traceon -# A grammar of parens growing the stack thanks to right recursion. -# exp: -cat >input.y <<'_ATEOF' + + + + + +cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -130357,117 +131121,307 @@ cat >input.y <<'_ATEOF' #undef realloc } -%{ -#include -#include -#include -#include -#define YYSTACK_USE_ALLOCA 0 - static int yylex (void); - static void yyerror ( const char *msg); -%} +/* Infix notation calculator--calc */ +%language "C++" %locations +%define global_tokens_and_yystype +%code requires +{ -%error-verbose -%debug -%token WAIT_FOR_EOF + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; +} + +/* Exercise %union. */ +%union +{ + semantic_value ival; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ + +/* Grammar follows */ %% -exp: WAIT_FOR_EOF exp | ; +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; } +; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) + +static int +power (int base, int exponent) { - fprintf (stderr, "%s\n", msg); + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; } -#include + + +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include + +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); + + +static yy::parser::location_type last_yylloc; + static int -yylex (void) +get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { - assert (0 <= yylval); - if (yylval--) - return WAIT_FOR_EOF; + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } else - return EOF; + (*llocp).end.column++; + + return res; +} + +static void +unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); } -/* Return argv[1] as an int. */ static int -get_args (int argc, const char **argv) +read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { - int res; - char *endp; - assert (argc == 2); - res = strtol (argv[1], &endp, 10); - assert (argv[1] != endp); - assert (0 <= res); - assert (res <= INT_MAX); - assert (errno != ERANGE); - return res; + 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 (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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; +} + +#include +#include + + +/* A C++ yyparse that simulates the C signature. */ +int +yyparse () +{ + yy::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); } + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ int main (int argc, const char **argv) { - YYSTYPE yylval_init = get_args (argc, argv); - int status = 0; - int count; - yydebug = 1; - for (count = 0; count < 2; ++count) + 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) { - int new_status; - yylval = yylval_init; - new_status = yyparse (); - if (count == 0) - status = new_status; - else - assert (new_status == status); + perror (argv[1]); + return 3; } + + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; return status; } _ATEOF + + + + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:516" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:516" +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/torture.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:516" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:679" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:516" +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/torture.at:516: \$XSLTPROC \\ +$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' "torture.at:516" +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 @@ -130476,16 +131430,16 @@ at_status=$? at_failed=false $at_check_filter 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:516" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/torture.at:516: \$XSLTPROC \\ +$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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:516" +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 | sort @@ -130494,7 +131448,7 @@ at_status=$? at_failed=false $at_check_filter 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:516" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } @@ -130502,1112 +131456,943 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/torture.at:516: bison -o input.c input.y" -at_fn_check_prepare_trace "torture.at:516" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/calc.at:679: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:516" +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/torture.at:516: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:516" -( $at_check_trace; $BISON_C_WORKS +$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" 5>&- at_status=$? at_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:516" +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/torture.at:516: \$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:516" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:679: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:679" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:516" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } - - -# Below the limit of 200. { set +x -$as_echo "$at_srcdir/torture.at:519: 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:519" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:519" -$at_failed && at_fn_log_failure -$at_traceon; } +$as_echo "$at_srcdir/calc.at:679: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc -{ set +x -$as_echo "$at_srcdir/torture.at:519: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:519" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +at_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:519" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } -# Two enlargements: 2 * 2 * 200. +# 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/torture.at:522: 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:522" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:522" +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/torture.at:522: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:522" +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:522" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $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). + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + { set +x -$as_echo "$at_srcdir/torture.at:526: 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:526" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/torture.at:526" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:526" +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:526" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } - -# A grammar of parens growing the stack thanks to right recursion. -# exp: -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%{ -#include -#include -#include -#include -#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 | ; -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static int -yylex (void) -{ - assert (0 <= yylval); - if (yylval--) - return WAIT_FOR_EOF; - else - return EOF; -} - -/* Return argv[1] as an int. */ -static int -get_args (int argc, const char **argv) -{ - int res; - char *endp; - assert (argc == 2); - res = strtol (argv[1], &endp, 10); - assert (argv[1] != endp); - assert (0 <= res); - assert (res <= INT_MAX); - assert (errno != ERANGE); - return res; -} - -int -main (int argc, const char **argv) -{ - YYSTYPE yylval_init = get_args (argc, argv); - int status = 0; - int count; - yypstate *ps = yypstate_new (); - yydebug = 1; - for (count = 0; count < 2; ++count) - { - int new_status; - yylval = yylval_init; - new_status = yypull_parse (ps); - if (count == 0) - status = new_status; - else - assert (new_status == status); - } - yypstate_delete (ps); - return status; -} +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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. - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:529" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:529" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/torture.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "torture.at:529" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:529" -$at_failed && at_fn_log_failure -$at_traceon; } - - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/torture.at:529: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:529" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml +# 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:679: cat stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:529" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/torture.at:529: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:529" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:529" -$at_failed && at_fn_log_failure -$at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi +cat >input <<'_ATEOF' +1//2 +_ATEOF + { set +x -$as_echo "$at_srcdir/torture.at:529: bison -o input.c input.y" -at_fn_check_prepare_trace "torture.at:529" -( $at_check_trace; bison -o input.c input.y +$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" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/torture.at:529: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:529" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:529" +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.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/torture.at:529: \$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:529" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$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" 5>&- at_status=$? at_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:529" +at_fn_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/torture.at:532: 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:532" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:532" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:532: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:532" +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:532" +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/torture.at:534: 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:534" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:534" -$at_failed && at_fn_log_failure -$at_traceon; } +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/torture.at:534: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:534" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$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" 5>&- 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:534" +at_fn_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/torture.at:536: 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:536" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 +$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" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/torture.at:536" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/torture.at:536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "torture.at:536" +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536" +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.7: syntax error, unexpected '=' +_ATEOF +# 3. If locations are not used, remove them. - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_258 -#AT_START_259 -at_fn_group_banner 259 'existing.at:79' \ - "GNU AWK 3.1.0 Grammar: LALR(1)" " " 16 -at_xfail=no -( - $as_echo "259. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); -} - -%define lr.type lalr -%error-verbose - -%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 - ; +# 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:679: cat stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_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; } -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -static int -yylex (void) -{ - static int const input[] = { - LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 - }; - static int const *inputp = input; - return *inputp++; -} +cat >input <<'_ATEOF' -int -main (void) -{ - return yyparse (); -} ++1 _ATEOF - - -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y +{ 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" 5>&- at_status=$? at_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:79" +echo 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; } - { set +x -$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:79" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y +{ set +x +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +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; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.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' "existing.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 + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:679: cat stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.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 | sort + +# 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" 5>&- at_status=$? at_failed=false $at_check_filter -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:79" +echo 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; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:79" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 65 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +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.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/existing.at:79: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +$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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "319 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +$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/existing.at:79: diff -u /dev/null /dev/null || exit 77" -at_fn_check_prepare_trace "existing.at:79" -( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +$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" 5>&- 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/existing.at:79" +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; } - { set +x -$as_echo "$at_srcdir/existing.at:79: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" -at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:79" -( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all input-lalr.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all input-lalr.y + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:679: cat stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +at_fn_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 -$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:79" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y + + +# The same, but this time exercising explicitly triggered syntax errors. +# POSIX says the lookahead causing the error should not be discarded. +cat >input <<'_ATEOF' +(!) + (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" 5>&- at_status=$? at_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:79" +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; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.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' "existing.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 +{ set +x +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:79" +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; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.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 | sort + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:679: cat stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:79" +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 - at_restore_special_files -fi + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:79: bison --report=all input-lalr.y" -at_fn_check_prepare_trace "existing.at:79" -( $at_check_trace; bison --report=all input-lalr.y +$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" 5>&- at_status=$? at_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:79" +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; } - { set +x -$as_echo "$at_srcdir/existing.at:79: diff -u input-lalr.output input.output \\ - | sed -n '/^@@/,\$p' | sed 's/^ \$//'" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" -( $at_check_trace; diff -u input-lalr.output input.output \ - | sed -n '/^@@/,$p' | sed 's/^ $//' +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679" $at_failed && at_fn_log_failure $at_traceon; } -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:79: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79" -( $at_check_trace; $BISON_C_WORKS +$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" 5>&- at_status=$? at_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:79" +at_fn_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/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$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" 5>&- at_status=$? at_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:79" +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; } - { set +x -$as_echo "$at_srcdir/existing.at:79: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:679" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +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. +sed 's/syntax error, .*$/syntax error/' expout >at-expout +mv at-expout expout +# 5. Check { set +x -$as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:79" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$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" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '*', expecting NEWLINE or '{' or ';' -" | \ - $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:79" +at_fn_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 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_259 -#AT_START_260 -at_fn_group_banner 260 'existing.at:79' \ - "GNU AWK 3.1.0 Grammar: IELR(1)" " " 16 +#AT_STOP_352 +#AT_START_353 +at_fn_group_banner 353 'calc.at:680' \ + "Calculator C++ %locations api.location.type={Span}" "" 14 at_xfail=no ( - $as_echo "260. $at_setup_line: testing $at_desc ..." + $as_echo "353. $at_setup_line: testing $at_desc ..." $at_traceon -cat >input.y <<'_ATEOF' + + + + + + + + +cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -131616,363 +132401,310 @@ cat >input.y <<'_ATEOF' #undef realloc } -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); -} +/* Infix notation calculator--calc */ +%language "C++" %locations %define api.location.type {Span} +%define global_tokens_and_yystype +%code requires +{ -%define lr.type ielr -%error-verbose +# include + struct Point + { + int l; + int c; + }; -%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 + struct Span + { + Point first; + Point last; + }; -/* 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 '(' ')' +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first = YYRHSLOC (Rhs, 1).first; \ + (Current).last = YYRHSLOC (Rhs, N).last; \ + } \ + else \ + { \ + (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \ + } \ + while (false) -%% + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; +} +/* Exercise %union. */ +%union +{ + semantic_value ival; +}; +%printer { yyoutput << $$; } ; -start - : opt_nls program opt_nls - ; +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} -program - : rule - | program rule - | error - | program error - | /* empty */ - ; +%code +{ +#include +#include +#define USE(Var) -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 - ; +FILE *input; +static int power (int base, int exponent); -func_name - : NAME - | FUNC_CALL - | lex_builtin - ; -lex_builtin - : LEX_BUILTIN - | LEX_LENGTH - ; +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} -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 - ; +%initial-action +{ + @$.first.l = @$.first.c = 1; + @$.last = @$.first; +} -pattern - : exp - | exp ',' exp - ; +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type 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 '/' - ; +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ -action - : l_brace statements r_brace opt_semi opt_nls - | l_brace r_brace opt_semi opt_nls - ; +/* Grammar follows */ +%% +input: + line +| input line { } +; -statements - : statement - | statements statement - | error - | statements error - ; +line: + '\n' +| exp '\n' { USE ($1); } +; -statement_term - : nls - | semi opt_nls - ; +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; } +; +%% -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 - ; +static int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} -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 - ; + std::ostream& + operator<< (std::ostream& o, const Span& s) + { + o << s.first.l << '.' << s.first.c; + if (s.first.l != s.last.l) + o << '-' << s.last.l << '.' << s.last.c - 1; + else if (s.first.c != s.last.c - 1) + o << '-' << s.last.c - 1; + return o; + } -nls - : NEWLINE - | nls NEWLINE - ; +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include -opt_nls - : /* empty */ - | nls - ; +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); -input_redir - : /* empty */ - | '<' simp_exp - ; -output_redir - : /* empty */ - | '>' exp - | APPEND_OP exp - | '|' exp - | TWOWAYIO exp - ; +static yy::parser::location_type last_yylloc; -opt_param_list - : /* empty */ - | param_list - ; +static int +get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; -param_list - : NAME - | param_list comma NAME - | error - | param_list error - | param_list comma error - ; + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).last.l++; + (*llocp).last.c = 1; + } + else + (*llocp).last.c++; -/* optional expression, as in for loop */ -opt_exp - : /* empty */ - | exp - ; + return res; +} -opt_rexpression_list - : /* empty */ - | rexpression_list - ; +static void +unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; -rexpression_list - : rexp - | rexpression_list comma rexp - | error - | rexpression_list error - | rexpression_list error rexp - | rexpression_list comma error - ; + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; -opt_expression_list - : /* empty */ - | expression_list - ; + ungetc (c, input); +} -expression_list - : exp - | expression_list comma exp - | error - | expression_list error - | expression_list error exp - | expression_list comma error - ; +static int +read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + int c = get_char (lvalp, llocp); + int sign = 1; + int n = 0; -/* 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 - ; + (void) lvalp;(void) llocp; + if (c == '-') + { + c = get_char (lvalp, llocp); + sign = -1; + } -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 - ; + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp, llocp); + } -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 - ; + unget_char (lvalp, llocp, c); -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 - ; + return sign * n; +} -opt_variable - : /* empty */ - | variable - ; -variable - : NAME - | NAME '[' expression_list ']' - | '$' non_post_simp_exp - ; +/*---------------------------------------------------------------. +| 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. | +`---------------------------------------------------------------*/ -l_brace - : '{' opt_nls - ; +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).first.c = (*llocp).last.c; + (*llocp).first.l = (*llocp).last.l; -r_brace - : '}' opt_nls - ; + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); -r_paren - : ')' - ; + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, llocp, c); + (*lvalp).ival = read_signed_integer (lvalp, llocp); + return NUM; + } -opt_semi - : /* empty */ - | semi - ; + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; -semi - : ';' - ; + /* Return single chars. */ + return c; +} -comma : ',' opt_nls - ; +#include +#include -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -static int -yylex (void) +/* A C++ yyparse that simulates the C signature. */ +int +yyparse () { - static int const input[] = { - LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 - }; - static int const *inputp = input; - return *inputp++; + yy::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); } -int -main (void) + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +int +main (int argc, const char **argv) { - return yyparse (); + 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; } _ATEOF -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. + + + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files @@ -131980,39 +132712,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:680" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:79" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:680" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:79" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:680" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -132021,16 +132753,16 @@ at_status=$? at_failed=false $at_check_filter 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:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:680" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -132039,7 +132771,7 @@ at_status=$? at_failed=false $at_check_filter 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:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } @@ -132047,2006 +132779,943 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/existing.at:79: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:79" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:680: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 65 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +$as_echo "$at_srcdir/calc.at:680: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:680" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "328 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/calc.at:680: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:680" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:680" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:79: diff -u /dev/null /dev/null || exit 77" -at_fn_check_prepare_trace "existing.at:79" -( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +$as_echo "$at_srcdir/calc.at:680: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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/existing.at:79" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $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/existing.at:79: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" -at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:79" -( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all input-lalr.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all input-lalr.y +{ set +x +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +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:680" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:79" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.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' "existing.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 +{ set +x +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:79" +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:680" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.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 | sort + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + +cat >input <<'_ATEOF' +1//2 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:79: bison --report=all input-lalr.y" -at_fn_check_prepare_trace "existing.at:79" -( $at_check_trace; bison --report=all input-lalr.y +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:79: diff -u input-lalr.output input.output \\ - | sed -n '/^@@/,\$p' | sed 's/^ \$//'" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79" -( $at_check_trace; diff -u input-lalr.output input.output \ - | sed -n '/^@@/,$p' | sed 's/^ $//' +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "@@ -712,7 +712,7 @@ - 156 | . '\$' non_post_simp_exp - - NAME shift, and go to state 9 -- '\$' shift, and go to state 24 -+ '\$' shift, and go to state 320 +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:680" +$at_failed && at_fn_log_failure +$at_traceon; } - NAME [reduce using rule 152 (opt_variable)] - '\$' [reduce using rule 152 (opt_variable)] -@@ -5379,7 +5379,7 @@ - 156 | . '\$' non_post_simp_exp - NAME shift, and go to state 9 -- '\$' shift, and go to state 24 -+ '\$' shift, and go to state 320 - NAME [reduce using rule 152 (opt_variable)] - '\$' [reduce using rule 152 (opt_variable)] -@@ -5399,7 +5399,7 @@ - 156 | . '\$' non_post_simp_exp +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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 - NAME shift, and go to state 9 -- '\$' shift, and go to state 24 -+ '\$' shift, and go to state 320 +# 3. If locations are not used, remove them. - NAME [reduce using rule 152 (opt_variable)] - '\$' [reduce using rule 152 (opt_variable)] -@@ -6214,7 +6214,7 @@ - 156 | . '\$' non_post_simp_exp +# 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:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +$at_failed && at_fn_log_failure +$at_traceon; } - NAME shift, and go to state 9 -- '\$' shift, and go to state 24 -+ '\$' shift, and go to state 320 - NAME [reduce using rule 152 (opt_variable)] - '\$' [reduce using rule 152 (opt_variable)] -@@ -11099,3 +11099,274 @@ - 45 statement: LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement . +cat >input <<'_ATEOF' +error +_ATEOF - \$default reduce using rule 45 (statement) -+ -+ -+State 320 -+ -+ 139 non_post_simp_exp: . '!' simp_exp -+ 140 | . '(' exp r_paren -+ 141 | . LEX_BUILTIN '(' opt_expression_list r_paren -+ 142 | . LEX_LENGTH '(' opt_expression_list r_paren -+ 143 | . LEX_LENGTH -+ 144 | . FUNC_CALL '(' opt_expression_list r_paren -+ 145 | . variable -+ 146 | . INCREMENT variable -+ 147 | . DECREMENT variable -+ 148 | . YNUMBER -+ 149 | . YSTRING -+ 150 | . '-' simp_exp -+ 151 | . '+' simp_exp -+ 154 variable: . NAME -+ 155 | . NAME '[' expression_list ']' -+ 156 | . '\$' non_post_simp_exp -+ 156 | '\$' . non_post_simp_exp -+ -+ FUNC_CALL shift, and go to state 8 -+ NAME shift, and go to state 9 -+ YNUMBER shift, and go to state 10 -+ YSTRING shift, and go to state 11 -+ INCREMENT shift, and go to state 321 -+ DECREMENT shift, and go to state 322 -+ LEX_BUILTIN shift, and go to state 18 -+ LEX_LENGTH shift, and go to state 19 -+ '+' shift, and go to state 323 -+ '-' shift, and go to state 324 -+ '!' shift, and go to state 325 -+ '\$' shift, and go to state 320 -+ '(' shift, and go to state 55 -+ -+ non_post_simp_exp go to state 62 -+ variable go to state 63 -+ -+ -+State 321 -+ -+ 146 non_post_simp_exp: INCREMENT . variable -+ 154 variable: . NAME -+ 155 | . NAME '[' expression_list ']' -+ 156 | . '\$' non_post_simp_exp -+ -+ NAME shift, and go to state 9 -+ '\$' shift, and go to state 320 -+ -+ variable go to state 50 -+ -+ -+State 322 -+ -+ 147 non_post_simp_exp: DECREMENT . variable -+ 154 variable: . NAME -+ 155 | . NAME '[' expression_list ']' -+ 156 | . '\$' non_post_simp_exp -+ -+ NAME shift, and go to state 9 -+ '\$' shift, and go to state 320 -+ -+ variable go to state 51 -+ -+ -+State 323 -+ -+ 130 simp_exp: . non_post_simp_exp -+ 131 | . simp_exp '^' simp_exp -+ 132 | . simp_exp '*' simp_exp -+ 133 | . simp_exp '/' simp_exp -+ 134 | . simp_exp '%' simp_exp -+ 135 | . simp_exp '+' simp_exp -+ 136 | . simp_exp '-' simp_exp -+ 137 | . variable INCREMENT -+ 138 | . variable DECREMENT -+ 139 non_post_simp_exp: . '!' simp_exp -+ 140 | . '(' exp r_paren -+ 141 | . LEX_BUILTIN '(' opt_expression_list r_paren -+ 142 | . LEX_LENGTH '(' opt_expression_list r_paren -+ 143 | . LEX_LENGTH -+ 144 | . FUNC_CALL '(' opt_expression_list r_paren -+ 145 | . variable -+ 146 | . INCREMENT variable -+ 147 | . DECREMENT variable -+ 148 | . YNUMBER -+ 149 | . YSTRING -+ 150 | . '-' simp_exp -+ 151 | . '+' simp_exp -+ 151 | '+' . simp_exp -+ 154 variable: . NAME -+ 155 | . NAME '[' expression_list ']' -+ 156 | . '\$' non_post_simp_exp -+ -+ FUNC_CALL shift, and go to state 8 -+ NAME shift, and go to state 9 -+ YNUMBER shift, and go to state 10 -+ YSTRING shift, and go to state 11 -+ INCREMENT shift, and go to state 16 -+ DECREMENT shift, and go to state 17 -+ LEX_BUILTIN shift, and go to state 18 -+ LEX_LENGTH shift, and go to state 19 -+ '+' shift, and go to state 20 -+ '-' shift, and go to state 21 -+ '!' shift, and go to state 54 -+ '\$' shift, and go to state 24 -+ '(' shift, and go to state 55 -+ -+ simp_exp go to state 326 -+ non_post_simp_exp go to state 35 -+ variable go to state 57 -+ -+ -+State 324 -+ -+ 130 simp_exp: . non_post_simp_exp -+ 131 | . simp_exp '^' simp_exp -+ 132 | . simp_exp '*' simp_exp -+ 133 | . simp_exp '/' simp_exp -+ 134 | . simp_exp '%' simp_exp -+ 135 | . simp_exp '+' simp_exp -+ 136 | . simp_exp '-' simp_exp -+ 137 | . variable INCREMENT -+ 138 | . variable DECREMENT -+ 139 non_post_simp_exp: . '!' simp_exp -+ 140 | . '(' exp r_paren -+ 141 | . LEX_BUILTIN '(' opt_expression_list r_paren -+ 142 | . LEX_LENGTH '(' opt_expression_list r_paren -+ 143 | . LEX_LENGTH -+ 144 | . FUNC_CALL '(' opt_expression_list r_paren -+ 145 | . variable -+ 146 | . INCREMENT variable -+ 147 | . DECREMENT variable -+ 148 | . YNUMBER -+ 149 | . YSTRING -+ 150 | . '-' simp_exp -+ 150 | '-' . simp_exp -+ 151 | . '+' simp_exp -+ 154 variable: . NAME -+ 155 | . NAME '[' expression_list ']' -+ 156 | . '\$' non_post_simp_exp -+ -+ FUNC_CALL shift, and go to state 8 -+ NAME shift, and go to state 9 -+ YNUMBER shift, and go to state 10 -+ YSTRING shift, and go to state 11 -+ INCREMENT shift, and go to state 16 -+ DECREMENT shift, and go to state 17 -+ LEX_BUILTIN shift, and go to state 18 -+ LEX_LENGTH shift, and go to state 19 -+ '+' shift, and go to state 20 -+ '-' shift, and go to state 21 -+ '!' shift, and go to state 54 -+ '\$' shift, and go to state 24 -+ '(' shift, and go to state 55 -+ -+ simp_exp go to state 327 -+ non_post_simp_exp go to state 35 -+ variable go to state 57 -+ -+ -+State 325 -+ -+ 130 simp_exp: . non_post_simp_exp -+ 131 | . simp_exp '^' simp_exp -+ 132 | . simp_exp '*' simp_exp -+ 133 | . simp_exp '/' simp_exp -+ 134 | . simp_exp '%' simp_exp -+ 135 | . simp_exp '+' simp_exp -+ 136 | . simp_exp '-' simp_exp -+ 137 | . variable INCREMENT -+ 138 | . variable DECREMENT -+ 139 non_post_simp_exp: . '!' simp_exp -+ 139 | '!' . simp_exp -+ 140 | . '(' exp r_paren -+ 141 | . LEX_BUILTIN '(' opt_expression_list r_paren -+ 142 | . LEX_LENGTH '(' opt_expression_list r_paren -+ 143 | . LEX_LENGTH -+ 144 | . FUNC_CALL '(' opt_expression_list r_paren -+ 145 | . variable -+ 146 | . INCREMENT variable -+ 147 | . DECREMENT variable -+ 148 | . YNUMBER -+ 149 | . YSTRING -+ 150 | . '-' simp_exp -+ 151 | . '+' simp_exp -+ 154 variable: . NAME -+ 155 | . NAME '[' expression_list ']' -+ 156 | . '\$' non_post_simp_exp -+ -+ FUNC_CALL shift, and go to state 8 -+ NAME shift, and go to state 9 -+ YNUMBER shift, and go to state 10 -+ YSTRING shift, and go to state 11 -+ INCREMENT shift, and go to state 16 -+ DECREMENT shift, and go to state 17 -+ LEX_BUILTIN shift, and go to state 18 -+ LEX_LENGTH shift, and go to state 19 -+ '+' shift, and go to state 20 -+ '-' shift, and go to state 21 -+ '!' shift, and go to state 54 -+ '\$' shift, and go to state 24 -+ '(' shift, and go to state 55 -+ -+ simp_exp go to state 328 -+ non_post_simp_exp go to state 35 -+ variable go to state 57 -+ -+ -+State 326 -+ -+ 131 simp_exp: simp_exp . '^' simp_exp -+ 132 | simp_exp . '*' simp_exp -+ 133 | simp_exp . '/' simp_exp -+ 134 | simp_exp . '%' simp_exp -+ 135 | simp_exp . '+' simp_exp -+ 136 | simp_exp . '-' simp_exp -+ 151 non_post_simp_exp: '+' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] -+ -+ '*' shift, and go to state 89 -+ '/' shift, and go to state 90 -+ '%' shift, and go to state 91 -+ '^' shift, and go to state 92 -+ -+ \$default reduce using rule 151 (non_post_simp_exp) -+ -+ Conflict between rule 151 and token '+' resolved as reduce ('+' < UNARY). -+ Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY). -+ -+ -+State 327 -+ -+ 131 simp_exp: simp_exp . '^' simp_exp -+ 132 | simp_exp . '*' simp_exp -+ 133 | simp_exp . '/' simp_exp -+ 134 | simp_exp . '%' simp_exp -+ 135 | simp_exp . '+' simp_exp -+ 136 | simp_exp . '-' simp_exp -+ 150 non_post_simp_exp: '-' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] -+ -+ '*' shift, and go to state 89 -+ '/' shift, and go to state 90 -+ '%' shift, and go to state 91 -+ '^' shift, and go to state 92 -+ -+ \$default reduce using rule 150 (non_post_simp_exp) -+ -+ Conflict between rule 150 and token '+' resolved as reduce ('+' < UNARY). -+ Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY). -+ -+ -+State 328 -+ -+ 131 simp_exp: simp_exp . '^' simp_exp -+ 132 | simp_exp . '*' simp_exp -+ 133 | simp_exp . '/' simp_exp -+ 134 | simp_exp . '%' simp_exp -+ 135 | simp_exp . '+' simp_exp -+ 136 | simp_exp . '-' simp_exp -+ 139 non_post_simp_exp: '!' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] -+ -+ '*' shift, and go to state 89 -+ '/' shift, and go to state 90 -+ '%' shift, and go to state 91 -+ '^' shift, and go to state 92 -+ -+ \$default reduce using rule 139 (non_post_simp_exp) -+ -+ Conflict between rule 139 and token '+' resolved as reduce ('+' < UNARY). -+ Conflict between rule 139 and token '-' resolved as reduce ('-' < UNARY). -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +{ set +x +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } - -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. - { set +x -$as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +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:680" $at_failed && at_fn_log_failure $at_traceon; } + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:79: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:79" +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_260 -#AT_START_261 -at_fn_group_banner 261 'existing.at:79' \ - "GNU AWK 3.1.0 Grammar: Canonical LR(1)" " " 16 -at_xfail=no -( - $as_echo "261. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); -} - -%define lr.type canonical-lr -%error-verbose - -%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 - ; - - -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -static int -yylex (void) -{ - static int const input[] = { - LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 - }; - static int const *inputp = input; - return *inputp++; -} - -int -main (void) -{ - return yyparse (); -} +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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. - -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. - +# 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/existing.at:79: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:79" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 265 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/existing.at:79" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' + ++1 +_ATEOF { set +x -$as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "2358 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } - - - -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. -if test 32767 -lt `wc -l < input.c`; then - CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'` - CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'` -fi { set +x -$as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +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:680" $at_failed && at_fn_log_failure $at_traceon; } + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:79" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } +# Exercise error messages with EOF: work on an empty file. { set +x -$as_echo "$at_srcdir/existing.at:79: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:79" +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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 - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_261 -#AT_START_262 -at_fn_group_banner 262 'existing.at:783' \ - "GNU Cim Grammar: LALR(1)" " " 16 -at_xfail=no -( - $as_echo "262. $at_setup_line: testing $at_desc ..." - $at_traceon - +# 3. If locations are not used, remove them. -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} +# 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:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" +$at_failed && at_fn_log_failure +$at_traceon; } -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); -} -%define lr.type lalr -%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 - ; - - -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -static int -yylex (void) -{ - static int const input[] = { - 0 - }; - static int const *inputp = input; - return *inputp++; -} - -int -main (void) -{ - return yyparse (); -} +# 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 - - -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:783" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:783" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:783" -$at_failed && at_fn_log_failure -$at_traceon; } - - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:783" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:783" -$at_failed && at_fn_log_failure -$at_traceon; } - - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort +{ set +x +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:783" +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:680" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "442 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" -$at_failed && at_fn_log_failure -$at_traceon; } +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:783: diff -u /dev/null /dev/null || exit 77" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +$as_echo "$at_srcdir/calc.at:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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/existing.at:783" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $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' +(!) + (1 2) = 1 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:783: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" -at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:783" -( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all input-lalr.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all input-lalr.y +{ set +x +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +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:680" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:783" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:783" -$at_failed && at_fn_log_failure -$at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:783" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:783" -$at_failed && at_fn_log_failure -$at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi -{ set +x -$as_echo "$at_srcdir/existing.at:783: bison --report=all input-lalr.y" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; bison --report=all input-lalr.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:783" -$at_failed && at_fn_log_failure -$at_traceon; } +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF { set +x -$as_echo "$at_srcdir/existing.at:783: diff -u input-lalr.output input.output \\ - | sed -n '/^@@/,\$p' | sed 's/^ \$//'" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" -( $at_check_trace; diff -u input-lalr.output input.output \ - | sed -n '/^@@/,$p' | sed 's/^ $//' +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/existing.at:783: grep '^State.*conflicts:' input.output" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; grep '^State.*conflicts:' input.output +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:783" +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:680" $at_failed && at_fn_log_failure $at_traceon; } -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:783: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $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/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:680: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +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:680" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:783: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/calc.at:680: cat stderr" +at_fn_check_prepare_trace "calc.at:680" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:783" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_262 -#AT_START_263 -at_fn_group_banner 263 'existing.at:783' \ - "GNU Cim Grammar: IELR(1)" " " 16 +#AT_STOP_353 +#AT_START_354 +at_fn_group_banner 354 'calc.at:681' \ + "Calculator C++ %defines %locations parse.error=verbose %name-prefix \"calc\" %verbose %yacc" "" 14 at_xfail=no ( - $as_echo "263. $at_setup_line: testing $at_desc ..." + $as_echo "354. $at_setup_line: testing $at_desc ..." $at_traceon -cat >input.y <<'_ATEOF' + + + + + + + + +cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -134055,630 +133724,290 @@ cat >input.y <<'_ATEOF' #undef realloc } -%code { +/* Infix notation calculator--calc */ +%language "C++" %defines %locations %define parse.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ #include - static void yyerror ( const char *msg); - static int yylex (void); + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; } -%define lr.type ielr +%code +{ +#include +#include +#define USE(Var) -%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 +FILE *input; +static int power (int base, int exponent); -%token HIDENTIFIER -%token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST -%token HREALKONST -%token HTEXTKONST +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} -%right HASSIGN -%left HORELSE -%left HANDTHEN -%left HEQV -%left HIMP -%left HOR -%left HAND -%left HNOT -%left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp -%left HCONC +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ -%left HTERMOPERATOR -%left UNEAR -%left HFACTOROPERATOR -%left HPRIMARYOPERATOR +/* Grammar follows */ +%% +input: + line +| input line { } +; -%left HQUA +line: + '\n' +| exp '\n' { USE ($1); } +; -%left HDOT +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; } +; +%% -%start MAIN_MODULE +static int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} -%% +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +_ATEOF -/* 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 {} +cat >calc-lex.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc - | 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 - ; +#include "calc.hh" -/* 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 - ; +#include +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) + +static calc::parser::location_type last_yylloc; + +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { - fprintf (stderr, "%s\n", msg); + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); } + static int -yylex (void) +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { - static int const input[] = { - 0 - }; - static int const *inputp = input; - return *inputp++; + 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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 + + +cat >calc-main.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); } + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ int -main (void) +main (int argc, const char **argv) { - return yyparse (); + 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; } _ATEOF -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. + + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files @@ -134686,39 +134015,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:681" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:783" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:681" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:783" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:681" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -134727,16 +134056,16 @@ at_status=$? at_failed=false $at_check_filter 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:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:681" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -134745,7 +134074,7 @@ at_status=$? at_failed=false $at_check_filter 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:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } @@ -134753,2030 +134082,933 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:681: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +$as_echo "$at_srcdir/calc.at:681: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:681" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "442 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:783: diff -u /dev/null /dev/null || exit 77" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +$as_echo "$at_srcdir/calc.at:681: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:681" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:783: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" -at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:783" -( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +$as_echo "$at_srcdir/calc.at:681: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc calc.hh +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc calc.hh + ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all input-lalr.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all input-lalr.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:783" -$at_failed && at_fn_log_failure -$at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:783: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:783" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:783" -$at_failed && at_fn_log_failure -$at_traceon; } +# Test the priorities. +cat >input <<'_ATEOF' +1 + 2 * 3 = 7 +1 + 2 * -3 = -5 - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:783" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:783" -$at_failed && at_fn_log_failure -$at_traceon; } +-1^2 = -1 +(-1)^2 = 1 - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.at:783: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:783" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort +---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:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:783" +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:681" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/existing.at:783: bison --report=all input-lalr.y" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; bison --report=all input-lalr.y +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +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:681" $at_failed && at_fn_log_failure $at_traceon; } + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:783: diff -u input-lalr.output input.output \\ - | sed -n '/^@@/,\$p' | sed 's/^ \$//'" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:783" -( $at_check_trace; diff -u input-lalr.output input.output \ - | sed -n '/^@@/,$p' | sed 's/^ $//' +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/existing.at:783: grep '^State.*conflicts:' input.output" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; grep '^State.*conflicts:' input.output +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:783" +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:681" $at_failed && at_fn_log_failure $at_traceon; } -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. -{ set +x -$as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:783" -$at_failed && at_fn_log_failure -$at_traceon; } +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +1//2 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:783: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:783" +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_263 -#AT_START_264 -at_fn_group_banner 264 'existing.at:783' \ - "GNU Cim Grammar: Canonical LR(1)" " " 16 -at_xfail=no -( - $as_echo "264. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); -} - -%define lr.type canonical-lr - -%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 - ; - - -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -static int -yylex (void) -{ - static int const input[] = { - 0 - }; - static int const *inputp = input; - return *inputp++; -} - -int -main (void) -{ - return yyparse (); -} +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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. -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. - +# 5. Check { set +x -$as_echo "$at_srcdir/existing.at:783: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:783" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1876 shift/reduce, 144 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:783" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +error +_ATEOF { set +x -$as_echo "$at_srcdir/existing.at:783: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:783" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "10425 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - - - -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. -if test 32767 -lt `wc -l < input.c`; then - CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'` - CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'` -fi { set +x -$as_echo "$at_srcdir/existing.at:783: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:783" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +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:681" $at_failed && at_fn_log_failure $at_traceon; } + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:783" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:783" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:783: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:783" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:783" +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:783" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_264 -#AT_START_265 -at_fn_group_banner 265 'existing.at:1403' \ - "GNU pic (Groff 1.18.1) Grammar: LALR(1)" " " 16 -at_xfail=no -( - $as_echo "265. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); -} - -%define lr.type lalr -%error-verbose - -%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 THROUGH -%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 THROUGH - {} - DELIMITED - {} - until - | COPY THROUGH - {} - 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 - ; - - -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -static int -yylex (void) -{ - static int const input[] = { - VARIABLE, '=', LABEL, LEFT, DOT_X, 0 - }; - static int const *inputp = input; - return *inputp++; -} - -int -main (void) -{ - return yyparse (); -} +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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. -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y +# 5. Check +{ set +x +$as_echo "$at_srcdir/calc.at:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1403" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml +{ set +x +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1403" +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:681" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + +# Exercise error messages with EOF: work on an empty file. { set +x -$as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:1403" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path -" | \ - $at_diff - "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - - # To avoid expanding it repeatedly, store specified stdout. - : >expout - - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror +{ set +x +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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 0 $at_status "$at_srcdir/existing.at:1403" -$at_failed && at_fn_log_failure -$at_traceon; } +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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. - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error +# 4. If error-verbose is not used, strip the', unexpected....' part. + +# 5. Check +{ set +x +$as_echo "$at_srcdir/calc.at:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror + +# 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:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1403" +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:681" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror +{ set +x +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1403" +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:681" $at_failed && at_fn_log_failure $at_traceon; } - at_restore_special_files -fi -{ set +x -$as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "422 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" -$at_failed && at_fn_log_failure -$at_traceon; } +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:1403: diff -u /dev/null /dev/null || exit 77" -at_fn_check_prepare_trace "existing.at:1403" -( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +$as_echo "$at_srcdir/calc.at:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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/existing.at:1403" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $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' +(!) + (1 2) = 1 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:1403: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" -at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1403" -( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all input-lalr.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all input-lalr.y +{ set +x +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +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:681" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1403" -$at_failed && at_fn_log_failure -$at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1403" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1403" +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:681" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/existing.at:1403: bison --report=all input-lalr.y" -at_fn_check_prepare_trace "existing.at:1403" -( $at_check_trace; bison --report=all input-lalr.y +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +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:681" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/existing.at:1403: diff -u input-lalr.output input.output \\ - | sed -n '/^@@/,\$p' | sed 's/^ \$//'" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; diff -u input-lalr.output input.output \ - | sed -n '/^@@/,$p' | sed 's/^ $//' -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:1403" -$at_failed && at_fn_log_failure -$at_traceon; } +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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. -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. +# 4. If error-verbose is not used, strip the', unexpected....' part. +# 5. Check { set +x -$as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/calc.at:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $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/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/calc.at:681: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +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:681" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:1403: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:1403" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/calc.at:681: cat stderr" +at_fn_check_prepare_trace "calc.at:681" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected LEFT -" | \ - $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:1403" +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_265 -#AT_START_266 -at_fn_group_banner 266 'existing.at:1403' \ - "GNU pic (Groff 1.18.1) Grammar: IELR(1)" " " 16 +#AT_STOP_354 +#AT_START_355 +at_fn_group_banner 355 'calc.at:683' \ + "Calculator C++ %locations parse.error=verbose api.prefix={calc} %verbose %yacc" "" 14 at_xfail=no ( - $as_echo "266. $at_setup_line: testing $at_desc ..." + $as_echo "355. $at_setup_line: testing $at_desc ..." $at_traceon -cat >input.y <<'_ATEOF' + + + + + + + + +cat >calc.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -136785,580 +135017,267 @@ cat >input.y <<'_ATEOF' #undef realloc } -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); -} +/* Infix notation calculator--calc */ +%language "C++" %locations %define parse.error verbose %define api.prefix {calc} %verbose %yacc +%define global_tokens_and_yystype +%code requires +{ -%define lr.type ielr -%error-verbose + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; +} -%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 THROUGH -%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 +/* Exercise %union. */ +%union +{ + semantic_value ival; +}; +%printer { yyoutput << $$; } ; -%left '.' +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} -/* this ensures that plot 17 "%g" parses as (plot 17 "%g") */ -%left PLOT -%left TEXT SPRINTF +%code +{ +#include +#include +#define USE(Var) -/* give text adjustments higher precedence than TEXT, so that -box "foo" above ljust == box ("foo" above ljust) -*/ +FILE *input; +static int power (int base, int exponent); -%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 +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} -%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 +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp -/* 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 +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ -%left ',' -%left OROR -%left ANDAND -%left EQUALEQUAL NOTEQUAL -%left '<' '>' LESSEQUAL GREATEREQUAL +/* Grammar follows */ +%% +input: + line +| input line { } +; -%left BETWEEN OF -%left AND +line: + '\n' +| exp '\n' { USE ($1); } +; -%left '+' '-' -%left '*' '/' '%' -%right '!' -%right '^' +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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} -%% +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include -top: - optional_separator - | element_list - ; +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); -element_list: - optional_separator middle_element_list optional_separator - ; -middle_element_list: - element - | middle_element_list separator element - ; +static calc::parser::location_type last_yylloc; -optional_separator: - /* empty */ - | separator - ; +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; -separator: - ';' - | separator ';' - ; + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; -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 THROUGH - {} - DELIMITED - {} - until - | COPY THROUGH - {} - DELIMITED - {} - until - | FOR VARIABLE '=' expr TO expr optional_by DO - {} - DELIMITED - | simple_if - | simple_if ELSE - {} - DELIMITED - | reset_variables - | RESET - ; + return res; +} -reset_variables: - RESET VARIABLE - | reset_variables VARIABLE - | reset_variables ',' VARIABLE - ; +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; -print_args: - print_arg - | print_args print_arg - ; + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; -print_arg: - expr %prec ',' - | text - | position %prec ',' - ; + ungetc (c, input); +} -simple_if: - IF any_expr THEN - {} - DELIMITED - ; +static int +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c = get_char (lvalp, llocp); + int sign = 1; + int n = 0; -until: - /* empty */ - | UNTIL TEXT - ; + (void) lvalp;(void) llocp; + if (c == '-') + { + c = get_char (lvalp, llocp); + sign = -1; + } -any_expr: - expr - | text_expr - ; + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp, llocp); + } -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 - ; + unget_char (lvalp, llocp, c); -optional_by: - /* empty */ - | BY expr - | BY '*' expr - ; + return sign * n; +} -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 - ; +/*---------------------------------------------------------------. +| 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. | +`---------------------------------------------------------------*/ -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 - ; +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; -text: - TEXT - | SPRINTF '(' TEXT sprintf_args ')' - ; + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); -sprintf_args: - /* empty */ - | sprintf_args ',' expr - ; + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, llocp, c); + (*lvalp).ival = read_signed_integer (lvalp, llocp); + return NUM; + } -position: - position_not_place - | place - ; + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; -position_not_place: - expr_pair - | position '+' expr_pair - | position '-' expr_pair - | '(' position ',' position ')' - | expr between position AND position - | expr '<' position ',' position '>' - ; + /* Return single chars. */ + return c; +} -between: - BETWEEN - | OF THE WAY BETWEEN - ; +#include +#include -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 - ; +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if CALCDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} -label: - LABEL - | nth_primitive - | label '.' LABEL - ; -ordinal: - ORDINAL - | '`' any_expr TH - ; +semantic_value global_result = 0; +int global_count = 0; -optional_ordinal_last: - LAST - | ordinal LAST - ; +/* A C main function. */ +int +main (int argc, const char **argv) +{ + semantic_value result = 0; + int count = 0; + int status; -nth_primitive: - ordinal object_type - | optional_ordinal_last object_type - ; + /* 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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ -object_type: - BOX - | CIRCLE - | ELLIPSE - | ARC - | LINE - | ARROW - | SPLINE - | '[' ']' - | TEXT - ; + alarm (200); -label_path: - '.' LABEL - | label_path '.' LABEL - ; + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; -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 - ; + if (!input) + { + perror (argv[1]); + return 3; + } -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 - ; + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF -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 - ; -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -static int -yylex (void) -{ - static int const input[] = { - VARIABLE, '=', LABEL, LEFT, DOT_X, 0 - }; - static int const *inputp = input; - return *inputp++; -} -int -main (void) -{ - return yyparse (); -} -_ATEOF -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files @@ -137366,39 +135285,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:683" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:683" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1403" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:683" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -137407,16 +135326,16 @@ at_status=$? at_failed=false $at_check_filter 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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ +$as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:683" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -137425,7 +135344,7 @@ at_status=$? at_failed=false $at_check_filter 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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } @@ -137433,1094 +135352,33428 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:1403" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/calc.at:683: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:470.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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - # To avoid expanding it repeatedly, store specified stdout. - : >expout - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:683" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:683" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: +at_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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error +# 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:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" +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:683" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" $at_failed && at_fn_log_failure $at_traceon; } - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1403" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1403" +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:683" $at_failed && at_fn_log_failure $at_traceon; } - at_restore_special_files -fi +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:1403: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +$as_echo "$at_srcdir/calc.at:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "427 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +1//2 +_ATEOF + { set +x -$as_echo "$at_srcdir/existing.at:1403: diff -u /dev/null /dev/null || exit 77" -at_fn_check_prepare_trace "existing.at:1403" -( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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/existing.at:1403" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" $at_failed && at_fn_log_failure $at_traceon; } + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:1403: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" -at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1403" -( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +$as_echo "$at_srcdir/calc.at:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1403" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot --report=all input-lalr.y" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all input-lalr.y + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input-lalr.y +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +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:683" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1403" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/existing.at:1403: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1403" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1403" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/existing.at:1403: bison --report=all input-lalr.y" -at_fn_check_prepare_trace "existing.at:1403" -( $at_check_trace; bison --report=all input-lalr.y +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +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:683" $at_failed && at_fn_log_failure $at_traceon; } + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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/existing.at:1403: diff -u input-lalr.output input.output \\ - | sed -n '/^@@/,\$p' | sed 's/^ \$//'" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; diff -u input-lalr.output input.output \ - | sed -n '/^@@/,$p' | sed 's/^ $//' +$as_echo "$at_srcdir/calc.at:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "@@ -1223,7 +1223,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -1377,7 +1377,7 @@ - '!' shift, and go to state 94 +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -1854,7 +1854,7 @@ - text go to state 162 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -2047,7 +2047,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -2571,7 +2571,7 @@ - position_not_place go to state 99 - expr_pair go to state 191 - place go to state 101 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -2732,7 +2732,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -2875,7 +2875,7 @@ - '!' shift, and go to state 94 +cat >input <<'_ATEOF' - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -3018,7 +3018,7 @@ - '!' shift, and go to state 94 ++1 +_ATEOF - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -3256,7 +3256,7 @@ +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } - State 102 +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } -- 146 place: label . [\$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, AND, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '\`', ',', '>', '+', '-', '!', ';', '}', ']', ')'] -+ 146 place: label . [\$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '\`', '+', '-', '!', ';', '}', ']'] - 147 | label . corner - 153 label: label . '.' LABEL - 180 corner: . DOT_N -@@ -3645,7 +3645,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -3804,7 +3804,7 @@ - text_expr go to state 239 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -4481,7 +4481,7 @@ - \$default reduce using rule 89 (object_spec) - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -4673,7 +4673,7 @@ - \$default reduce using rule 91 (object_spec) - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -4867,7 +4867,7 @@ - \$default reduce using rule 95 (object_spec) +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -5065,7 +5065,7 @@ - \$default reduce using rule 93 (object_spec) +# 3. If locations are not used, remove them. - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -5260,7 +5260,7 @@ - '!' shift, and go to state 94 +# 4. If error-verbose is not used, strip the', unexpected....' part. - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -5403,7 +5403,7 @@ - '!' shift, and go to state 94 +# 5. Check +{ set +x +$as_echo "$at_srcdir/calc.at:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -5546,7 +5546,7 @@ - '!' shift, and go to state 94 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -5689,7 +5689,7 @@ - '!' shift, and go to state 94 +# Exercise error messages with EOF: work on an empty file. +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -6475,7 +6475,7 @@ +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - expr_pair go to state 280 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -6633,7 +6633,7 @@ - \$default reduce using rule 105 (object_spec) - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -6825,7 +6825,7 @@ - \$default reduce using rule 107 (object_spec) - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -7017,7 +7017,7 @@ - \$default reduce using rule 114 (object_spec) +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -7264,7 +7264,7 @@ - '!' shift, and go to state 94 +# 3. If locations are not used, remove them. - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -7408,7 +7408,7 @@ - \$default reduce using rule 109 (object_spec) +# 4. If error-verbose is not used, strip the', unexpected....' part. - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -7819,12 +7819,12 @@ - position_not_place go to state 296 - expr_pair go to state 100 - place go to state 297 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 - corner go to state 106 -- expr go to state 266 -+ expr go to state 424 +# 5. Check +{ set +x +$as_echo "$at_srcdir/calc.at:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } - State 165 -@@ -7987,7 +7987,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -8172,7 +8172,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -8333,7 +8333,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -8494,7 +8494,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -8655,7 +8655,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -8816,7 +8816,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -8977,7 +8977,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -9138,7 +9138,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -9299,7 +9299,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -9460,7 +9460,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -9623,7 +9623,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -9784,7 +9784,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -9921,7 +9921,7 @@ - \$default reduce using rule 47 (any_expr) +# 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 -- between go to state 237 -+ between go to state 425 +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - State 193 -@@ -10152,7 +10152,7 @@ - expr_pair go to state 317 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -10298,7 +10298,7 @@ - expr_pair go to state 318 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -10622,7 +10622,7 @@ - '!' shift, and go to state 94 +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -10765,7 +10765,7 @@ - '!' shift, and go to state 94 +# 3. If locations are not used, remove them. - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -10908,7 +10908,7 @@ - '!' shift, and go to state 94 +# 4. If error-verbose is not used, strip the', unexpected....' part. - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -11051,7 +11051,7 @@ - '!' shift, and go to state 94 +# 5. Check +{ set +x +$as_echo "$at_srcdir/calc.at:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -11194,7 +11194,7 @@ - '!' shift, and go to state 94 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -11337,7 +11337,7 @@ - '!' shift, and go to state 94 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -11480,7 +11480,7 @@ - '!' shift, and go to state 94 +# The same, but this time exercising explicitly triggered syntax errors. +# POSIX says the lookahead causing the error should not be discarded. +cat >input <<'_ATEOF' +(!) + (1 2) = 1 +_ATEOF - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -11637,7 +11637,7 @@ - position_not_place go to state 99 - expr_pair go to state 100 - place go to state 101 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -11780,7 +11780,7 @@ - '!' shift, and go to state 94 +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -11923,7 +11923,7 @@ - '!' shift, and go to state 94 +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -12066,7 +12066,7 @@ - '!' shift, and go to state 94 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -12209,7 +12209,7 @@ - '!' shift, and go to state 94 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -12352,7 +12352,7 @@ - '!' shift, and go to state 94 +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -12495,7 +12495,7 @@ - '!' shift, and go to state 94 +# 3. If locations are not used, remove them. - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -12638,7 +12638,7 @@ - '!' shift, and go to state 94 +# 4. If error-verbose is not used, strip the', unexpected....' part. - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -12794,12 +12794,12 @@ - position_not_place go to state 99 - expr_pair go to state 100 - place go to state 101 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 - corner go to state 106 -- expr go to state 266 -+ expr go to state 424 +# 5. Check +{ set +x +$as_echo "$at_srcdir/calc.at:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } - State 238 -@@ -12937,7 +12937,7 @@ - '!' shift, and go to state 94 +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -13160,7 +13160,7 @@ - text_expr go to state 342 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -13319,7 +13319,7 @@ - text_expr go to state 344 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -13502,7 +13502,7 @@ - text_expr go to state 348 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -13661,7 +13661,7 @@ - text_expr go to state 350 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -13804,7 +13804,7 @@ - '!' shift, and go to state 94 +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -14747,7 +14747,7 @@ - position_not_place go to state 99 - expr_pair go to state 191 - place go to state 101 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -15074,7 +15074,7 @@ - text go to state 113 - expr_pair go to state 365 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -15693,12 +15693,12 @@ - position_not_place go to state 99 - expr_pair go to state 100 - place go to state 101 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 - corner go to state 106 -- expr go to state 266 -+ expr go to state 424 +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - State 315 -@@ -16124,7 +16124,7 @@ - \$default reduce using rule 239 (expr) +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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 -- between go to state 237 -+ between go to state 425 +# 3. If locations are not used, remove them. - Conflict between rule 239 and token OF resolved as shift ('<' < OF). - Conflict between rule 239 and token BETWEEN resolved as shift ('<' < BETWEEN). -@@ -17234,7 +17234,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -17416,7 +17416,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -17577,7 +17577,7 @@ - text_expr go to state 112 - text go to state 113 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -17772,12 +17772,12 @@ - position_not_place go to state 99 - expr_pair go to state 100 - place go to state 101 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 - corner go to state 106 -- expr go to state 266 -+ expr go to state 424 +# 4. If error-verbose is not used, strip the', unexpected....' part. +# 5. Check +{ set +x +$as_echo "$at_srcdir/calc.at:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } - State 383 -@@ -18071,7 +18071,7 @@ - '!' shift, and go to state 94 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -18221,7 +18221,7 @@ - '!' shift, and go to state 94 - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -18830,7 +18830,7 @@ - '!' shift, and go to state 94 +# Check that yyerrok works properly: second error is not reported, +# third and fourth are. Parse status is succesfull. +cat >input <<'_ATEOF' +(* *) + (*) + (*) +_ATEOF - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -18987,7 +18987,7 @@ - '!' shift, and go to state 94 +{ set +x +$as_echo "$at_srcdir/calc.at:683: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - place go to state 114 -- label go to state 102 -+ label go to state 423 - ordinal go to state 103 - optional_ordinal_last go to state 104 - nth_primitive go to state 105 -@@ -19089,3 +19089,440 @@ - 29 placeless_element: FOR VARIABLE '=' expr TO expr optional_by DO \$@6 DELIMITED . +{ set +x +$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:683" +$at_failed && at_fn_log_failure +$at_traceon; } - \$default reduce using rule 29 (placeless_element) -+ -+ -+State 423 -+ -+ 146 place: label . [\$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', ']', ')'] -+ 147 | label . corner -+ 153 label: label . '.' LABEL -+ 180 corner: . DOT_N -+ 181 | . DOT_E -+ 182 | . DOT_W -+ 183 | . DOT_S -+ 184 | . DOT_NE -+ 185 | . DOT_SE -+ 186 | . DOT_NW -+ 187 | . DOT_SW -+ 188 | . DOT_C -+ 189 | . DOT_START -+ 190 | . DOT_END -+ 191 | . TOP -+ 192 | . BOTTOM -+ 193 | . LEFT -+ 194 | . RIGHT -+ 195 | . UPPER LEFT -+ 196 | . LOWER LEFT -+ 197 | . UPPER RIGHT -+ 198 | . LOWER RIGHT -+ 199 | . LEFT_CORNER -+ 200 | . RIGHT_CORNER -+ 201 | . UPPER LEFT_CORNER -+ 202 | . LOWER LEFT_CORNER -+ 203 | . UPPER RIGHT_CORNER -+ 204 | . LOWER RIGHT_CORNER -+ 205 | . NORTH -+ 206 | . SOUTH -+ 207 | . EAST -+ 208 | . WEST -+ 209 | . CENTER -+ 210 | . START -+ 211 | . END -+ -+ LEFT shift, and go to state 53 -+ RIGHT shift, and go to state 54 -+ DOT_N shift, and go to state 56 -+ DOT_E shift, and go to state 57 -+ DOT_W shift, and go to state 58 -+ DOT_S shift, and go to state 59 -+ DOT_NE shift, and go to state 60 -+ DOT_SE shift, and go to state 61 -+ DOT_NW shift, and go to state 62 -+ DOT_SW shift, and go to state 63 -+ DOT_C shift, and go to state 64 -+ DOT_START shift, and go to state 65 -+ DOT_END shift, and go to state 66 -+ TOP shift, and go to state 78 -+ BOTTOM shift, and go to state 79 -+ UPPER shift, and go to state 80 -+ LOWER shift, and go to state 81 -+ LEFT_CORNER shift, and go to state 82 -+ RIGHT_CORNER shift, and go to state 83 -+ NORTH shift, and go to state 84 -+ SOUTH shift, and go to state 85 -+ EAST shift, and go to state 86 -+ WEST shift, and go to state 87 -+ CENTER shift, and go to state 88 -+ END shift, and go to state 89 -+ START shift, and go to state 90 -+ '.' shift, and go to state 204 -+ -+ \$default reduce using rule 146 (place) -+ -+ corner go to state 205 -+ -+ -+State 424 -+ -+ 140 position_not_place: expr . between position AND position -+ 141 | expr . '<' position ',' position '>' -+ 142 between: . BETWEEN -+ 143 | . OF THE WAY BETWEEN -+ 144 expr_pair: expr . ',' expr -+ 219 expr: expr . '+' expr -+ 220 | expr . '-' expr -+ 221 | expr . '*' expr -+ 222 | expr . '/' expr -+ 223 | expr . '%' expr -+ 224 | expr . '^' expr -+ 239 | expr . '<' expr -+ 240 | expr . LESSEQUAL expr -+ 241 | expr . '>' expr -+ 242 | expr . GREATEREQUAL expr -+ 243 | expr . EQUALEQUAL expr -+ 244 | expr . NOTEQUAL expr -+ 245 | expr . ANDAND expr -+ 246 | expr . OROR expr -+ -+ OF shift, and go to state 220 -+ BETWEEN shift, and go to state 221 -+ ANDAND shift, and go to state 222 -+ OROR shift, and go to state 223 -+ NOTEQUAL shift, and go to state 224 -+ EQUALEQUAL shift, and go to state 225 -+ LESSEQUAL shift, and go to state 226 -+ GREATEREQUAL shift, and go to state 227 -+ ',' shift, and go to state 228 -+ '<' shift, and go to state 229 -+ '>' shift, and go to state 230 -+ '+' shift, and go to state 231 -+ '-' shift, and go to state 232 -+ '*' shift, and go to state 233 -+ '/' shift, and go to state 234 -+ '%' shift, and go to state 235 -+ '^' shift, and go to state 236 -+ + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:683: cat stderr" +at_fn_check_prepare_trace "calc.at:683" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_355 +#AT_START_356 +at_fn_group_banner 356 'calc.at:684' \ + "Calculator C++ %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14 +at_xfail=no +( + $as_echo "356. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %locations %define parse.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); + + +static calc::parser::location_type last_yylloc; + +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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; +} + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:684: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:684" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:684: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:684" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:684: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:684" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:684: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:684" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:684: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:684" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:684" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:684" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:684" +$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:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$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:684: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$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:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$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:684: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:684: cat stderr" +at_fn_check_prepare_trace "calc.at:684" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_356 +#AT_START_357 +at_fn_group_banner 357 'calc.at:686' \ + "Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc" "" 14 +at_xfail=no +( + $as_echo "357. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %locations %define parse.error verbose %debug %define api.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); + + +static calc::parser::location_type last_yylloc; + +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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; +} + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if CALCDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:686: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:686" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:686: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:686" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:686: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:686" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:686: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:686" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:686: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:686" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:686" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:686" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:686" +$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:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$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:686: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$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:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$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:686: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:686: cat stderr" +at_fn_check_prepare_trace "calc.at:686" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_357 +#AT_START_358 +at_fn_group_banner 358 'calc.at:687' \ + "Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc" "" 14 +at_xfail=no +( + $as_echo "358. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %locations %define parse.error verbose %debug %define api.prefix {calc} %define api.token.prefix {TOK_} %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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); + + +static calc::parser::location_type last_yylloc; + +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, llocp, c); + (*lvalp).ival = read_signed_integer (lvalp, llocp); + return TOK_NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return TOK_CALC_EOF; + + /* Return single chars. */ + return c; +} + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if CALCDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:687" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:687" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:687" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:687" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:687: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:687" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:687" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:687" +$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:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$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:687: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$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:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$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:687: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:687: cat stderr" +at_fn_check_prepare_trace "calc.at:687" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_358 +#AT_START_359 +at_fn_group_banner 359 'calc.at:689' \ + "Calculator C++ %defines %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14 +at_xfail=no +( + $as_echo "359. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %defines %locations %define parse.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +_ATEOF + + + +cat >calc-lex.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); + + +static calc::parser::location_type last_yylloc; + +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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 + + +cat >calc-main.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse (semantic_value *result, int *count) +{ + calc::parser parser (result, count); +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (&result, &count); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:689: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:689" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:689: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:689" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:689: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:689" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:689: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:689" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:689: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:689" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:689" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc calc.hh +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:689" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc calc.hh + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:689" +$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:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$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:689: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$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:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$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:689: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:689: cat stderr" +at_fn_check_prepare_trace "calc.at:689" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_359 +#AT_START_360 +at_fn_group_banner 360 'calc.at:691' \ + "Calculator C++ parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14 +at_xfail=no +( + $as_echo "360. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %define parse.error verbose %debug %define api.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include + +int calclex (calc::parser::semantic_type *lvalp); +static int get_char (calc::parser::semantic_type *lvalp); +static void unget_char (calc::parser::semantic_type *lvalp, int c); + + +static int +get_char (calc::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } + + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } + + unget_char (lvalp, 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 (calc::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; + + /* Return single chars. */ + return c; +} + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse (semantic_value *result, int *count) +{ + calc::parser parser (result, count); +#if CALCDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (&result, &count); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:691: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:691" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:691: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:691" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:691: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:691" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:691: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:691" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:691: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:691" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:691" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:691" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:691" +$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:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$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:691: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$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:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$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:691: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:691: cat stderr" +at_fn_check_prepare_trace "calc.at:691" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_360 +#AT_START_361 +at_fn_group_banner 361 'calc.at:692' \ + "Calculator C++ %defines %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14 +at_xfail=no +( + $as_echo "361. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %defines %locations %define parse.error verbose %debug %define api.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +_ATEOF + + + +cat >calc-lex.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); + + +static calc::parser::location_type last_yylloc; + +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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 + + +cat >calc-main.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse (semantic_value *result, int *count) +{ + calc::parser parser (result, count); +#if CALCDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (&result, &count); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:692: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:692" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:692: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:692" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:692: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:692" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:692: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:692" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:692: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:692" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:692" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc calc.hh +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:692" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc calc.hh + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:692" +$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:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$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:692: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$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:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$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:692: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:692: cat stderr" +at_fn_check_prepare_trace "calc.at:692" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_361 +#AT_START_362 +at_fn_group_banner 362 'calc.at:703' \ + "Calculator glr.cc" " " 15 +at_xfail=no +( + $as_echo "362. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%skeleton "glr.cc" +%define global_tokens_and_yystype +%code requires +{ + + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; +} + +/* Exercise %union. */ +%union +{ + semantic_value ival; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int yylex (yy::parser::semantic_type *lvalp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include + +int yylex (yy::parser::semantic_type *lvalp); +static int get_char (yy::parser::semantic_type *lvalp); +static void unget_char (yy::parser::semantic_type *lvalp, int c); + + +static int +get_char (yy::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + + return res; +} + +static void +unget_char (yy::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; + + ungetc (c, input); +} + +static int +read_signed_integer (yy::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } + + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } + + unget_char (lvalp, 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 (yy::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; + + /* Return single chars. */ + return c; +} + +#include +#include + + +/* A C++ yyparse that simulates the C signature. */ +int +yyparse () +{ + yy::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:703: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:703" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:703: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:703" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:703: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:703" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:703: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:703" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:703: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:703" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:703" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:703" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:703" +$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:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$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:703: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$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:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$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:703: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:703: cat stderr" +at_fn_check_prepare_trace "calc.at:703" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_362 +#AT_START_363 +at_fn_group_banner 363 'calc.at:712' \ + "Calculator C++ %glr-parser " " " 15 +at_xfail=no +( + $as_echo "363. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser +%define global_tokens_and_yystype +%code requires +{ + + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; +} + +/* Exercise %union. */ +%union +{ + semantic_value ival; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int yylex (yy::parser::semantic_type *lvalp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include + +int yylex (yy::parser::semantic_type *lvalp); +static int get_char (yy::parser::semantic_type *lvalp); +static void unget_char (yy::parser::semantic_type *lvalp, int c); + + +static int +get_char (yy::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + + return res; +} + +static void +unget_char (yy::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; + + ungetc (c, input); +} + +static int +read_signed_integer (yy::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } + + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } + + unget_char (lvalp, 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 (yy::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; + + /* Return single chars. */ + return c; +} + +#include +#include + + +/* A C++ yyparse that simulates the C signature. */ +int +yyparse () +{ + yy::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:712" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:712" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:712: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:712" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:712: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:712" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:712: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:712" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:712" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:712" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:712" +$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:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$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:712: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$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:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$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:712: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:712: cat stderr" +at_fn_check_prepare_trace "calc.at:712" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_363 +#AT_START_364 +at_fn_group_banner 364 'calc.at:713' \ + "Calculator C++ %glr-parser %locations" " " 15 +at_xfail=no +( + $as_echo "364. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %locations +%define global_tokens_and_yystype +%code requires +{ + + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; +} + +/* Exercise %union. */ +%union +{ + semantic_value ival; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include + +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); + + +static yy::parser::location_type last_yylloc; + +static int +get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *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 (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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; +} + +#include +#include + + +/* A C++ yyparse that simulates the C signature. */ +int +yyparse () +{ + yy::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:713" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:713" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.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' "calc.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:713: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:713" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:713" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:713" +$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:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$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:713: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$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:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$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:713: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:713: cat stderr" +at_fn_check_prepare_trace "calc.at:713" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_364 +#AT_START_365 +at_fn_group_banner 365 'calc.at:714' \ + "Calculator C++ %glr-parser %locations api.location.type={Span}" "" 15 +at_xfail=no +( + $as_echo "365. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %locations %define api.location.type {Span} +%define global_tokens_and_yystype +%code requires +{ + +# include + struct Point + { + int l; + int c; + }; + + struct Span + { + Point first; + Point last; + }; + +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first = YYRHSLOC (Rhs, 1).first; \ + (Current).last = YYRHSLOC (Rhs, N).last; \ + } \ + else \ + { \ + (Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \ + } \ + while (false) + + + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; +} + +/* Exercise %union. */ +%union +{ + semantic_value ival; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} + + +%initial-action +{ + @$.first.l = @$.first.c = 1; + @$.last = @$.first; +} + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + + std::ostream& + operator<< (std::ostream& o, const Span& s) + { + o << s.first.l << '.' << s.first.c; + if (s.first.l != s.last.l) + o << '-' << s.last.l << '.' << s.last.c - 1; + else if (s.first.c != s.last.c - 1) + o << '-' << s.last.c - 1; + return o; + } + +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include + +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c); + + +static yy::parser::location_type last_yylloc; + +static int +get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).last.l++; + (*llocp).last.c = 1; + } + else + (*llocp).last.c++; + + return res; +} + +static void +unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *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 (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).first.c = (*llocp).last.c; + (*llocp).first.l = (*llocp).last.l; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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; +} + +#include +#include + + +/* A C++ yyparse that simulates the C signature. */ +int +yyparse () +{ + yy::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:714" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:714" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:714" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:714" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:714: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:714" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:714" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:714" +$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:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$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:714: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$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:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$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:714: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:714: cat stderr" +at_fn_check_prepare_trace "calc.at:714" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_365 +#AT_START_366 +at_fn_group_banner 366 'calc.at:715' \ + "Calculator C++ %glr-parser %defines parse.error=verbose %name-prefix \"calc\" %verbose %yacc" "" 15 +at_xfail=no +( + $as_echo "366. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %defines %define parse.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +_ATEOF + + + +cat >calc-lex.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include + +int calclex (calc::parser::semantic_type *lvalp); +static int get_char (calc::parser::semantic_type *lvalp); +static void unget_char (calc::parser::semantic_type *lvalp, int c); + + +static int +get_char (calc::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } + + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } + + unget_char (lvalp, 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 (calc::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; + + /* Return single chars. */ + return c; +} +_ATEOF + + +cat >calc-main.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:715: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:715" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:715: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:715" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:715: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:715" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:715: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:715" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:715: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:715" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:715" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc calc.hh +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:715" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc calc.hh + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:715" +$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:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$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:715: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$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:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$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:715: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:715: cat stderr" +at_fn_check_prepare_trace "calc.at:715" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_366 +#AT_START_367 +at_fn_group_banner 367 'calc.at:716' \ + "Calculator C++ %glr-parser parse.error=verbose api.prefix={calc} %verbose %yacc" "" 15 +at_xfail=no +( + $as_echo "367. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %define parse.error verbose %define api.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include + +int calclex (calc::parser::semantic_type *lvalp); +static int get_char (calc::parser::semantic_type *lvalp); +static void unget_char (calc::parser::semantic_type *lvalp, int c); + + +static int +get_char (calc::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } + + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } + + unget_char (lvalp, 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 (calc::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; + + /* Return single chars. */ + return c; +} + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if CALCDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:716" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:716" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:716" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:716" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:716: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:716" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:716" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:716" +$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:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$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:716: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$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:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$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:716: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:716: cat stderr" +at_fn_check_prepare_trace "calc.at:716" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_367 +#AT_START_368 +at_fn_group_banner 368 'calc.at:718' \ + "Calculator C++ %glr-parser %debug" " " 15 +at_xfail=no +( + $as_echo "368. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %debug +%define global_tokens_and_yystype +%code requires +{ + + /* Exercise pre-prologue dependency to %union. */ + typedef int semantic_value; +} + +/* Exercise %union. */ +%union +{ + semantic_value ival; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int yylex (yy::parser::semantic_type *lvalp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include + +int yylex (yy::parser::semantic_type *lvalp); +static int get_char (yy::parser::semantic_type *lvalp); +static void unget_char (yy::parser::semantic_type *lvalp, int c); + + +static int +get_char (yy::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + + return res; +} + +static void +unget_char (yy::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; + + ungetc (c, input); +} + +static int +read_signed_integer (yy::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } + + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } + + unget_char (lvalp, 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 (yy::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; + + /* Return single chars. */ + return c; +} + +#include +#include + + +/* A C++ yyparse that simulates the C signature. */ +int +yyparse () +{ + yy::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = yyparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:718" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:718" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:718" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:718" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:718: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:718" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:718" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:718" +$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:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$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:718: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$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:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$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:718: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:718: cat stderr" +at_fn_check_prepare_trace "calc.at:718" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_368 +#AT_START_369 +at_fn_group_banner 369 'calc.at:720' \ + "Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 15 +at_xfail=no +( + $as_echo "369. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %define parse.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include + +int calclex (calc::parser::semantic_type *lvalp); +static int get_char (calc::parser::semantic_type *lvalp); +static void unget_char (calc::parser::semantic_type *lvalp, int c); + + +static int +get_char (calc::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } + + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } + + unget_char (lvalp, 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 (calc::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return CALC_EOF; + + /* Return single chars. */ + return c; +} + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:720: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:720" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:720: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:720" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.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' "calc.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:720: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:720" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:720" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:720" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:720" +$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:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$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:720: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$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:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$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:720: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:720: cat stderr" +at_fn_check_prepare_trace "calc.at:720" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_369 +#AT_START_370 +at_fn_group_banner 370 'calc.at:721' \ + "Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc" "" 15 +at_xfail=no +( + $as_echo "370. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %define parse.error verbose %debug %name-prefix "calc" %define api.token.prefix {TOK_} %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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include + +int calclex (calc::parser::semantic_type *lvalp); +static int get_char (calc::parser::semantic_type *lvalp); +static void unget_char (calc::parser::semantic_type *lvalp, int c); + + +static int +get_char (calc::parser::semantic_type *lvalp) +{ + int res = getc (input); + (void) lvalp;; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, int c) +{ + (void) lvalp;; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp) +{ + int c = get_char (lvalp); + int sign = 1; + int n = 0; + + (void) lvalp;; + if (c == '-') + { + c = get_char (lvalp); + sign = -1; + } + + while (isdigit (c)) + { + n = 10 * n + (c - '0'); + c = get_char (lvalp); + } + + unget_char (lvalp, 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 (calc::parser::semantic_type *lvalp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + + } + while ((c = get_char (lvalp)) == ' ' || c == '\t'); + + /* process numbers */ + if (c == '.' || isdigit (c)) + { + unget_char (lvalp, c); + (*lvalp).ival = read_signed_integer (lvalp); + return TOK_NUM; + } + + /* Return end-of-file. */ + if (c == EOF) + return TOK_CALC_EOF; + + /* Return single chars. */ + return c; +} + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse () +{ + calc::parser parser; +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:721" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:721" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:721: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:721" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:721: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:721" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:721: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:721" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:721" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:721" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:721" +$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:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$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:721: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$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:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$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:721: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:721: cat stderr" +at_fn_check_prepare_trace "calc.at:721" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_370 +#AT_START_371 +at_fn_group_banner 371 'calc.at:723' \ + "Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 15 +at_xfail=no +( + $as_echo "371. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %locations %defines %define parse.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +_ATEOF + + + +cat >calc-lex.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); + + +static calc::parser::location_type last_yylloc; + +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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 + + +cat >calc-main.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse (semantic_value *result, int *count) +{ + calc::parser parser (result, count); +#if YYDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (&result, &count); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:723" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:723" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:723: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:723" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:723: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:723" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:723: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:723" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:723" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc calc.hh +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:723" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc calc.hh + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:723" +$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:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$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:723: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$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:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$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:723: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:723: cat stderr" +at_fn_check_prepare_trace "calc.at:723" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_371 +#AT_START_372 +at_fn_group_banner 372 'calc.at:724' \ + "Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 15 +at_xfail=no +( + $as_echo "372. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + + + +cat >calc.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +/* Infix notation calculator--calc */ +%language "C++" %glr-parser %locations %defines %define parse.error verbose %debug %define api.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; +}; +%printer { yyoutput << $$; } ; + +%code provides +{ + #include + /* The input. */ + extern FILE *input; + extern semantic_value global_result; + extern int global_count; +} + +%code +{ +#include +#include +#define USE(Var) + +FILE *input; +static int power (int base, int exponent); + + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +} + + + +/* Bison Declarations */ +%token CALC_EOF 0 "end of input" +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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 int +power (int base, int exponent) +{ + int res = 1; + assert (0 <= exponent); + for (/* Niente */; exponent; --exponent) + res *= base; + return res; +} + + +/* A C++ error reporting function. */ +void +calc::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +_ATEOF + + + +cat >calc-lex.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include + +int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); +static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c); + + +static calc::parser::location_type last_yylloc; + +static int +get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int res = getc (input); + (void) lvalp;(void) llocp; + + last_yylloc = (*llocp); + if (res == '\n') + { + (*llocp).end.line++; + (*llocp).end.column = 1; + } + else + (*llocp).end.column++; + + return res; +} + +static void +unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp, int c) +{ + (void) lvalp;(void) llocp; + + /* Wrong when C == '\n'. */ + (*llocp) = last_yylloc; + + ungetc (c, input); +} + +static int +read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) +{ + int c; + /* Skip current token, then white spaces. */ + do + { + (*llocp).begin.column = (*llocp).end.column; + (*llocp).begin.line = (*llocp).end.line; + + } + while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t'); + + /* 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 + + +cat >calc-main.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "calc.hh" + +#include +#include + + +/* A C++ calcparse that simulates the C signature. */ +int +calcparse (semantic_value *result, int *count) +{ + calc::parser parser (result, count); +#if CALCDEBUG + parser.set_debug_level (1); +#endif + return parser.parse (); +} + + +semantic_value global_result = 0; +int global_count = 0; + +/* A C main function. */ +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 was enough for regular users, + but the Hydra build farm, which is heavily loaded needs more. */ + + alarm (200); + + if (argc == 2) + input = fopen (argv[1], "r"); + else + input = stdin; + + if (!input) + { + perror (argv[1]); + return 3; + } + + + status = calcparse (&result, &count); + if (fclose (input)) + perror ("fclose"); + assert (global_result == result); (void) result; + assert (global_count == count); (void) count; + return status; +} +_ATEOF + + + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:724" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/calc.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:724" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/calc.at:724: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:724" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/calc.at:724: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:724" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/calc.at:724: bison -fno-caret -o calc.cc calc.y" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; bison -fno-caret -o calc.cc calc.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:724" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:724" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$PERL -ne ' + chomp; + print \"\$ARGV:\$.: {\$_}\\n\" + if (# No starting/ending empty lines. + (eof || \$. == 1) && /^\\s*\$/ + # No trailing space. + || /\\s\$/ + # No tabs. + || /\\t/ + )' calc.cc calc.hh +" +at_fn_check_prepare_notrace 'an embedded newline' "calc.at:724" +( $at_check_trace; $PERL -ne ' + chomp; + print "$ARGV:$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. + || /\s$/ + # No tabs. + || /\t/ + )' calc.cc calc.hh + +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:724" +$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:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Some syntax errors. +cat >input <<'_ATEOF' +1 2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$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:724: \$PREPARSER ./calc /dev/null" +at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc /dev/null +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$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:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$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' +(!) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + +cat >input <<'_ATEOF' +(- *) + (1 2) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/calc.at:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$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:724: \$PREPARSER ./calc input" +at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724" +( $at_check_trace; $PREPARSER ./calc input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Remove the traces from observed. +sed '/^Starting/d +/^Entering/d +/^Stack/d +/^Reading/d +/^Reducing/d +/^Return/d +/^Shifting/d +/^state/d +/^Cleanup:/d +/^Error:/d +/^Next/d +/^Now/d +/^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:724: cat stderr" +at_fn_check_prepare_trace "calc.at:724" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_372 +#AT_START_373 +at_fn_group_banner 373 'torture.at:132' \ + "Big triangle" " " 16 +at_xfail=no +( + $as_echo "373. $at_setup_line: testing $at_desc ..." + $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 < +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%error-verbose +%debug +%{ +#include +#include +#include +#define MAX $max +static int yylex (void); +#include + +static void yyerror (const char *msg); +%} +%union +{ + int val; +}; + +%token END "end" +%type exp input +EOF + +for my $size (1 .. $max) + { + print "%token t$size $size \"$size\"\n"; + }; + +print < MAX) + return 0; + else if (inner > outer) + { + inner = 1; + ++outer; + return END; + } + return inner++; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +EOF +_ATEOF + + + +{ set +x +$as_echo "$at_srcdir/torture.at:138: \$PERL -w ./gengram.pl 200 || exit 77" +at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 200 || exit 77" "torture.at:138" +( $at_check_trace; $PERL -w ./gengram.pl 200 || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:138" +$at_failed && at_fn_log_failure +$at_traceon; } + +mv stdout input.y + +{ set +x +$as_echo "$at_srcdir/torture.at:139: bison -fno-caret -v -o input.c input.y" +at_fn_check_prepare_trace "torture.at:139" +( $at_check_trace; bison -fno-caret -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:139" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:140: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:140" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:140" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:140: \$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:140" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:140" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:141: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:141" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:141" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:141: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:141" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:141" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_373 +#AT_START_374 +at_fn_group_banner 374 'torture.at:216' \ + "Big horizontal" " " 16 +at_xfail=no +( + $as_echo "374. $at_setup_line: testing $at_desc ..." + $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 < +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%error-verbose +%debug +%{ +#include +#include +#define MAX $max +static int yylex (void); +#include + +static void yyerror (const char *msg); +%} + +%token +EOF +for my $size (1 .. $max) + { + print " t$size $size \"$size\"\n"; + }; + +print < + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int counter = 1; + if (counter <= MAX) + return counter++; + assert (counter++ == MAX + 1); + return 0; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +EOF +_ATEOF + + +{ set +x +$as_echo "$at_srcdir/torture.at:230: \$PERL -w ./gengram.pl 1000 || exit 77" +at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:230" +( $at_check_trace; $PERL -w ./gengram.pl 1000 || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:230" +$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:234: ulimit -S -d 204000 || exit 77" +at_fn_check_prepare_trace "torture.at:234" +( $at_check_trace; ulimit -S -d 204000 || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:234" +$at_failed && at_fn_log_failure +$at_traceon; } + + ulimit -S -d 204000 + fi +esac + +{ set +x +$as_echo "$at_srcdir/torture.at:236: bison -fno-caret -v -o input.c input.y" +at_fn_check_prepare_trace "torture.at:236" +( $at_check_trace; bison -fno-caret -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:236" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:237: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:237" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:237" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:237: \$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:237" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:237" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:238: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:238" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:238" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:238: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:238" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:238" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_374 +#AT_START_375 +at_fn_group_banner 375 'torture.at:348' \ + "Many lookahead tokens" " " 16 +at_xfail=no +( + $as_echo "375. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >gengram.pl <<'_ATEOF' +#! /usr/bin/perl -w + +use strict; +use Text::Wrap; +my $max = $ARGV[0] || 10; + +print < +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +# include +# include +# include +# define MAX $max +static int yylex (void); +#include + +static void yyerror (const char *msg); +%} +%union +{ + int val; +}; + +%type input exp +%token token +EOF + +print + wrap ("%type ", + " ", + map { "n$_" } (1 .. $max)), + "\n"; + +print "%token\n"; +for my $count (1 .. $max) + { + print " t$count $count \"$count\"\n"; + }; + +print < MAX) + { + assert (counter++ == MAX + 1); + return 0; + } + if (return_token) + { + return_token = 0; + return token; + } + return_token = 1; + return counter++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +EOF +_ATEOF + + +{ set +x +$as_echo "$at_srcdir/torture.at:350: \$PERL -w ./gengram.pl 1000 || exit 77" +at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:350" +( $at_check_trace; $PERL -w ./gengram.pl 1000 || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:350" +$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:354: ulimit -S -d 204000 || exit 77" +at_fn_check_prepare_trace "torture.at:354" +( $at_check_trace; ulimit -S -d 204000 || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:354" +$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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:356: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:356" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:356" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/torture.at:356: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "torture.at:356" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:356" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/torture.at:356: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:356" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:356" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/torture.at:356: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:356" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:356" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/torture.at:356: bison -fno-caret -v -o input.c input.y" +at_fn_check_prepare_trace "torture.at:356" +( $at_check_trace; bison -fno-caret -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:356" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:357: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:357" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:357" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:357: \$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:357" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:357" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:358: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:358" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:358" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:358" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:358" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_375 +#AT_START_376 +at_fn_group_banner 376 'torture.at:450' \ + "Exploding the Stack Size with Alloca" " " 16 +at_xfail=no +( + $as_echo "376. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + +# A grammar of parens growing the stack thanks to right recursion. +# exp: +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +#include +#include +#include +#include + +#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); + #include + +static void yyerror (const char *msg); +%} + +%error-verbose +%debug +%token WAIT_FOR_EOF +%% +exp: WAIT_FOR_EOF exp | ; +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static int +yylex (void) +{ + assert (0 <= yylval); + if (yylval--) + return WAIT_FOR_EOF; + else + return EOF; +} + +/* Return argv[1] as an int. */ +static int +get_args (int argc, const char **argv) +{ + int res; + char *endp; + assert (argc == 2); (void) argc; + res = strtol (argv[1], &endp, 10); + assert (argv[1] != endp); + assert (0 <= res); + assert (res <= INT_MAX); + assert (errno != ERANGE); + return res; +} + +int +main (int argc, const char **argv) +{ + YYSTYPE yylval_init = get_args (argc, argv); + int status = 0; + int count; + yydebug = 1; + for (count = 0; count < 2; ++count) + { + int new_status; + yylval = yylval_init; + new_status = yyparse (); + if (count == 0) + status = new_status; + else + assert (new_status == status); + } + return status; +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:459: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:459" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:459" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/torture.at:459: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:459" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:459" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/torture.at:459: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:459" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:459" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/torture.at:459: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:459" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:459" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/torture.at:459: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "torture.at:459" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:459" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:459: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:459" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:459" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:459: \$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:459" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:459" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Below the limit of 200. +{ set +x +$as_echo "$at_srcdir/torture.at:463: 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:463" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:463" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:463: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:463" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:463" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Two enlargements: 2 * 2 * 200. +{ set +x +$as_echo "$at_srcdir/torture.at:466: 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:466" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:466" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:466: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:466" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:466" +$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:470: 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:470" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/torture.at:470" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:470: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:470" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:470" +$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' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +#include +#include +#include +#include + +#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); + #include + +static void yyerror (const char *msg); +%} +%define api.push-pull both + +%error-verbose +%debug +%token WAIT_FOR_EOF +%% +exp: WAIT_FOR_EOF exp | ; +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static int +yylex (void) +{ + assert (0 <= yylval); + if (yylval--) + return WAIT_FOR_EOF; + else + return EOF; +} + +/* Return argv[1] as an int. */ +static int +get_args (int argc, const char **argv) +{ + int res; + char *endp; + assert (argc == 2); (void) argc; + res = strtol (argv[1], &endp, 10); + assert (argv[1] != endp); + assert (0 <= res); + assert (res <= INT_MAX); + assert (errno != ERANGE); + return res; +} + +int +main (int argc, const char **argv) +{ + YYSTYPE yylval_init = get_args (argc, argv); + int status = 0; + int count; + yypstate *ps = yypstate_new (); + yydebug = 1; + for (count = 0; count < 2; ++count) + { + int new_status; + yylval = yylval_init; + new_status = yypull_parse (ps); + if (count == 0) + status = new_status; + else + assert (new_status == status); + } + yypstate_delete (ps); + return status; +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:477: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:477" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:477" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/torture.at:477: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:477" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:477" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/torture.at:477: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:477" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:477" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/torture.at:477: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:477" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:477" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/torture.at:477: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "torture.at:477" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:477" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:477: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:477" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:477" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:477: \$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:477" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:477" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:479: 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:479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:479" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:479: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:479" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:481: 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:481" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:481" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:481: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:481" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:481" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:483: 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:483" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/torture.at:483" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:483: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:483" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:483" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_376 +#AT_START_377 +at_fn_group_banner 377 'torture.at:496' \ + "Exploding the Stack Size with Malloc" " " 16 +at_xfail=no +( + $as_echo "377. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + +# A grammar of parens growing the stack thanks to right recursion. +# exp: +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +#include +#include +#include +#include +#define YYSTACK_USE_ALLOCA 0 + static int yylex (void); + #include + +static void yyerror (const char *msg); +%} + +%error-verbose +%debug +%token WAIT_FOR_EOF +%% +exp: WAIT_FOR_EOF exp | ; +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static int +yylex (void) +{ + assert (0 <= yylval); + if (yylval--) + return WAIT_FOR_EOF; + else + return EOF; +} + +/* Return argv[1] as an int. */ +static int +get_args (int argc, const char **argv) +{ + int res; + char *endp; + assert (argc == 2); (void) argc; + res = strtol (argv[1], &endp, 10); + assert (argv[1] != endp); + assert (0 <= res); + assert (res <= INT_MAX); + assert (errno != ERANGE); + return res; +} + +int +main (int argc, const char **argv) +{ + YYSTYPE yylval_init = get_args (argc, argv); + int status = 0; + int count; + yydebug = 1; + for (count = 0; count < 2; ++count) + { + int new_status; + yylval = yylval_init; + new_status = yyparse (); + if (count == 0) + status = new_status; + else + assert (new_status == status); + } + return status; +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:500" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:500" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/torture.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:500" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:500" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/torture.at:500: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:500" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:500" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/torture.at:500: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:500" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:500" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/torture.at:500: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "torture.at:500" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:500" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:500: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:500" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:500" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:500: \$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:500" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:500" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Below the limit of 200. +{ set +x +$as_echo "$at_srcdir/torture.at:504: 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:504" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:504" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:504: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:504" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:504" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Two enlargements: 2 * 2 * 200. +{ set +x +$as_echo "$at_srcdir/torture.at:507: 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:507" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:507" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:507: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:507" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:507" +$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:511: 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:511" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/torture.at:511" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:511: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:511" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:511" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# A grammar of parens growing the stack thanks to right recursion. +# exp: +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +#include +#include +#include +#include +#define YYSTACK_USE_ALLOCA 0 + static int yylex (void); + #include + +static void yyerror (const char *msg); +%} +%define api.push-pull both + +%error-verbose +%debug +%token WAIT_FOR_EOF +%% +exp: WAIT_FOR_EOF exp | ; +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static int +yylex (void) +{ + assert (0 <= yylval); + if (yylval--) + return WAIT_FOR_EOF; + else + return EOF; +} + +/* Return argv[1] as an int. */ +static int +get_args (int argc, const char **argv) +{ + int res; + char *endp; + assert (argc == 2); (void) argc; + res = strtol (argv[1], &endp, 10); + assert (argv[1] != endp); + assert (0 <= res); + assert (res <= INT_MAX); + assert (errno != ERANGE); + return res; +} + +int +main (int argc, const char **argv) +{ + YYSTYPE yylval_init = get_args (argc, argv); + int status = 0; + int count; + yypstate *ps = yypstate_new (); + yydebug = 1; + for (count = 0; count < 2; ++count) + { + int new_status; + yylval = yylval_init; + new_status = yypull_parse (ps); + if (count == 0) + status = new_status; + else + assert (new_status == status); + } + yypstate_delete (ps); + return status; +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:515" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:515" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/torture.at:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:515" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:515" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/torture.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' "torture.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:515" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/torture.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "torture.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:515" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/torture.at:515: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "torture.at:515" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:515" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:515: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:515" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:515" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:515: \$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:515" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:515" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:517: 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:517" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:517" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:517: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:517" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:517" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:519: 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:519" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/torture.at:519" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:519: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:519" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:519" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/torture.at:521: 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:521" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/torture.at:521" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/torture.at:521: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "torture.at:521" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:521" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_377 +#AT_START_378 +at_fn_group_banner 378 'existing.at:800' \ + "GNU AWK 3.1.0 Grammar: LALR(1)" " " 17 +at_xfail=no +( + $as_echo "378. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type lalr +%error-verbose + +%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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:800: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:800" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:800: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:800" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:800: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule] +input.y:169.8: warning: empty rule without %empty [-Wempty-rule] +input.y:174.12: warning: empty rule without %empty [-Wempty-rule] +input.y:179.13: warning: empty rule without %empty [-Wempty-rule] +input.y:187.15: warning: empty rule without %empty [-Wempty-rule] +input.y:201.8: warning: empty rule without %empty [-Wempty-rule] +input.y:206.21: warning: empty rule without %empty [-Wempty-rule] +input.y:220.20: warning: empty rule without %empty [-Wempty-rule] +input.y:299.13: warning: empty rule without %empty [-Wempty-rule] +input.y:322.9: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr] +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] +" | \ + $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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:66.10: warning: empty rule without %empty [-Wempty-rule] +input.y:169.8: warning: empty rule without %empty [-Wempty-rule] +input.y:174.12: warning: empty rule without %empty [-Wempty-rule] +input.y:179.13: warning: empty rule without %empty [-Wempty-rule] +input.y:187.15: warning: empty rule without %empty [-Wempty-rule] +input.y:201.8: warning: empty rule without %empty [-Wempty-rule] +input.y:206.21: warning: empty rule without %empty [-Wempty-rule] +input.y:220.20: warning: empty rule without %empty [-Wempty-rule] +input.y:299.13: warning: empty rule without %empty [-Wempty-rule] +input.y:322.9: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr] +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:800: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:800" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:800: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:800" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "319 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: diff -u /dev/null /dev/null || exit 77" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" +at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:800" +( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --report=all input-lalr.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:800: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:800" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:800: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:800" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:800: bison -fno-caret --report=all input-lalr.y" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; bison -fno-caret --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: diff -u input-lalr.output input.output \\ + | sed -n '/^@@/,\$p' | sed 's/^ \$//'" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:800" +( $at_check_trace; diff -u input-lalr.output input.output \ + | sed -n '/^@@/,$p' | sed 's/^ $//' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. + +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:800" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:800" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:800" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "syntax error, unexpected '*', expecting NEWLINE or '{' or ';' +" | \ + $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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_378 +#AT_START_379 +at_fn_group_banner 379 'existing.at:800' \ + "GNU AWK 3.1.0 Grammar: IELR(1)" " " 17 +at_xfail=no +( + $as_echo "379. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type ielr +%error-verbose + +%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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:800: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:800" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:800: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:800" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:800: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule] +input.y:169.8: warning: empty rule without %empty [-Wempty-rule] +input.y:174.12: warning: empty rule without %empty [-Wempty-rule] +input.y:179.13: warning: empty rule without %empty [-Wempty-rule] +input.y:187.15: warning: empty rule without %empty [-Wempty-rule] +input.y:201.8: warning: empty rule without %empty [-Wempty-rule] +input.y:206.21: warning: empty rule without %empty [-Wempty-rule] +input.y:220.20: warning: empty rule without %empty [-Wempty-rule] +input.y:299.13: warning: empty rule without %empty [-Wempty-rule] +input.y:322.9: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr] +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] +" | \ + $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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:66.10: warning: empty rule without %empty [-Wempty-rule] +input.y:169.8: warning: empty rule without %empty [-Wempty-rule] +input.y:174.12: warning: empty rule without %empty [-Wempty-rule] +input.y:179.13: warning: empty rule without %empty [-Wempty-rule] +input.y:187.15: warning: empty rule without %empty [-Wempty-rule] +input.y:201.8: warning: empty rule without %empty [-Wempty-rule] +input.y:206.21: warning: empty rule without %empty [-Wempty-rule] +input.y:220.20: warning: empty rule without %empty [-Wempty-rule] +input.y:299.13: warning: empty rule without %empty [-Wempty-rule] +input.y:322.9: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr] +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:800: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:800" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:800: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:800" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "328 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: diff -u /dev/null /dev/null || exit 77" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" +at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:800" +( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --report=all input-lalr.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:800: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:800" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:800: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:800" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:800: bison -fno-caret --report=all input-lalr.y" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; bison -fno-caret --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: diff -u input-lalr.output input.output \\ + | sed -n '/^@@/,\$p' | sed 's/^ \$//'" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:800" +( $at_check_trace; diff -u input-lalr.output input.output \ + | sed -n '/^@@/,$p' | sed 's/^ $//' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "@@ -712,7 +712,7 @@ + 156 | . '\$' non_post_simp_exp + + NAME shift, and go to state 9 +- '\$' shift, and go to state 24 ++ '\$' shift, and go to state 320 + + NAME [reduce using rule 152 (opt_variable)] + '\$' [reduce using rule 152 (opt_variable)] +@@ -5379,7 +5379,7 @@ + 156 | . '\$' non_post_simp_exp + + NAME shift, and go to state 9 +- '\$' shift, and go to state 24 ++ '\$' shift, and go to state 320 + + NAME [reduce using rule 152 (opt_variable)] + '\$' [reduce using rule 152 (opt_variable)] +@@ -5399,7 +5399,7 @@ + 156 | . '\$' non_post_simp_exp + + NAME shift, and go to state 9 +- '\$' shift, and go to state 24 ++ '\$' shift, and go to state 320 + + NAME [reduce using rule 152 (opt_variable)] + '\$' [reduce using rule 152 (opt_variable)] +@@ -6214,7 +6214,7 @@ + 156 | . '\$' non_post_simp_exp + + NAME shift, and go to state 9 +- '\$' shift, and go to state 24 ++ '\$' shift, and go to state 320 + + NAME [reduce using rule 152 (opt_variable)] + '\$' [reduce using rule 152 (opt_variable)] +@@ -11099,3 +11099,274 @@ + 45 statement: LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement . + + \$default reduce using rule 45 (statement) ++ ++ ++State 320 ++ ++ 139 non_post_simp_exp: . '!' simp_exp ++ 140 | . '(' exp r_paren ++ 141 | . LEX_BUILTIN '(' opt_expression_list r_paren ++ 142 | . LEX_LENGTH '(' opt_expression_list r_paren ++ 143 | . LEX_LENGTH ++ 144 | . FUNC_CALL '(' opt_expression_list r_paren ++ 145 | . variable ++ 146 | . INCREMENT variable ++ 147 | . DECREMENT variable ++ 148 | . YNUMBER ++ 149 | . YSTRING ++ 150 | . '-' simp_exp ++ 151 | . '+' simp_exp ++ 154 variable: . NAME ++ 155 | . NAME '[' expression_list ']' ++ 156 | . '\$' non_post_simp_exp ++ 156 | '\$' . non_post_simp_exp ++ ++ FUNC_CALL shift, and go to state 8 ++ NAME shift, and go to state 9 ++ YNUMBER shift, and go to state 10 ++ YSTRING shift, and go to state 11 ++ INCREMENT shift, and go to state 321 ++ DECREMENT shift, and go to state 322 ++ LEX_BUILTIN shift, and go to state 18 ++ LEX_LENGTH shift, and go to state 19 ++ '+' shift, and go to state 323 ++ '-' shift, and go to state 324 ++ '!' shift, and go to state 325 ++ '\$' shift, and go to state 320 ++ '(' shift, and go to state 55 ++ ++ non_post_simp_exp go to state 62 ++ variable go to state 63 ++ ++ ++State 321 ++ ++ 146 non_post_simp_exp: INCREMENT . variable ++ 154 variable: . NAME ++ 155 | . NAME '[' expression_list ']' ++ 156 | . '\$' non_post_simp_exp ++ ++ NAME shift, and go to state 9 ++ '\$' shift, and go to state 320 ++ ++ variable go to state 50 ++ ++ ++State 322 ++ ++ 147 non_post_simp_exp: DECREMENT . variable ++ 154 variable: . NAME ++ 155 | . NAME '[' expression_list ']' ++ 156 | . '\$' non_post_simp_exp ++ ++ NAME shift, and go to state 9 ++ '\$' shift, and go to state 320 ++ ++ variable go to state 51 ++ ++ ++State 323 ++ ++ 130 simp_exp: . non_post_simp_exp ++ 131 | . simp_exp '^' simp_exp ++ 132 | . simp_exp '*' simp_exp ++ 133 | . simp_exp '/' simp_exp ++ 134 | . simp_exp '%' simp_exp ++ 135 | . simp_exp '+' simp_exp ++ 136 | . simp_exp '-' simp_exp ++ 137 | . variable INCREMENT ++ 138 | . variable DECREMENT ++ 139 non_post_simp_exp: . '!' simp_exp ++ 140 | . '(' exp r_paren ++ 141 | . LEX_BUILTIN '(' opt_expression_list r_paren ++ 142 | . LEX_LENGTH '(' opt_expression_list r_paren ++ 143 | . LEX_LENGTH ++ 144 | . FUNC_CALL '(' opt_expression_list r_paren ++ 145 | . variable ++ 146 | . INCREMENT variable ++ 147 | . DECREMENT variable ++ 148 | . YNUMBER ++ 149 | . YSTRING ++ 150 | . '-' simp_exp ++ 151 | . '+' simp_exp ++ 151 | '+' . simp_exp ++ 154 variable: . NAME ++ 155 | . NAME '[' expression_list ']' ++ 156 | . '\$' non_post_simp_exp ++ ++ FUNC_CALL shift, and go to state 8 ++ NAME shift, and go to state 9 ++ YNUMBER shift, and go to state 10 ++ YSTRING shift, and go to state 11 ++ INCREMENT shift, and go to state 16 ++ DECREMENT shift, and go to state 17 ++ LEX_BUILTIN shift, and go to state 18 ++ LEX_LENGTH shift, and go to state 19 ++ '+' shift, and go to state 20 ++ '-' shift, and go to state 21 ++ '!' shift, and go to state 54 ++ '\$' shift, and go to state 24 ++ '(' shift, and go to state 55 ++ ++ simp_exp go to state 326 ++ non_post_simp_exp go to state 35 ++ variable go to state 57 ++ ++ ++State 324 ++ ++ 130 simp_exp: . non_post_simp_exp ++ 131 | . simp_exp '^' simp_exp ++ 132 | . simp_exp '*' simp_exp ++ 133 | . simp_exp '/' simp_exp ++ 134 | . simp_exp '%' simp_exp ++ 135 | . simp_exp '+' simp_exp ++ 136 | . simp_exp '-' simp_exp ++ 137 | . variable INCREMENT ++ 138 | . variable DECREMENT ++ 139 non_post_simp_exp: . '!' simp_exp ++ 140 | . '(' exp r_paren ++ 141 | . LEX_BUILTIN '(' opt_expression_list r_paren ++ 142 | . LEX_LENGTH '(' opt_expression_list r_paren ++ 143 | . LEX_LENGTH ++ 144 | . FUNC_CALL '(' opt_expression_list r_paren ++ 145 | . variable ++ 146 | . INCREMENT variable ++ 147 | . DECREMENT variable ++ 148 | . YNUMBER ++ 149 | . YSTRING ++ 150 | . '-' simp_exp ++ 150 | '-' . simp_exp ++ 151 | . '+' simp_exp ++ 154 variable: . NAME ++ 155 | . NAME '[' expression_list ']' ++ 156 | . '\$' non_post_simp_exp ++ ++ FUNC_CALL shift, and go to state 8 ++ NAME shift, and go to state 9 ++ YNUMBER shift, and go to state 10 ++ YSTRING shift, and go to state 11 ++ INCREMENT shift, and go to state 16 ++ DECREMENT shift, and go to state 17 ++ LEX_BUILTIN shift, and go to state 18 ++ LEX_LENGTH shift, and go to state 19 ++ '+' shift, and go to state 20 ++ '-' shift, and go to state 21 ++ '!' shift, and go to state 54 ++ '\$' shift, and go to state 24 ++ '(' shift, and go to state 55 ++ ++ simp_exp go to state 327 ++ non_post_simp_exp go to state 35 ++ variable go to state 57 ++ ++ ++State 325 ++ ++ 130 simp_exp: . non_post_simp_exp ++ 131 | . simp_exp '^' simp_exp ++ 132 | . simp_exp '*' simp_exp ++ 133 | . simp_exp '/' simp_exp ++ 134 | . simp_exp '%' simp_exp ++ 135 | . simp_exp '+' simp_exp ++ 136 | . simp_exp '-' simp_exp ++ 137 | . variable INCREMENT ++ 138 | . variable DECREMENT ++ 139 non_post_simp_exp: . '!' simp_exp ++ 139 | '!' . simp_exp ++ 140 | . '(' exp r_paren ++ 141 | . LEX_BUILTIN '(' opt_expression_list r_paren ++ 142 | . LEX_LENGTH '(' opt_expression_list r_paren ++ 143 | . LEX_LENGTH ++ 144 | . FUNC_CALL '(' opt_expression_list r_paren ++ 145 | . variable ++ 146 | . INCREMENT variable ++ 147 | . DECREMENT variable ++ 148 | . YNUMBER ++ 149 | . YSTRING ++ 150 | . '-' simp_exp ++ 151 | . '+' simp_exp ++ 154 variable: . NAME ++ 155 | . NAME '[' expression_list ']' ++ 156 | . '\$' non_post_simp_exp ++ ++ FUNC_CALL shift, and go to state 8 ++ NAME shift, and go to state 9 ++ YNUMBER shift, and go to state 10 ++ YSTRING shift, and go to state 11 ++ INCREMENT shift, and go to state 16 ++ DECREMENT shift, and go to state 17 ++ LEX_BUILTIN shift, and go to state 18 ++ LEX_LENGTH shift, and go to state 19 ++ '+' shift, and go to state 20 ++ '-' shift, and go to state 21 ++ '!' shift, and go to state 54 ++ '\$' shift, and go to state 24 ++ '(' shift, and go to state 55 ++ ++ simp_exp go to state 328 ++ non_post_simp_exp go to state 35 ++ variable go to state 57 ++ ++ ++State 326 ++ ++ 131 simp_exp: simp_exp . '^' simp_exp ++ 132 | simp_exp . '*' simp_exp ++ 133 | simp_exp . '/' simp_exp ++ 134 | simp_exp . '%' simp_exp ++ 135 | simp_exp . '+' simp_exp ++ 136 | simp_exp . '-' simp_exp ++ 151 non_post_simp_exp: '+' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] ++ ++ '*' shift, and go to state 89 ++ '/' shift, and go to state 90 ++ '%' shift, and go to state 91 ++ '^' shift, and go to state 92 ++ ++ \$default reduce using rule 151 (non_post_simp_exp) ++ ++ Conflict between rule 151 and token '+' resolved as reduce ('+' < UNARY). ++ Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY). ++ ++ ++State 327 ++ ++ 131 simp_exp: simp_exp . '^' simp_exp ++ 132 | simp_exp . '*' simp_exp ++ 133 | simp_exp . '/' simp_exp ++ 134 | simp_exp . '%' simp_exp ++ 135 | simp_exp . '+' simp_exp ++ 136 | simp_exp . '-' simp_exp ++ 150 non_post_simp_exp: '-' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] ++ ++ '*' shift, and go to state 89 ++ '/' shift, and go to state 90 ++ '%' shift, and go to state 91 ++ '^' shift, and go to state 92 ++ ++ \$default reduce using rule 150 (non_post_simp_exp) ++ ++ Conflict between rule 150 and token '+' resolved as reduce ('+' < UNARY). ++ Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY). ++ ++ ++State 328 ++ ++ 131 simp_exp: simp_exp . '^' simp_exp ++ 132 | simp_exp . '*' simp_exp ++ 133 | simp_exp . '/' simp_exp ++ 134 | simp_exp . '%' simp_exp ++ 135 | simp_exp . '+' simp_exp ++ 136 | simp_exp . '-' simp_exp ++ 139 non_post_simp_exp: '!' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';'] ++ ++ '*' shift, and go to state 89 ++ '/' shift, and go to state 90 ++ '%' shift, and go to state 91 ++ '^' shift, and go to state 92 ++ ++ \$default reduce using rule 139 (non_post_simp_exp) ++ ++ Conflict between rule 139 and token '+' resolved as reduce ('+' < UNARY). ++ Conflict between rule 139 and token '-' resolved as reduce ('-' < UNARY). +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. + +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:800" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:800" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:800" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_379 +#AT_START_380 +at_fn_group_banner 380 'existing.at:800' \ + "GNU AWK 3.1.0 Grammar: Canonical LR(1)" " " 17 +at_xfail=no +( + $as_echo "380. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type canonical-lr +%error-verbose + +%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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +{ set +x +$as_echo "$at_srcdir/existing.at:800: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule] +input.y:169.8: warning: empty rule without %empty [-Wempty-rule] +input.y:174.12: warning: empty rule without %empty [-Wempty-rule] +input.y:179.13: warning: empty rule without %empty [-Wempty-rule] +input.y:187.15: warning: empty rule without %empty [-Wempty-rule] +input.y:201.8: warning: empty rule without %empty [-Wempty-rule] +input.y:206.21: warning: empty rule without %empty [-Wempty-rule] +input.y:220.20: warning: empty rule without %empty [-Wempty-rule] +input.y:299.13: warning: empty rule without %empty [-Wempty-rule] +input.y:322.9: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr] +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] +" | \ + $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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:66.10: warning: empty rule without %empty [-Wempty-rule] +input.y:169.8: warning: empty rule without %empty [-Wempty-rule] +input.y:174.12: warning: empty rule without %empty [-Wempty-rule] +input.y:179.13: warning: empty rule without %empty [-Wempty-rule] +input.y:187.15: warning: empty rule without %empty [-Wempty-rule] +input.y:201.8: warning: empty rule without %empty [-Wempty-rule] +input.y:206.21: warning: empty rule without %empty [-Wempty-rule] +input.y:220.20: warning: empty rule without %empty [-Wempty-rule] +input.y:299.13: warning: empty rule without %empty [-Wempty-rule] +input.y:322.9: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr] +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:800: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:800" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:800: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:800" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:800: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:800" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "2358 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. +if test 32767 -lt `wc -l < input.c`; then + CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'` + CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'` +fi +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:800" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:800" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:800: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:800" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:800" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:800" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:800" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_380 +#AT_START_381 +at_fn_group_banner 381 'existing.at:1451' \ + "GNU Cim Grammar: LALR(1)" " " 17 +at_xfail=no +( + $as_echo "381. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type lalr + +%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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:1451: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:128.12: warning: empty rule without %empty [-Wempty-rule] +input.y:137.10: warning: empty rule without %empty [-Wempty-rule] +input.y:142.8: warning: empty rule without %empty [-Wempty-rule] +input.y:161.15: warning: empty rule without %empty [-Wempty-rule] +input.y:179.17: warning: empty rule without %empty [-Wempty-rule] +input.y:205.16: warning: empty rule without %empty [-Wempty-rule] +input.y:213.9: warning: empty rule without %empty [-Wempty-rule] +input.y:225.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.18: warning: empty rule without %empty [-Wempty-rule] +input.y:294.19: warning: empty rule without %empty [-Wempty-rule] +input.y:367.16: warning: empty rule without %empty [-Wempty-rule] +input.y:373.11: warning: empty rule without %empty [-Wempty-rule] +input.y:387.15: warning: empty rule without %empty [-Wempty-rule] +input.y:401.18: warning: empty rule without %empty [-Wempty-rule] +input.y:413.15: warning: empty rule without %empty [-Wempty-rule] +input.y:443.15: warning: empty rule without %empty [-Wempty-rule] +input.y:471.15: warning: empty rule without %empty [-Wempty-rule] +input.y:474.15: warning: empty rule without %empty [-Wempty-rule] +input.y:489.15: warning: empty rule without %empty [-Wempty-rule] +input.y:506.14: warning: empty rule without %empty [-Wempty-rule] +input.y:587.9: warning: empty rule without %empty [-Wempty-rule] +input.y:591.14: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr] +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] +" | \ + $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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:128.12: warning: empty rule without %empty [-Wempty-rule] +input.y:137.10: warning: empty rule without %empty [-Wempty-rule] +input.y:142.8: warning: empty rule without %empty [-Wempty-rule] +input.y:161.15: warning: empty rule without %empty [-Wempty-rule] +input.y:179.17: warning: empty rule without %empty [-Wempty-rule] +input.y:205.16: warning: empty rule without %empty [-Wempty-rule] +input.y:213.9: warning: empty rule without %empty [-Wempty-rule] +input.y:225.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.18: warning: empty rule without %empty [-Wempty-rule] +input.y:294.19: warning: empty rule without %empty [-Wempty-rule] +input.y:367.16: warning: empty rule without %empty [-Wempty-rule] +input.y:373.11: warning: empty rule without %empty [-Wempty-rule] +input.y:387.15: warning: empty rule without %empty [-Wempty-rule] +input.y:401.18: warning: empty rule without %empty [-Wempty-rule] +input.y:413.15: warning: empty rule without %empty [-Wempty-rule] +input.y:443.15: warning: empty rule without %empty [-Wempty-rule] +input.y:471.15: warning: empty rule without %empty [-Wempty-rule] +input.y:474.15: warning: empty rule without %empty [-Wempty-rule] +input.y:489.15: warning: empty rule without %empty [-Wempty-rule] +input.y:506.14: warning: empty rule without %empty [-Wempty-rule] +input.y:587.9: warning: empty rule without %empty [-Wempty-rule] +input.y:591.14: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr] +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:1451: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1451" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1451" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "442 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: diff -u /dev/null /dev/null || exit 77" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" +at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1451" +( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --report=all input-lalr.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:1451: bison -fno-caret --report=all input-lalr.y" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; bison -fno-caret --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: diff -u input-lalr.output input.output \\ + | sed -n '/^@@/,\$p' | sed 's/^ \$//'" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1451" +( $at_check_trace; diff -u input-lalr.output input.output \ + | sed -n '/^@@/,$p' | sed 's/^ $//' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/existing.at:1451: grep '^State.*conflicts:' input.output" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; grep '^State.*conflicts:' input.output +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1451" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1451" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1451" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_381 +#AT_START_382 +at_fn_group_banner 382 'existing.at:1451' \ + "GNU Cim Grammar: IELR(1)" " " 17 +at_xfail=no +( + $as_echo "382. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type ielr + +%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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:1451: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:128.12: warning: empty rule without %empty [-Wempty-rule] +input.y:137.10: warning: empty rule without %empty [-Wempty-rule] +input.y:142.8: warning: empty rule without %empty [-Wempty-rule] +input.y:161.15: warning: empty rule without %empty [-Wempty-rule] +input.y:179.17: warning: empty rule without %empty [-Wempty-rule] +input.y:205.16: warning: empty rule without %empty [-Wempty-rule] +input.y:213.9: warning: empty rule without %empty [-Wempty-rule] +input.y:225.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.18: warning: empty rule without %empty [-Wempty-rule] +input.y:294.19: warning: empty rule without %empty [-Wempty-rule] +input.y:367.16: warning: empty rule without %empty [-Wempty-rule] +input.y:373.11: warning: empty rule without %empty [-Wempty-rule] +input.y:387.15: warning: empty rule without %empty [-Wempty-rule] +input.y:401.18: warning: empty rule without %empty [-Wempty-rule] +input.y:413.15: warning: empty rule without %empty [-Wempty-rule] +input.y:443.15: warning: empty rule without %empty [-Wempty-rule] +input.y:471.15: warning: empty rule without %empty [-Wempty-rule] +input.y:474.15: warning: empty rule without %empty [-Wempty-rule] +input.y:489.15: warning: empty rule without %empty [-Wempty-rule] +input.y:506.14: warning: empty rule without %empty [-Wempty-rule] +input.y:587.9: warning: empty rule without %empty [-Wempty-rule] +input.y:591.14: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr] +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] +" | \ + $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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:128.12: warning: empty rule without %empty [-Wempty-rule] +input.y:137.10: warning: empty rule without %empty [-Wempty-rule] +input.y:142.8: warning: empty rule without %empty [-Wempty-rule] +input.y:161.15: warning: empty rule without %empty [-Wempty-rule] +input.y:179.17: warning: empty rule without %empty [-Wempty-rule] +input.y:205.16: warning: empty rule without %empty [-Wempty-rule] +input.y:213.9: warning: empty rule without %empty [-Wempty-rule] +input.y:225.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.18: warning: empty rule without %empty [-Wempty-rule] +input.y:294.19: warning: empty rule without %empty [-Wempty-rule] +input.y:367.16: warning: empty rule without %empty [-Wempty-rule] +input.y:373.11: warning: empty rule without %empty [-Wempty-rule] +input.y:387.15: warning: empty rule without %empty [-Wempty-rule] +input.y:401.18: warning: empty rule without %empty [-Wempty-rule] +input.y:413.15: warning: empty rule without %empty [-Wempty-rule] +input.y:443.15: warning: empty rule without %empty [-Wempty-rule] +input.y:471.15: warning: empty rule without %empty [-Wempty-rule] +input.y:474.15: warning: empty rule without %empty [-Wempty-rule] +input.y:489.15: warning: empty rule without %empty [-Wempty-rule] +input.y:506.14: warning: empty rule without %empty [-Wempty-rule] +input.y:587.9: warning: empty rule without %empty [-Wempty-rule] +input.y:591.14: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr] +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:1451: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1451" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1451" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "442 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: diff -u /dev/null /dev/null || exit 77" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" +at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1451" +( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --report=all input-lalr.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:1451: bison -fno-caret --report=all input-lalr.y" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; bison -fno-caret --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: diff -u input-lalr.output input.output \\ + | sed -n '/^@@/,\$p' | sed 's/^ \$//'" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1451" +( $at_check_trace; diff -u input-lalr.output input.output \ + | sed -n '/^@@/,$p' | sed 's/^ $//' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/existing.at:1451: grep '^State.*conflicts:' input.output" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; grep '^State.*conflicts:' input.output +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1451" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1451" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1451" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_382 +#AT_START_383 +at_fn_group_banner 383 'existing.at:1451' \ + "GNU Cim Grammar: Canonical LR(1)" " " 17 +at_xfail=no +( + $as_echo "383. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type canonical-lr + +%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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:128.12: warning: empty rule without %empty [-Wempty-rule] +input.y:137.10: warning: empty rule without %empty [-Wempty-rule] +input.y:142.8: warning: empty rule without %empty [-Wempty-rule] +input.y:161.15: warning: empty rule without %empty [-Wempty-rule] +input.y:179.17: warning: empty rule without %empty [-Wempty-rule] +input.y:205.16: warning: empty rule without %empty [-Wempty-rule] +input.y:213.9: warning: empty rule without %empty [-Wempty-rule] +input.y:225.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.18: warning: empty rule without %empty [-Wempty-rule] +input.y:294.19: warning: empty rule without %empty [-Wempty-rule] +input.y:367.16: warning: empty rule without %empty [-Wempty-rule] +input.y:373.11: warning: empty rule without %empty [-Wempty-rule] +input.y:387.15: warning: empty rule without %empty [-Wempty-rule] +input.y:401.18: warning: empty rule without %empty [-Wempty-rule] +input.y:413.15: warning: empty rule without %empty [-Wempty-rule] +input.y:443.15: warning: empty rule without %empty [-Wempty-rule] +input.y:471.15: warning: empty rule without %empty [-Wempty-rule] +input.y:474.15: warning: empty rule without %empty [-Wempty-rule] +input.y:489.15: warning: empty rule without %empty [-Wempty-rule] +input.y:506.14: warning: empty rule without %empty [-Wempty-rule] +input.y:587.9: warning: empty rule without %empty [-Wempty-rule] +input.y:591.14: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr] +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] +" | \ + $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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:128.12: warning: empty rule without %empty [-Wempty-rule] +input.y:137.10: warning: empty rule without %empty [-Wempty-rule] +input.y:142.8: warning: empty rule without %empty [-Wempty-rule] +input.y:161.15: warning: empty rule without %empty [-Wempty-rule] +input.y:179.17: warning: empty rule without %empty [-Wempty-rule] +input.y:205.16: warning: empty rule without %empty [-Wempty-rule] +input.y:213.9: warning: empty rule without %empty [-Wempty-rule] +input.y:225.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.18: warning: empty rule without %empty [-Wempty-rule] +input.y:294.19: warning: empty rule without %empty [-Wempty-rule] +input.y:367.16: warning: empty rule without %empty [-Wempty-rule] +input.y:373.11: warning: empty rule without %empty [-Wempty-rule] +input.y:387.15: warning: empty rule without %empty [-Wempty-rule] +input.y:401.18: warning: empty rule without %empty [-Wempty-rule] +input.y:413.15: warning: empty rule without %empty [-Wempty-rule] +input.y:443.15: warning: empty rule without %empty [-Wempty-rule] +input.y:471.15: warning: empty rule without %empty [-Wempty-rule] +input.y:474.15: warning: empty rule without %empty [-Wempty-rule] +input.y:489.15: warning: empty rule without %empty [-Wempty-rule] +input.y:506.14: warning: empty rule without %empty [-Wempty-rule] +input.y:587.9: warning: empty rule without %empty [-Wempty-rule] +input.y:591.14: warning: empty rule without %empty [-Wempty-rule] +input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr] +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:1451: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1451" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1451" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "10425 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. +if test 32767 -lt `wc -l < input.c`; then + CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'` + CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'` +fi +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1451" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1451" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1451" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:1451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:1451" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_383 +#AT_START_384 +at_fn_group_banner 384 'existing.at:3263' \ + "GNU pic (Groff 1.18.1) Grammar: LALR(1)" " " 17 +at_xfail=no +( + $as_echo "384. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type lalr +%error-verbose + +%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 THROUGH +%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 THROUGH + {} + DELIMITED + {} + until + | COPY THROUGH + {} + 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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + VARIABLE, '=', LABEL, LEFT, DOT_X, 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:3263: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:3263" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:3263: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:3263" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:3263: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:202.19: warning: empty rule without %empty [-Wempty-rule] +input.y:270.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.12: warning: empty rule without %empty [-Wempty-rule] +input.y:309.17: warning: empty rule without %empty [-Wempty-rule] +input.y:382.13: warning: empty rule without %empty [-Wempty-rule] +input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +" | \ + $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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:202.19: warning: empty rule without %empty [-Wempty-rule] +input.y:270.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.12: warning: empty rule without %empty [-Wempty-rule] +input.y:309.17: warning: empty rule without %empty [-Wempty-rule] +input.y:382.13: warning: empty rule without %empty [-Wempty-rule] +input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:3263: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:3263" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:3263" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "422 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: diff -u /dev/null /dev/null || exit 77" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" +at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:3263" +( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --report=all input-lalr.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:3263: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:3263" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:3263: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:3263" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:3263: bison -fno-caret --report=all input-lalr.y" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; bison -fno-caret --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: diff -u input-lalr.output input.output \\ + | sed -n '/^@@/,\$p' | sed 's/^ \$//'" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3263" +( $at_check_trace; diff -u input-lalr.output input.output \ + | sed -n '/^@@/,$p' | sed 's/^ $//' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:3263" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:3263" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:3263" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "syntax error, unexpected LEFT +" | \ + $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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_384 +#AT_START_385 +at_fn_group_banner 385 'existing.at:3263' \ + "GNU pic (Groff 1.18.1) Grammar: IELR(1)" " " 17 +at_xfail=no +( + $as_echo "385. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type ielr +%error-verbose + +%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 THROUGH +%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 THROUGH + {} + DELIMITED + {} + until + | COPY THROUGH + {} + 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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + VARIABLE, '=', LABEL, LEFT, DOT_X, 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:3263: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:3263" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:3263: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:3263" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:3263: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:202.19: warning: empty rule without %empty [-Wempty-rule] +input.y:270.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.12: warning: empty rule without %empty [-Wempty-rule] +input.y:309.17: warning: empty rule without %empty [-Wempty-rule] +input.y:382.13: warning: empty rule without %empty [-Wempty-rule] +input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +" | \ + $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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:202.19: warning: empty rule without %empty [-Wempty-rule] +input.y:270.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.12: warning: empty rule without %empty [-Wempty-rule] +input.y:309.17: warning: empty rule without %empty [-Wempty-rule] +input.y:382.13: warning: empty rule without %empty [-Wempty-rule] +input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:3263: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:3263" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:3263" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "427 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: diff -u /dev/null /dev/null || exit 77" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; diff -u /dev/null /dev/null || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y" +at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:3263" +( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot --report=all input-lalr.y" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/existing.at:3263: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:3263" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/existing.at:3263: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:3263" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/existing.at:3263: bison -fno-caret --report=all input-lalr.y" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; bison -fno-caret --report=all input-lalr.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: diff -u input-lalr.output input.output \\ + | sed -n '/^@@/,\$p' | sed 's/^ \$//'" +at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3263" +( $at_check_trace; diff -u input-lalr.output input.output \ + | sed -n '/^@@/,$p' | sed 's/^ $//' +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "@@ -1223,7 +1223,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -1377,7 +1377,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -1854,7 +1854,7 @@ + + text go to state 162 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -2047,7 +2047,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -2571,7 +2571,7 @@ + position_not_place go to state 99 + expr_pair go to state 191 + place go to state 101 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -2732,7 +2732,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -2875,7 +2875,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -3018,7 +3018,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -3256,7 +3256,7 @@ + + State 102 + +- 146 place: label . [\$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, AND, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '\`', ',', '>', '+', '-', '!', ';', '}', ']', ')'] ++ 146 place: label . [\$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '\`', '+', '-', '!', ';', '}', ']'] + 147 | label . corner + 153 label: label . '.' LABEL + 180 corner: . DOT_N +@@ -3645,7 +3645,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -3804,7 +3804,7 @@ + text_expr go to state 239 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -4481,7 +4481,7 @@ + \$default reduce using rule 89 (object_spec) + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -4673,7 +4673,7 @@ + \$default reduce using rule 91 (object_spec) + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -4867,7 +4867,7 @@ + \$default reduce using rule 95 (object_spec) + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -5065,7 +5065,7 @@ + \$default reduce using rule 93 (object_spec) + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -5260,7 +5260,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -5403,7 +5403,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -5546,7 +5546,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -5689,7 +5689,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -6475,7 +6475,7 @@ + + expr_pair go to state 280 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -6633,7 +6633,7 @@ + \$default reduce using rule 105 (object_spec) + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -6825,7 +6825,7 @@ + \$default reduce using rule 107 (object_spec) + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -7017,7 +7017,7 @@ + \$default reduce using rule 114 (object_spec) + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -7264,7 +7264,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -7408,7 +7408,7 @@ + \$default reduce using rule 109 (object_spec) + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -7819,12 +7819,12 @@ + position_not_place go to state 296 + expr_pair go to state 100 + place go to state 297 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 + corner go to state 106 +- expr go to state 266 ++ expr go to state 424 + + + State 165 +@@ -7987,7 +7987,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -8172,7 +8172,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -8333,7 +8333,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -8494,7 +8494,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -8655,7 +8655,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -8816,7 +8816,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -8977,7 +8977,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -9138,7 +9138,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -9299,7 +9299,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -9460,7 +9460,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -9623,7 +9623,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -9784,7 +9784,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -9921,7 +9921,7 @@ + + \$default reduce using rule 47 (any_expr) + +- between go to state 237 ++ between go to state 425 + + + State 193 +@@ -10152,7 +10152,7 @@ + + expr_pair go to state 317 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -10298,7 +10298,7 @@ + + expr_pair go to state 318 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -10622,7 +10622,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -10765,7 +10765,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -10908,7 +10908,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -11051,7 +11051,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -11194,7 +11194,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -11337,7 +11337,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -11480,7 +11480,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -11637,7 +11637,7 @@ + position_not_place go to state 99 + expr_pair go to state 100 + place go to state 101 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -11780,7 +11780,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -11923,7 +11923,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -12066,7 +12066,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -12209,7 +12209,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -12352,7 +12352,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -12495,7 +12495,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -12638,7 +12638,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -12794,12 +12794,12 @@ + position_not_place go to state 99 + expr_pair go to state 100 + place go to state 101 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 + corner go to state 106 +- expr go to state 266 ++ expr go to state 424 + + + State 238 +@@ -12937,7 +12937,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -13160,7 +13160,7 @@ + text_expr go to state 342 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -13319,7 +13319,7 @@ + text_expr go to state 344 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -13502,7 +13502,7 @@ + text_expr go to state 348 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -13661,7 +13661,7 @@ + text_expr go to state 350 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -13804,7 +13804,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -14747,7 +14747,7 @@ + position_not_place go to state 99 + expr_pair go to state 191 + place go to state 101 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -15074,7 +15074,7 @@ + text go to state 113 + expr_pair go to state 365 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -15693,12 +15693,12 @@ + position_not_place go to state 99 + expr_pair go to state 100 + place go to state 101 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 + corner go to state 106 +- expr go to state 266 ++ expr go to state 424 + + + State 315 +@@ -16124,7 +16124,7 @@ + + \$default reduce using rule 239 (expr) + +- between go to state 237 ++ between go to state 425 + + Conflict between rule 239 and token OF resolved as shift ('<' < OF). + Conflict between rule 239 and token BETWEEN resolved as shift ('<' < BETWEEN). +@@ -17234,7 +17234,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -17416,7 +17416,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -17577,7 +17577,7 @@ + text_expr go to state 112 + text go to state 113 + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -17772,12 +17772,12 @@ + position_not_place go to state 99 + expr_pair go to state 100 + place go to state 101 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 + corner go to state 106 +- expr go to state 266 ++ expr go to state 424 + + + State 383 +@@ -18071,7 +18071,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -18221,7 +18221,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -18830,7 +18830,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -18987,7 +18987,7 @@ + '!' shift, and go to state 94 + + place go to state 114 +- label go to state 102 ++ label go to state 423 + ordinal go to state 103 + optional_ordinal_last go to state 104 + nth_primitive go to state 105 +@@ -19089,3 +19089,440 @@ + 29 placeless_element: FOR VARIABLE '=' expr TO expr optional_by DO \$@6 DELIMITED . + + \$default reduce using rule 29 (placeless_element) ++ ++ ++State 423 ++ ++ 146 place: label . [\$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', ']', ')'] ++ 147 | label . corner ++ 153 label: label . '.' LABEL ++ 180 corner: . DOT_N ++ 181 | . DOT_E ++ 182 | . DOT_W ++ 183 | . DOT_S ++ 184 | . DOT_NE ++ 185 | . DOT_SE ++ 186 | . DOT_NW ++ 187 | . DOT_SW ++ 188 | . DOT_C ++ 189 | . DOT_START ++ 190 | . DOT_END ++ 191 | . TOP ++ 192 | . BOTTOM ++ 193 | . LEFT ++ 194 | . RIGHT ++ 195 | . UPPER LEFT ++ 196 | . LOWER LEFT ++ 197 | . UPPER RIGHT ++ 198 | . LOWER RIGHT ++ 199 | . LEFT_CORNER ++ 200 | . RIGHT_CORNER ++ 201 | . UPPER LEFT_CORNER ++ 202 | . LOWER LEFT_CORNER ++ 203 | . UPPER RIGHT_CORNER ++ 204 | . LOWER RIGHT_CORNER ++ 205 | . NORTH ++ 206 | . SOUTH ++ 207 | . EAST ++ 208 | . WEST ++ 209 | . CENTER ++ 210 | . START ++ 211 | . END ++ ++ LEFT shift, and go to state 53 ++ RIGHT shift, and go to state 54 ++ DOT_N shift, and go to state 56 ++ DOT_E shift, and go to state 57 ++ DOT_W shift, and go to state 58 ++ DOT_S shift, and go to state 59 ++ DOT_NE shift, and go to state 60 ++ DOT_SE shift, and go to state 61 ++ DOT_NW shift, and go to state 62 ++ DOT_SW shift, and go to state 63 ++ DOT_C shift, and go to state 64 ++ DOT_START shift, and go to state 65 ++ DOT_END shift, and go to state 66 ++ TOP shift, and go to state 78 ++ BOTTOM shift, and go to state 79 ++ UPPER shift, and go to state 80 ++ LOWER shift, and go to state 81 ++ LEFT_CORNER shift, and go to state 82 ++ RIGHT_CORNER shift, and go to state 83 ++ NORTH shift, and go to state 84 ++ SOUTH shift, and go to state 85 ++ EAST shift, and go to state 86 ++ WEST shift, and go to state 87 ++ CENTER shift, and go to state 88 ++ END shift, and go to state 89 ++ START shift, and go to state 90 ++ '.' shift, and go to state 204 ++ ++ \$default reduce using rule 146 (place) ++ ++ corner go to state 205 ++ ++ ++State 424 ++ ++ 140 position_not_place: expr . between position AND position ++ 141 | expr . '<' position ',' position '>' ++ 142 between: . BETWEEN ++ 143 | . OF THE WAY BETWEEN ++ 144 expr_pair: expr . ',' expr ++ 219 expr: expr . '+' expr ++ 220 | expr . '-' expr ++ 221 | expr . '*' expr ++ 222 | expr . '/' expr ++ 223 | expr . '%' expr ++ 224 | expr . '^' expr ++ 239 | expr . '<' expr ++ 240 | expr . LESSEQUAL expr ++ 241 | expr . '>' expr ++ 242 | expr . GREATEREQUAL expr ++ 243 | expr . EQUALEQUAL expr ++ 244 | expr . NOTEQUAL expr ++ 245 | expr . ANDAND expr ++ 246 | expr . OROR expr ++ ++ OF shift, and go to state 220 ++ BETWEEN shift, and go to state 221 ++ ANDAND shift, and go to state 222 ++ OROR shift, and go to state 223 ++ NOTEQUAL shift, and go to state 224 ++ EQUALEQUAL shift, and go to state 225 ++ LESSEQUAL shift, and go to state 226 ++ GREATEREQUAL shift, and go to state 227 ++ ',' shift, and go to state 228 ++ '<' shift, and go to state 229 ++ '>' shift, and go to state 230 ++ '+' shift, and go to state 231 ++ '-' shift, and go to state 232 ++ '*' shift, and go to state 233 ++ '/' shift, and go to state 234 ++ '%' shift, and go to state 235 ++ '^' shift, and go to state 236 ++ + between go to state 425 + + @@ -138846,87 +169099,7548 @@ echo >>"$at_stdout"; $as_echo "@@ -1223,7 +1223,7 @@ + corner go to state 106 + expr go to state 424 " | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:3263" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:3263" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:3263" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_385 +#AT_START_386 +at_fn_group_banner 386 'existing.at:3263' \ + "GNU pic (Groff 1.18.1) Grammar: Canonical LR(1)" "" 17 +at_xfail=no +( + $as_echo "386. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%define lr.type canonical-lr +%error-verbose + +%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 THROUGH +%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 THROUGH + {} + DELIMITED + {} + until + | COPY THROUGH + {} + 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 + ; + + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +static int +yylex (void) +{ + static int const input[] = { + VARIABLE, '=', LABEL, LEFT, DOT_X, 0 + }; + static int const *inputp = input; + return *inputp++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before +# expanding macros, so it corrupts some special characters in the +# macros. To avoid this, expand now and pass it the result with proper +# string quotation. Assume args 7 through 12 expand to properly quoted +# strings. + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: bison -fno-caret -Wall --report=all --defines -o input.c input.y" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:202.19: warning: empty rule without %empty [-Wempty-rule] +input.y:270.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.12: warning: empty rule without %empty [-Wempty-rule] +input.y:309.17: warning: empty rule without %empty [-Wempty-rule] +input.y:382.13: warning: empty rule without %empty [-Wempty-rule] +input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +" | \ + $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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:202.19: warning: empty rule without %empty [-Wempty-rule] +input.y:270.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.12: warning: empty rule without %empty [-Wempty-rule] +input.y:309.17: warning: empty rule without %empty [-Wempty-rule] +input.y:382.13: warning: empty rule without %empty [-Wempty-rule] +input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/existing.at:3263: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:3263" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/existing.at:3263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:3263" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: sed -n 's/^State //p' input.output | tail -1" +at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:3263" +( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "4833 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + +# Canonical LR generates very large tables, resulting in very long +# files with #line directives that may overflow what the standards +# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic +# will issue an error. +# +# There is no "" around `wc` since some indent the result. +if test 32767 -lt `wc -l < input.c`; then + CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'` + CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'` +fi +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:3263" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:3263" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:3263" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/existing.at:3263: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "existing.at:3263" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:3263" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_386 +#AT_START_387 +at_fn_group_banner 387 'regression.at:25' \ + "Trivial grammars" " " 18 +at_xfail=no +( + $as_echo "387. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +void yyerror (const char *msg); +int yylex (void); +#define YYSTYPE int * +%} + +%error-verbose + +%% + +program: 'x'; +_ATEOF + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:43" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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 +$as_echo "$at_srcdir/regression.at:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:43" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:43" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:43" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:43" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:43" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:43: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:43" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:43" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:44: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:44" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:44" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:44: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:44" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:44" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:45: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:45" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:45" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:45: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o -DYYDEBUG -c input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c " "regression.at:45" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:45" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_387 +#AT_START_388 +at_fn_group_banner 388 'regression.at:55' \ + "YYSTYPE typedef" " " 18 +at_xfail=no +( + $as_echo "388. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +void yyerror (const char *msg); +int yylex (void); +typedef union { char const *val; } YYSTYPE; +%} + +%type program + +%% + +program: { $$ = ""; }; +_ATEOF + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:73" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:73" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:73" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:73" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:73" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:73" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:73" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:73" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:73: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:73" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:73" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:74: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:74" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:74" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:74: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:74" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:74" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_388 +#AT_START_389 +at_fn_group_banner 389 'regression.at:85' \ + "Early token definitions with --yacc" " " 18 +at_xfail=no +( + $as_echo "389. $at_setup_line: testing $at_desc ..." + $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 +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +void yyerror (const char *msg); +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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:113" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -y -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:113" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -y -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -y -o input.c input.y" "regression.at:113" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -y -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:113" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.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' "regression.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:113" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:113" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:113: bison -fno-caret -y -o input.c input.y" +at_fn_check_prepare_trace "regression.at:113" +( $at_check_trace; bison -fno-caret -y -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:113" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:114: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:114" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:114" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:114: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:114" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:114" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_389 +#AT_START_390 +at_fn_group_banner 390 'regression.at:125' \ + "Early token definitions without --yacc" " " 18 +at_xfail=no +( + $as_echo "390. $at_setup_line: testing $at_desc ..." + $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 +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +void yyerror (const char *msg); +int yylex (void); +void print_my_token (void); +%} + +%union +{ + int val; +}; +%{ +#include +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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:158" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:158" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:158" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:158" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:158" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:158" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:158" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:158" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:158: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:158" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:158" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:159: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:159" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:159" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:159: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:159" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:159" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_390 +#AT_START_391 +at_fn_group_banner 391 'regression.at:170' \ + "Braces parsing" " " 18 +at_xfail=no +( + $as_echo "391. $at_setup_line: testing $at_desc ..." + $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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:182" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:182" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:182" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:182" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.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' "regression.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:182" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:182" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:182: bison -fno-caret -v -o input.c input.y" +at_fn_check_prepare_trace "regression.at:182" +( $at_check_trace; bison -fno-caret -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:182" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/regression.at:184: grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c" +at_fn_check_prepare_trace "regression.at:184" +( $at_check_trace; grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:184" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_391 +#AT_START_392 +at_fn_group_banner 392 'regression.at:194' \ + "Duplicate string" " " 18 +at_xfail=no +( + $as_echo "392. $at_setup_line: testing $at_desc ..." + $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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:213" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:213" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:213: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:213" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:213: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:213" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:213: bison -fno-caret -v -o input.c input.y" +at_fn_check_prepare_trace "regression.at:213" +( $at_check_trace; bison -fno-caret -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 [-Wother] +" | \ + $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:213" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Werror" "regression.at:213" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:6.8-14: warning: symbol "<=" used more than once as a literal string [-Wother] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:213: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:213" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=error" "regression.at:213" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Wnone -Werror" "regression.at:213" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=none -Werror" "regression.at:213" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:213" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_392 +#AT_START_393 +at_fn_group_banner 393 'regression.at:222' \ + "Rule Line Numbers" " " 18 +at_xfail=no +( + $as_echo "393. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + +cat >input.y <<'_ATEOF' +%% +expr: +'a' + +{ + +} + +'b' + +{ + +} + +| + + +{ + + +} + +'c' + +{ + +}; +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:258" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c -v input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:258" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y" "regression.at:258" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:258" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:258" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:258" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:258" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:258" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:258: bison -fno-caret -o input.c -v input.y" +at_fn_check_prepare_trace "regression.at:258" +( $at_check_trace; bison -fno-caret -o input.c -v input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:258" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Check the contents of the report. +{ set +x +$as_echo "$at_srcdir/regression.at:357: cat input.output" +at_fn_check_prepare_trace "regression.at:357" +( $at_check_trace; cat input.output +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:357" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_393 +#AT_START_394 +at_fn_group_banner 394 'regression.at:368' \ + "Mixing %token styles" " " 18 +at_xfail=no +( + $as_echo "394. $at_setup_line: testing $at_desc ..." + $at_traceon + + +# Taken from the documentation. +cat >input.y <<'_ATEOF' +%token OR "||" +%token LE 134 "<=" +%left OR "<=" +%% +exp: %empty; +%% +_ATEOF + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:383: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -v -Wall -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:383" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -v -Wall -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:383: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -Wall -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -Wall -o input.c input.y" "regression.at:383" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -Wall -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:383: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:383" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:383: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:383" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:383: bison -fno-caret -v -Wall -o input.c input.y" +at_fn_check_prepare_trace "regression.at:383" +( $at_check_trace; bison -fno-caret -v -Wall -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:3.1-5: warning: useless precedence and associativity for \"||\" [-Wprecedence] +input.y:3.1-5: warning: useless precedence and associativity for \"<=\" [-Wprecedence] +" | \ + $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:383" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:383: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Werror" "regression.at:383" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:3.1-5: warning: useless precedence and associativity for "||" [-Wprecedence] +input.y:3.1-5: warning: useless precedence and associativity for "<=" [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:383: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:383" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:383: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=error" "regression.at:383" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:383: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Wnone -Werror" "regression.at:383" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:383: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror" "regression.at:383" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:383" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_394 +#AT_START_395 +at_fn_group_banner 395 'regression.at:394' \ + "Invalid inputs" " " 18 +at_xfail=no +( + $as_echo "395. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' +%% +? +default: 'a' } +%& +%a-does-not-exist +%- +%{ +_ATEOF + + + +{ set +x +$as_echo "$at_srcdir/regression.at:416: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "regression.at:416" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:2.1: error: invalid character: '?' +input.y:3.14: error: invalid character: '}' +input.y:4.1: error: invalid character: '%' +input.y:4.2: error: invalid character: '&' +input.y:5.1-17: error: invalid directive: '%a-does-not-exist' +input.y:6.1: error: invalid character: '%' +input.y:6.2: error: invalid character: '-' +input.y:7.1-8.0: error: missing '%}' at end of file +input.y:7.1-8.0: error: 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:416" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_395 +#AT_START_396 +at_fn_group_banner 396 'regression.at:421' \ + "Invalid inputs with {}" " " 18 +at_xfail=no +( + $as_echo "396. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >input.y <<'_ATEOF' + +%destructor +%initial-action +%lex-param +%parse-param +%printer +%union +_ATEOF + + + +{ set +x +$as_echo "$at_srcdir/regression.at:435: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "regression.at:435" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: 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:435" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_396 +#AT_START_397 +at_fn_group_banner 397 'regression.at:446' \ + "Token definitions" " " 18 +at_xfail=no +( + $as_echo "397. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +# Bison managed, when fed with '%token 'f' "f"' to #define 'f'! +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +#include + +static void yyerror (const char *msg); +static 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??!"; +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static int const input[] = { SPECIAL }; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + 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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:479: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:479" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:479: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:479" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:479: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:479" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother] +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 [-Wother] +" | \ + $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:479" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "regression.at:479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother] +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 [-Wother] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:479: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:479" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "regression.at:479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "regression.at:479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:479: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "regression.at:479" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:479" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -fcaret -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:487" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -fcaret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "regression.at:487" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:487: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:487" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:487: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:487" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:487: bison -fno-caret -fcaret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:487" +( $at_check_trace; bison -fno-caret -fcaret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother] + %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\" + ^^^^^^^ +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 [-Wother] + %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +" | \ + $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:487" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror" "regression.at:487" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother] + %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" + ^^^^^^^ +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 [-Wother] + %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:487: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:487" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error" "regression.at:487" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror" "regression.at:487" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror" "regression.at:487" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:487" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:488: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:488" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:488" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:488: \$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:488" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:488" +$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:497: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:497" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:497" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:497: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:497" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:497" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_397 +#AT_START_398 +at_fn_group_banner 398 'regression.at:507' \ + "Characters Escapes" " " 18 +at_xfail=no +( + $as_echo "398. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +void yyerror (const char *msg); +int yylex (void); +%} +%% +exp: + '\'' "\'" +| '\"' "\"" +| '"' "'" /* Pacify font-lock-mode: ". */ +; +_ATEOF + + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:525: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:525" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:525" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:525: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:525" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:525" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.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' "regression.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:525" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:525" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:525: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:525" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:525" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:526: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:526" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:526" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:526: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:526" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:526" +$at_failed && at_fn_log_failure +$at_traceon; } + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_398 +#AT_START_399 +at_fn_group_banner 399 'regression.at:540' \ + "Web2c Report" " " 18 +at_xfail=no +( + $as_echo "399. $at_setup_line: testing $at_desc ..." + $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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:565: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:565" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -v input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:565" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:565: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v input.y" "regression.at:565" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:565" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:565: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:565" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:565" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:565: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:565" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:565" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:565: bison -fno-caret -v input.y" +at_fn_check_prepare_trace "regression.at:565" +( $at_check_trace; bison -fno-caret -v input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:565" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:690: cat input.output" +at_fn_check_prepare_trace "regression.at:690" +( $at_check_trace; cat input.output +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:690" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_399 +#AT_START_400 +at_fn_group_banner 400 'regression.at:717' \ + "Web2c Actions" " " 18 +at_xfail=no +( + $as_echo "400. $at_setup_line: testing $at_desc ..." + $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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:730: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:730" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:730" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:730: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:730" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:730" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:730: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:730" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:730" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:730: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:730" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:730" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:730: bison -fno-caret -v -o input.c input.y" +at_fn_check_prepare_trace "regression.at:730" +( $at_check_trace; bison -fno-caret -v -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:730" +$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:818: cat tables.c" +at_fn_check_prepare_trace "regression.at:818" +( $at_check_trace; cat tables.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 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\", YY_NULLPTR +}; +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261 +}; +static const yytype_int8 yypact[] = +{ + -2, -1, 4, -8, 0, 2, -8, -2, -8, -2, + -8, -8 +}; +static const yytype_uint8 yydefact[] = +{ + 3, 0, 0, 2, 0, 0, 1, 3, 4, 3, + 6, 5 +}; +static const yytype_int8 yypgoto[] = +{ + -8, -7, -8, -8, -8 +}; +static const yytype_int8 yydefgoto[] = +{ + -1, 2, 3, 4, 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 +}; +static const yytype_uint8 yyr1[] = +{ + 0, 7, 8, 9, 9, 10, 11 +}; +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 0, 2, 4, 2 +}; +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:818" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_400 +#AT_START_401 +at_fn_group_banner 401 'regression.at:906' \ + "Dancer " " " 18 +at_xfail=no +( + $as_echo "401. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >dancer.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code provides +{ + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%token ARROW INVALID NUMBER STRING DATA +%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. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = ":"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:906: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:906" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o dancer.c dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:906" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:906: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:906" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:906" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.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' "regression.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:906" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:906" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:906: bison -fno-caret -o dancer.c dancer.y" +at_fn_check_prepare_trace "regression.at:906" +( $at_check_trace; bison -fno-caret -o dancer.c dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:906" +$at_failed && at_fn_log_failure +$at_traceon; } + + + { set +x +$as_echo "$at_srcdir/regression.at:906: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:906" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:906" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:906: \$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:906" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:906" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:906: \$PREPARSER ./dancer" +at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:906" +( $at_check_trace; $PREPARSER ./dancer +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:906" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:906: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:906" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:906" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_401 +#AT_START_402 +at_fn_group_banner 402 'regression.at:907' \ + "Dancer %glr-parser" " " 18 +at_xfail=no +( + $as_echo "402. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >dancer.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code provides +{ + #include + +static void yyerror (const char *msg); + static int yylex (void); +} +%glr-parser +%token ARROW INVALID NUMBER STRING DATA +%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. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = ":"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:907: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:907" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o dancer.c dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:907" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:907: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:907" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:907" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.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' "regression.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:907" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:907" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:907: bison -fno-caret -o dancer.c dancer.y" +at_fn_check_prepare_trace "regression.at:907" +( $at_check_trace; bison -fno-caret -o dancer.c dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:907" +$at_failed && at_fn_log_failure +$at_traceon; } + + + { set +x +$as_echo "$at_srcdir/regression.at:907: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:907" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:907" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:907: \$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:907" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:907" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:907: \$PREPARSER ./dancer" +at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:907" +( $at_check_trace; $PREPARSER ./dancer +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:907" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:907: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:907" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:907" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_402 +#AT_START_403 +at_fn_group_banner 403 'regression.at:908' \ + "Dancer lalr1.cc" " " 18 +at_xfail=no +( + $as_echo "403. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >dancer.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code provides +{ + + static int yylex (yy::parser::semantic_type *lvalp); +} +%skeleton "lalr1.cc" +%token ARROW INVALID NUMBER STRING DATA +%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 std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = ":"; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + (void) argc; + (void) argv; + return p.parse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:908: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:908" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o dancer.cc dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:908" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:908: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y" "regression.at:908" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:908" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.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' "regression.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:908" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:908" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:908: bison -fno-caret -o dancer.cc dancer.y" +at_fn_check_prepare_trace "regression.at:908" +( $at_check_trace; bison -fno-caret -o dancer.cc dancer.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:908" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/regression.at:908: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:908" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:908" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:908: \$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:908" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:908" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:908: \$PREPARSER ./dancer" +at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:908" +( $at_check_trace; $PREPARSER ./dancer +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:908" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:908: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:908" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:908" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_403 +#AT_START_404 +at_fn_group_banner 404 'regression.at:983' \ + "Expecting two tokens " " " 18 +at_xfail=no +( + $as_echo "404. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >expect2.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +static int yylex (void); + +#include + +static void yyerror (const char *msg); +%} + +%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. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} + + +#include +static int +yylex (void) +{ + static int const tokens[] = + { + 1000, '+', '+', -1 + }; + static size_t toknum; + + assert (toknum < sizeof tokens / sizeof *tokens); + return tokens[toknum++]; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:983: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:983" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o expect2.c expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:983" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:983: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:983" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:983" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:983: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:983" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:983" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:983: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:983" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:983" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:983: bison -fno-caret -o expect2.c expect2.y" +at_fn_check_prepare_trace "regression.at:983" +( $at_check_trace; bison -fno-caret -o expect2.c expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:983" +$at_failed && at_fn_log_failure +$at_traceon; } + + + { set +x +$as_echo "$at_srcdir/regression.at:983: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:983" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:983" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:983: \$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:983" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:983" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:983: \$PREPARSER ./expect2" +at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:983" +( $at_check_trace; $PREPARSER ./expect2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:983" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:983: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:983" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:983" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_404 +#AT_START_405 +at_fn_group_banner 405 'regression.at:984' \ + "Expecting two tokens %glr-parser" " " 18 +at_xfail=no +( + $as_echo "405. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >expect2.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +static int yylex (void); + +#include + +static void yyerror (const char *msg); +%} +%glr-parser +%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. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} + + +#include +static int +yylex (void) +{ + static int const tokens[] = + { + 1000, '+', '+', -1 + }; + static size_t toknum; + + assert (toknum < sizeof tokens / sizeof *tokens); + return tokens[toknum++]; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:984: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:984" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o expect2.c expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:984" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:984: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:984" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:984" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:984: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:984" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:984" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:984: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:984" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:984" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:984: bison -fno-caret -o expect2.c expect2.y" +at_fn_check_prepare_trace "regression.at:984" +( $at_check_trace; bison -fno-caret -o expect2.c expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:984" +$at_failed && at_fn_log_failure +$at_traceon; } + + + { set +x +$as_echo "$at_srcdir/regression.at:984: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:984" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:984" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:984: \$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:984" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:984" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:984: \$PREPARSER ./expect2" +at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:984" +( $at_check_trace; $PREPARSER ./expect2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:984" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:984: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:984" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:984" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_405 +#AT_START_406 +at_fn_group_banner 406 'regression.at:985' \ + "Expecting two tokens lalr1.cc" " " 18 +at_xfail=no +( + $as_echo "406. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >expect2.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +static int yylex (int *); +#include +%} +%skeleton "lalr1.cc" +%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 std::string& m) +{ + std::cerr << m << '\n'; +} +int +yyparse () +{ + yy::parser parser; + return parser.parse (); +} + + +#include +static int +yylex (int *lval) +{ + static int const tokens[] = + { + 1000, '+', '+', -1 + }; + static size_t toknum; + *lval = 0; /* Pacify GCC. */ + assert (toknum < sizeof tokens / sizeof *tokens); + return tokens[toknum++]; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + (void) argc; + (void) argv; + return p.parse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:985: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:985" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o expect2.cc expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:985" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:985: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y" "regression.at:985" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:985" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:985: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:985" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:985" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:985: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:985" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:985" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:985: bison -fno-caret -o expect2.cc expect2.y" +at_fn_check_prepare_trace "regression.at:985" +( $at_check_trace; bison -fno-caret -o expect2.cc expect2.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:985" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +{ set +x +$as_echo "$at_srcdir/regression.at:985: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:985" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:985" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:985: \$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:985" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:985" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:985: \$PREPARSER ./expect2" +at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:985" +( $at_check_trace; $PREPARSER ./expect2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:985" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:985: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:985" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:985" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_406 +#AT_START_407 +at_fn_group_banner 407 'regression.at:993' \ + "Braced code in declaration in rules section" " " 18 +at_xfail=no +( + $as_echo "407. $at_setup_line: testing $at_desc ..." + $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 +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%{ +#include + +static void yyerror (const char *msg); +static int yylex (void); +%} +%debug +%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'; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "a"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} +_ATEOF + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1024: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1024" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1024" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1024: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1024" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1024" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1024: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1024" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1024" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1024: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1024" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1024" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1024: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:1024" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1024" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:1025: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1025" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1025" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1025: \$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:1025" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1025" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1042: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:1042" +( $at_check_trace; $PREPARSER ./input --debug +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +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 1 $at_status "$at_srcdir/regression.at:1042" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1042: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1042" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1042" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_407 +#AT_START_408 +at_fn_group_banner 408 'regression.at:1052' \ + "String alias declared after use" " " 18 +at_xfail=no +( + $as_echo "408. $at_setup_line: testing $at_desc ..." + $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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1065: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1065" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1065" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1065: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1065" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1065" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1065: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1065" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1065" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1065: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1065" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1065" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1065: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:1065" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1065" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_408 +#AT_START_409 +at_fn_group_banner 409 'regression.at:1075' \ + "Extra lookahead sets in report" " " 18 +at_xfail=no +( + $as_echo "409. $at_setup_line: testing $at_desc ..." + $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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1090: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1090" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot --report=all input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1090" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1090: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input.y" "regression.at:1090" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1090" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1090: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1090" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1090" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1090: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1090" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1090" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1090: bison -fno-caret --report=all input.y" +at_fn_check_prepare_trace "regression.at:1090" +( $at_check_trace; bison -fno-caret --report=all input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1090" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:1106: 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:1106" +( $at_check_trace; sed -n '/^State 1$/,/^State 2$/p' input.output +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:1106" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_409 +#AT_START_410 +at_fn_group_banner 410 'regression.at:1116' \ + "Token number in precedence declaration" " " 18 +at_xfail=no +( + $as_echo "410. $at_setup_line: testing $at_desc ..." + $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 +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); +} + +%error-verbose +%right END 0 +%left TK1 1 TK2 2 "tok alias" 3 + +%% + +start: + TK1 sr_conflict "tok alias" + | start %prec END + ; +sr_conflict: + TK2 + | TK2 "tok alias" + ; + +%% + + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static int const input[] = { 1, 2, 3, 0 }; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1153: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Wall -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1153" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Wall -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1153: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" "regression.at:1153" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1153: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1153" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1153: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1153" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1153: bison -fno-caret -Wall -o input.c input.y" +at_fn_check_prepare_trace "regression.at:1153" +( $at_check_trace; bison -fno-caret -Wall -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 [-Wother] +input.y:28.5-19: warning: rule useless in parser due to conflicts [-Wother] +input.y:18.1-5: warning: useless precedence and associativity for TK1 [-Wprecedence] +" | \ + $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:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:1153: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Werror" "regression.at:1153" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y:24.5-19: warning: rule useless in parser due to conflicts [-Wother] +input.y:28.5-19: warning: rule useless in parser due to conflicts [-Wother] +input.y:18.1-5: warning: useless precedence and associativity for TK1 [-Wprecedence] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:1153: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1153" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:1153: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=error" "regression.at:1153" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:1153: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror" "regression.at:1153" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1153: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror" "regression.at:1153" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1153" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1154: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1154" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1154" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1154: \$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:1154" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1154" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1155: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1155" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1155" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1155: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1155" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1155" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_410 +#AT_START_411 +at_fn_group_banner 411 'regression.at:1169' \ + "parse-gram.y: LALR = IELR" " " 18 +at_xfail=no +( + $as_echo "411. $at_setup_line: testing $at_desc ..." + $at_traceon + + +# Avoid tests/bison's dark magic by processing a local copy of the +# grammar. Avoid differences in synclines by telling bison that the +# output files have the same name. +cp $abs_top_srcdir/src/parse-gram.y input.y +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1175: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1175" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1175" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1175: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" "regression.at:1175" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1175" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1175: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1175" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1175" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1175: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1175" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1175" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1175: bison -fno-caret -o input.c -Dlr.type=lalr input.y" +at_fn_check_prepare_trace "regression.at:1175" +( $at_check_trace; bison -fno-caret -o input.c -Dlr.type=lalr input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1175" +$at_failed && at_fn_log_failure +$at_traceon; } + + +mv input.c lalr.c + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1178" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1178" +$at_failed && at_fn_log_failure \ +"lalr.c" +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" "regression.at:1178" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1178" +$at_failed && at_fn_log_failure \ +"lalr.c" +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1178: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1178" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1178" +$at_failed && at_fn_log_failure \ +"lalr.c" +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1178: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1178" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1178" +$at_failed && at_fn_log_failure \ +"lalr.c" +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1178: bison -fno-caret -o input.c -Dlr.type=ielr input.y" +at_fn_check_prepare_trace "regression.at:1178" +( $at_check_trace; bison -fno-caret -o input.c -Dlr.type=ielr input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1178" +$at_failed && at_fn_log_failure \ +"lalr.c" +$at_traceon; } + + +mv input.c ielr.c + +{ set +x +$as_echo "$at_srcdir/regression.at:1181: diff lalr.c ielr.c" +at_fn_check_prepare_trace "regression.at:1181" +( $at_check_trace; diff lalr.c ielr.c +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1181" +$at_failed && at_fn_log_failure \ +"lalr.c" \ +"ielr.c" +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_411 +#AT_START_412 +at_fn_group_banner 412 'regression.at:1191' \ + "parse.error=verbose and YYSTACK_USE_ALLOCA" " " 18 +at_xfail=no +( + $as_echo "412. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); + #define YYSTACK_USE_ALLOCA 1 +} + +%define parse.error verbose + +%% + +start: check syntax_error syntax_error ; + +check: +{ + if (128 < sizeof yymsgbuf) + { + fprintf (stderr, + "The initial size of yymsgbuf in yyparse has increased\n" + "since this test group was last updated. As a result,\n" + "this test group may no longer manage to induce a\n" + "reallocation of the syntax error message buffer.\n" + "This test group must be adjusted to produce a longer\n" + "error message.\n"); + YYABORT; + } +} +; + +// Induce a syntax error message whose total length is more than +// sizeof yymsgbuf in yyparse. Each token here is 64 bytes. +syntax_error: + "123456789112345678921234567893123456789412345678951234567896123A" +| "123456789112345678921234567893123456789412345678951234567896123B" +| error 'a' 'b' 'c' +; + +%% + + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} + /* Induce two syntax error messages (which requires full error + recovery by shifting 3 tokens) in order to detect any loss of the + reallocated buffer. */ +#include +static +int yylex (void) +{ + static char const input[] = "abc"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + (void) argc; + (void) argv; + return yyparse (); +} +_ATEOF + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1242: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1242" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1242" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1242: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1242" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1242" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1242: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1242" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1242" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1242: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1242" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1242" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1242: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:1242" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1242" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:1243: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1243" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1243" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1243: \$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:1243" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1243" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1247: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1247" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1247" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1247: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1247" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B +syntax error, unexpected \$end, expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B +" | \ + $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:1247" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_412 +#AT_START_413 +at_fn_group_banner 413 'regression.at:1265' \ + "parse.error=verbose overflow" " " 18 +at_xfail=no +( + $as_echo "413. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); + + /* This prevents this test case from having to induce error messages + large enough to overflow size_t. */ + #define YYSIZE_T unsigned char + + /* Bring in malloc and set EXIT_SUCCESS so yacc.c doesn't try to + provide a malloc prototype using our YYSIZE_T. */ + #include + #ifndef EXIT_SUCCESS + # define EXIT_SUCCESS 0 + #endif + + /* Max depth is usually much smaller than YYSTACK_ALLOC_MAXIMUM, and + we don't want gcc to warn everywhere this constant would be too big + to make sense for our YYSIZE_T. */ + #define YYMAXDEPTH 100 +} + +%define parse.error verbose + +%% + +start: syntax_error1 check syntax_error2 ; + +// Induce a syntax error message whose total length causes yymsg in +// yyparse to be reallocated to size YYSTACK_ALLOC_MAXIMUM, which +// should be 255. Each token here is 64 bytes. +syntax_error1: + "123456789112345678921234567893123456789412345678951234567896123A" +| "123456789112345678921234567893123456789412345678951234567896123B" +| "123456789112345678921234567893123456789412345678951234567896123C" +| error 'a' 'b' 'c' +; + +check: +{ + if (yymsg_alloc != YYSTACK_ALLOC_MAXIMUM + || YYSTACK_ALLOC_MAXIMUM != YYSIZE_MAXIMUM + || YYSIZE_MAXIMUM != 255) + { + fprintf (stderr, + "The assumptions of this test group are no longer\n" + "valid, so it may no longer catch the error it was\n" + "designed to catch. Specifically, the following\n" + "values should all be 255:\n\n"); + fprintf (stderr, " yymsg_alloc = %d\n", yymsg_alloc); + fprintf (stderr, " YYSTACK_ALLOC_MAXIMUM = %d\n", + YYSTACK_ALLOC_MAXIMUM); + fprintf (stderr, " YYSIZE_MAXIMUM = %d\n", YYSIZE_MAXIMUM); + YYABORT; + } +} +; + +// Now overflow. +syntax_error2: + "123456789112345678921234567893123456789412345678951234567896123A" +| "123456789112345678921234567893123456789412345678951234567896123B" +| "123456789112345678921234567893123456789412345678951234567896123C" +| "123456789112345678921234567893123456789412345678951234567896123D" +| "123456789112345678921234567893123456789412345678951234567896123E" +; + +%% + + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} + /* Induce two syntax error messages (which requires full error + recovery by shifting 3 tokens). */ +#include +static +int yylex (void) +{ + static char const input[] = "abc"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +int +main (void) +{ + /* Push parsers throw away the message buffer between tokens, so skip + this test under maintainer-push-check. */ + if (YYPUSH) + return 77; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1352: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1352" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1352" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1352: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1352" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1352" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1352: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1352" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1352" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1352: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1352" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1352" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1352: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:1352" +( $at_check_trace; bison -fno-caret -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1352" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# gcc warns about tautologies and fallacies involving comparisons for +# unsigned char. However, it doesn't produce these same warnings for +# size_t and many other types when the warnings would seem to make just +# as much sense. We ignore the warnings. +CFLAGS="$NO_WERROR_CFLAGS" +{ set +x +$as_echo "$at_srcdir/regression.at:1359: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1359" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1359" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1359: \$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:1359" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1359" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/regression.at:1365: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1365" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1365" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1365: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1365" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B or 123456789112345678921234567893123456789412345678951234567896123C +syntax error +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/regression.at:1365" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_413 +#AT_START_414 +at_fn_group_banner 414 'regression.at:1375' \ + "LAC: Exploratory stack" " " 18 +at_xfail=no +( + $as_echo "414. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + int yylex (void); +} +%debug +%define api.push-pull pull +%define parse.error verbose +%token 'c' + +%% + +// default reductions in inconsistent states +// v v v v v v v v v v v v v v +S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; +// ^ ^ ^ +// LAC reallocs + +A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; +B: 'b' ; +C: /*empty*/ { printf ("consistent default reduction\n"); } ; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +int +yylex (void) +{ + static char const *input = "bbbbc"; + return *input++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1448: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1448" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1448: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1448" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1448: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr] +" | \ + $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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:1448: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1448" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y --warnings=error" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1448: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1448" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1448: \$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:1448" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1448: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1448" +( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1448: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1448" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Make sure syntax error doesn't forget that 'a' is expected. It would +# be forgotten without lookahead correction. +{ set +x +$as_echo "$at_srcdir/regression.at:1448: grep 'syntax error,' stderr.txt" +at_fn_check_prepare_trace "regression.at:1448" +( $at_check_trace; grep 'syntax error,' stderr.txt +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check number of default reductions in inconsistent states to be sure +# syntax error is detected before unnecessary reductions are performed. +{ set +x +$as_echo "$at_srcdir/regression.at:1448: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ + < stdout.txt || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ + < stdout.txt || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "14" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check number of default reductions in consistent states to be sure +# it is performed before the syntax error is detected. +{ set +x +$as_echo "$at_srcdir/regression.at:1448: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ + < stdout.txt || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ + < stdout.txt || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/regression.at:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check number of reallocs to be sure reallocated memory isn't somehow +# lost between LAC invocations. +{ set +x +$as_echo "$at_srcdir/regression.at:1448: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ + || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448" +( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ + || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "3" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + int yylex (YYSTYPE *); +} +%debug +%define api.push-pull pull %define api.pure +%define parse.error verbose +%token 'c' + +%% + +// default reductions in inconsistent states +// v v v v v v v v v v v v v v +S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; +// ^ ^ ^ +// LAC reallocs + +A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; +B: 'b' ; +C: /*empty*/ { printf ("consistent default reduction\n"); } ; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +int +yylex (YYSTYPE *v) +{ + static char const *input = "bbbbc"; + *v = 0; + return *input++; +} + +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1449: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1449" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1449: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1449" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1449: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr] +" | \ + $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:1449" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:1449: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1449" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y --warnings=error" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1449" +$at_failed && at_fn_log_failure +$at_traceon; } -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403" +$as_echo "$at_srcdir/regression.at:1449: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1449" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403" +$as_echo "$at_srcdir/regression.at:1449: \$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:1449" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/existing.at:1403: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/regression.at:1449: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1449" +( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1449" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:1403" +$as_echo "$at_srcdir/regression.at:1449: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1449" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Make sure syntax error doesn't forget that 'a' is expected. It would +# be forgotten without lookahead correction. +{ set +x +$as_echo "$at_srcdir/regression.at:1449: grep 'syntax error,' stderr.txt" +at_fn_check_prepare_trace "regression.at:1449" +( $at_check_trace; grep 'syntax error,' stderr.txt +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449" $at_failed && at_fn_log_failure $at_traceon; } +# Check number of default reductions in inconsistent states to be sure +# syntax error is detected before unnecessary reductions are performed. +{ set +x +$as_echo "$at_srcdir/regression.at:1449: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ + < stdout.txt || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ + < stdout.txt || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "14" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check number of default reductions in consistent states to be sure +# it is performed before the syntax error is detected. +{ set +x +$as_echo "$at_srcdir/regression.at:1449: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ + < stdout.txt || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ + < stdout.txt || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/regression.at:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check number of reallocs to be sure reallocated memory isn't somehow +# lost between LAC invocations. +{ set +x +$as_echo "$at_srcdir/regression.at:1449: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ + || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449" +( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ + || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "3" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_266 -#AT_START_267 -at_fn_group_banner 267 'existing.at:1403' \ - "GNU pic (Groff 1.18.1) Grammar: Canonical LR(1)" "" 16 -at_xfail=no -( - $as_echo "267. $at_setup_line: testing $at_desc ..." - $at_traceon cat >input.y <<'_ATEOF' @@ -138940,591 +176654,978 @@ cat >input.y <<'_ATEOF' %code { #include - static void yyerror ( const char *msg); - static int yylex (void); + +static void yyerror (const char *msg); + int yylex (void); } +%debug +%define api.push-pull both +%define parse.error verbose +%token 'c' -%define lr.type canonical-lr -%error-verbose +%% -%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 THROUGH -%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 +// default reductions in inconsistent states +// v v v v v v v v v v v v v v +S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; +// ^ ^ ^ +// LAC reallocs -%left '.' +A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; +B: 'b' ; +C: /*empty*/ { printf ("consistent default reduction\n"); } ; -/* 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 +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +int +yylex (void) +{ + static char const *input = "bbbbc"; + return *input++; +} -%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 +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} +_ATEOF -%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 +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -/* 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 + { set +x +$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -%left ',' -%left OROR -%left ANDAND -%left EQUALEQUAL NOTEQUAL -%left '<' '>' LESSEQUAL GREATEREQUAL + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1450: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1450" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -%left BETWEEN OF -%left AND + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1450: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1450" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -%left '+' '-' -%left '*' '/' '%' -%right '!' -%right '^' + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1450: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr] +" | \ + $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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files -%% + # To avoid expanding it repeatedly, store specified stdout. + : >expout + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -top: - optional_separator - | element_list - ; -element_list: - optional_separator middle_element_list optional_separator - ; + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr] +_ATEOF -middle_element_list: - element - | middle_element_list separator element - ; + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:1450: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1450" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -optional_separator: - /* empty */ - | separator - ; -separator: - ';' - | separator ';' - ; + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y --warnings=error" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -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 THROUGH - {} - DELIMITED - {} - until - | COPY THROUGH - {} - 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 - ; + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -print_args: - print_arg - | print_args print_arg - ; + { set +x +$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -print_arg: - expr %prec ',' - | text - | position %prec ',' - ; -simple_if: - IF any_expr THEN - {} - DELIMITED - ; + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1450: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1450" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -until: - /* empty */ - | UNTIL TEXT - ; +{ set +x +$as_echo "$at_srcdir/regression.at:1450: \$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:1450" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -any_expr: - expr - | text_expr - ; +{ set +x +$as_echo "$at_srcdir/regression.at:1450: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1450" +( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -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 - ; +{ set +x +$as_echo "$at_srcdir/regression.at:1450: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1450" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -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 - ; +# Make sure syntax error doesn't forget that 'a' is expected. It would +# be forgotten without lookahead correction. +{ set +x +$as_echo "$at_srcdir/regression.at:1450: grep 'syntax error,' stderr.txt" +at_fn_check_prepare_trace "regression.at:1450" +( $at_check_trace; grep 'syntax error,' stderr.txt +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -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 ')' - ; +# Check number of default reductions in inconsistent states to be sure +# syntax error is detected before unnecessary reductions are performed. +{ set +x +$as_echo "$at_srcdir/regression.at:1450: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ + < stdout.txt || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ + < stdout.txt || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "14" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -sprintf_args: - /* empty */ - | sprintf_args ',' expr - ; -position: - position_not_place - | place - ; +# Check number of default reductions in consistent states to be sure +# it is performed before the syntax error is detected. +{ set +x +$as_echo "$at_srcdir/regression.at:1450: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ + < stdout.txt || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ + < stdout.txt || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/regression.at:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -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 - ; +# Check number of reallocs to be sure reallocated memory isn't somehow +# lost between LAC invocations. +{ set +x +$as_echo "$at_srcdir/regression.at:1450: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ + || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450" +( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ + || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "3" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450" +$at_failed && at_fn_log_failure +$at_traceon; } -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 - ; +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -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 - ; +%code { + #include -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 - ; +static void yyerror (const char *msg); + int yylex (YYSTYPE *); +} +%debug +%define api.push-pull both %define api.pure +%define parse.error verbose +%token 'c' -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 - ; +// default reductions in inconsistent states +// v v v v v v v v v v v v v v +S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; +// ^ ^ ^ +// LAC reallocs +A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; +B: 'b' ; +C: /*empty*/ { printf ("consistent default reduction\n"); } ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } -static int -yylex (void) +int +yylex (YYSTYPE *v) { - static int const input[] = { - VARIABLE, '=', LABEL, LEFT, DOT_X, 0 - }; - static int const *inputp = input; - return *inputp++; + static char const *input = "bbbbc"; + *v = 0; + return *input++; } +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} +_ATEOF + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1451: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1451" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1451: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr] +" | \ + $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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:1451: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1451" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y --warnings=error" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -Dparse.lac.memory-trace=full \\ + -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -Dparse.lac.memory-trace=full \ + -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/regression.at:1451: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1451" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1451: \$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:1451" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1451: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1451" +( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1451" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + +# Make sure syntax error doesn't forget that 'a' is expected. It would +# be forgotten without lookahead correction. +{ set +x +$as_echo "$at_srcdir/regression.at:1451: grep 'syntax error,' stderr.txt" +at_fn_check_prepare_trace "regression.at:1451" +( $at_check_trace; grep 'syntax error,' stderr.txt +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check number of default reductions in inconsistent states to be sure +# syntax error is detected before unnecessary reductions are performed. +{ set +x +$as_echo "$at_srcdir/regression.at:1451: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ + < stdout.txt || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ + < stdout.txt || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "14" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check number of default reductions in consistent states to be sure +# it is performed before the syntax error is detected. +{ set +x +$as_echo "$at_srcdir/regression.at:1451: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ + < stdout.txt || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ + < stdout.txt || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/regression.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + +# Check number of reallocs to be sure reallocated memory isn't somehow +# lost between LAC invocations. +{ set +x +$as_echo "$at_srcdir/regression.at:1451: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ + || exit 77" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451" +( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ + || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "3" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_414 +#AT_START_415 +at_fn_group_banner 415 'regression.at:1463' \ + "LAC: Memory exhaustion" " " 18 +at_xfail=no +( + $as_echo "415. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + +# Check for memory exhaustion during parsing. + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%code { + #include + +static void yyerror (const char *msg); + static int yylex (void); + #define YYMAXDEPTH 8 +} +%debug +%error-verbose + +%% + +S: A A A A A A A A A ; +A: /*empty*/ | 'a' ; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) { + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; return yyparse (); } _ATEOF -# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before -# expanding macros, so it corrupts some special characters in the -# macros. To avoid this, expand now and pass it the result with proper -# string quotation. Assume args 7 through 12 expand to properly quoted -# strings. +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1496" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1496" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/regression.at:1496: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1496" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1496" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/regression.at:1496: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1496" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1496" +$at_failed && at_fn_log_failure +$at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/existing.at:1403: bison --report=all --defines -o input.c input.y" -at_fn_check_prepare_trace "existing.at:1403" -( $at_check_trace; bison --report=all --defines -o input.c input.y +$as_echo "$at_srcdir/regression.at:1496: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496" +( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path +echo >>"$at_stderr"; $as_echo "input.y: warning: 8 shift/reduce conflicts [-Wconflicts-sr] " | \ $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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496" $at_failed && at_fn_log_failure $at_traceon; } @@ -139532,68 +177633,46 @@ $at_traceon; } # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files + at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Werror +$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1496" $at_failed && at_fn_log_failure $at_traceon; } # Build expected stderr up to and including the "warnings being # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr + cat >experr <<'_ATEOF' +input.y: warning: 8 shift/reduce conflicts [-Wconflicts-sr] +_ATEOF - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr { set +x -$as_echo "$at_srcdir/existing.at:1403: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1403" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 +$as_echo "$at_srcdir/regression.at:1496: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1496" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 0 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496" $at_failed && at_fn_log_failure $at_traceon; } @@ -139601,15 +177680,17 @@ $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=error +$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y --warnings=error" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1496" $at_failed && at_fn_log_failure $at_traceon; } @@ -139618,133 +177699,105 @@ $at_traceon; } # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y -Wnone -Werror +$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y -Wnone -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:1403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --defines -o input.c input.y --warnings=none -Werror +$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y --warnings=none -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi - -{ set +x -$as_echo "$at_srcdir/existing.at:1403: sed -n 's/^State //p' input.output | tail -1" -at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1403" -( $at_check_trace; sed -n 's/^State //p' input.output | tail -1 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "4833 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - -# Canonical LR generates very large tables, resulting in very long -# files with #line directives that may overflow what the standards -# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic -# will issue an error. -# -# There is no "" around `wc` since some indent the result. -if test 32767 -lt `wc -l < input.c`; then - CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'` - CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'` -fi { set +x -$as_echo "$at_srcdir/existing.at:1403: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1403" +$as_echo "$at_srcdir/regression.at:1496: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1496" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1403" +$as_echo "$at_srcdir/regression.at:1496: \$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:1496" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/existing.at:1403: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1403" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/regression.at:1506: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:1506" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1506" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/existing.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "existing.at:1403" +$as_echo "$at_srcdir/regression.at:1506: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1506" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "Starting parse +Entering state 0 +Reading a token: Now at end of input. +LAC: initial context established for \$end +LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded) +memory exhausted +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 0 $at_status "$at_srcdir/existing.at:1403" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1506" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_267 -#AT_START_268 -at_fn_group_banner 268 'regression.at:25' \ - "Trivial grammars" " " 17 -at_xfail=no -( - $as_echo "268. $at_setup_line: testing $at_desc ..." - $at_traceon - - +# Induce an immediate syntax error with an undefined token, and check +# for memory exhaustion while building syntax error message. cat >input.y <<'_ATEOF' %code top { @@ -139755,20 +177808,56 @@ cat >input.y <<'_ATEOF' #undef realloc } -%{ -void yyerror ( const char *msg); -int yylex (void); -#define YYSTYPE int * -%} +%code { + #include +static void yyerror (const char *msg); + static int yylex (void); + #define YYMAXDEPTH 8 +} +%debug %error-verbose %% -program: 'x'; -_ATEOF +S: A A A A A A A A A ; +A: /*empty*/ | 'a' ; + +%% +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "z"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) +{ + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); +} +_ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then @@ -139777,39 +177866,43 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:43" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:43" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:43" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -139818,16 +177911,16 @@ at_status=$? at_failed=false $at_check_filter 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:43" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:43" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -139836,7 +177929,7 @@ at_status=$? at_failed=false $at_check_filter 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:43" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } @@ -139844,86 +177937,210 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:43: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:43" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/regression.at:1510: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" +( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "input.y: warning: 8 shift/reduce conflicts [-Wconflicts-sr] +" | \ + $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:43" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1510" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y: warning: 8 shift/reduce conflicts [-Wconflicts-sr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/regression.at:1510: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1510" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/regression.at:1510" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y --warnings=error" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1510" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1510" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ + -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ + -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1510" $at_failed && at_fn_log_failure $at_traceon; } + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/regression.at:44: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:44" +$as_echo "$at_srcdir/regression.at:1510: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1510" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:44" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:44: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:44" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +$as_echo "$at_srcdir/regression.at:1510: \$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:1510" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:44" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/regression.at:45: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:45" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/regression.at:1523: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:1523" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:45" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1523" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:45: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o -DYYDEBUG -c input.c " -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c " "regression.at:45" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c +$as_echo "$at_srcdir/regression.at:1523: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1523" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:45" +echo >>"$at_stderr"; $as_echo "Starting parse +Entering state 0 +Reading a token: Next token is token \$undefined () +LAC: initial context established for \$undefined +LAC: checking lookahead \$undefined: Always Err +Constructing syntax error message +LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded) +syntax error +memory exhausted +Cleanup: discarding lookahead token \$undefined () +Stack now 0 +" | \ + $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:1523" $at_failed && at_fn_log_failure $at_traceon; } + + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_268 -#AT_START_269 -at_fn_group_banner 269 'regression.at:55' \ - "YYSTYPE typedef" " " 17 +#AT_STOP_415 +#AT_START_416 +at_fn_group_banner 416 'regression.at:1593' \ + "Lex and parse params: yacc.c" " " 18 at_xfail=no ( - $as_echo "269. $at_setup_line: testing $at_desc ..." + $as_echo "416. $at_setup_line: testing $at_desc ..." $at_traceon +## FIXME: Improve parsing of parse-param. + cat >input.y <<'_ATEOF' %code top { @@ -139934,21 +178151,101 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%skeleton "yacc.c" +%union { int ival; } +%parse-param { int x } +// Spaces, tabs, and new lines. +%parse-param { + int y + + +} + %{ -void yyerror ( const char *msg); -int yylex (void); -typedef union { char const *val; } YYSTYPE; -%} + #include -%type program +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (int x, int y, const char *msg); + static int yylex (void); +%} %% +exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; +%% -program: { $$ = ""; }; -_ATEOF + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void yyerror (int x, int y, const char *msg) +{ + YYUSE(x); + YYUSE(y); + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "a"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (yylloc).first_line = (yylloc).last_line = 1; + (yylloc).first_column = (yylloc).last_column = toknum; + return res; +} +int +main (void) +{ + return yyparse(1, 2); +} +_ATEOF + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files @@ -139956,39 +178253,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:73" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/regression.at:1593: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1593" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:73" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:73" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/regression.at:1593: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1593" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:73" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1593: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:73" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1593" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -139997,16 +178294,16 @@ at_status=$? at_failed=false $at_check_filter 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:73" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1593: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:73" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1593" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -140015,7 +178312,7 @@ at_status=$? at_failed=false $at_check_filter 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:73" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593" $at_failed && at_fn_log_failure $at_traceon; } @@ -140023,62 +178320,91 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:73: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:73" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/regression.at:1593: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:1593" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:73" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:74: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:74" + { set +x +$as_echo "$at_srcdir/regression.at:1593: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1593" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:74" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:74: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:74" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +$as_echo "$at_srcdir/regression.at:1593: \$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:1593" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:74" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1593: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1593" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "x: 1, y: 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1593: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1593" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1593" $at_failed && at_fn_log_failure $at_traceon; } + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_269 -#AT_START_270 -at_fn_group_banner 270 'regression.at:85' \ - "Early token definitions with --yacc" " " 17 +#AT_STOP_416 +#AT_START_417 +at_fn_group_banner 417 'regression.at:1594' \ + "Lex and parse params: glr.c" " " 18 at_xfail=no ( - $as_echo "270. $at_setup_line: testing $at_desc ..." + $as_echo "417. $at_setup_line: testing $at_desc ..." $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. +## FIXME: Improve parsing of parse-param. cat >input.y <<'_ATEOF' @@ -140090,28 +178416,101 @@ cat >input.y <<'_ATEOF' #undef realloc } -%{ -void yyerror ( const char *msg); -int yylex (void); -%} +%locations +%skeleton "glr.c" +%union { int ival; } +%parse-param { int x } +// Spaces, tabs, and new lines. +%parse-param { + int y + + +} -%union -{ - int val; -}; %{ -#ifndef MY_TOKEN -# error "MY_TOKEN not defined." + #include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif #endif + +static void yyerror (int x, int y, const char *msg); + static int yylex (void); %} -%token MY_TOKEN + %% -exp: MY_TOKEN; +exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; %% -_ATEOF + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + +/* A C error reporting function. */ +static +void yyerror (int x, int y, const char *msg) +{ + YYUSE(x); + YYUSE(y); + LOCATION_PRINT (stderr, (yylloc)); + fprintf (stderr, ": "); + fprintf (stderr, "%s\n", msg); +} +#include +static +int yylex (void) +{ + static char const input[] = "a"; + static size_t toknum = 0; + int res; + ; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (yylloc).first_line = (yylloc).last_line = 1; + (yylloc).first_column = (yylloc).last_column = toknum; + return res; +} +int +main (void) +{ + return yyparse(1, 2); +} +_ATEOF + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files @@ -140119,39 +178518,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:113" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -y -o input.c input.y +$as_echo "$at_srcdir/regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1594" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:113" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y" "regression.at:113" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -y -o input.c input.y +$as_echo "$at_srcdir/regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1594" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:113" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:113: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1594: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:113" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1594" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -140160,16 +178559,16 @@ at_status=$? at_failed=false $at_check_filter 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:113" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:113: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1594: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:113" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1594" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -140178,7 +178577,7 @@ at_status=$? at_failed=false $at_check_filter 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:113" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594" $at_failed && at_fn_log_failure $at_traceon; } @@ -140186,62 +178585,91 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:113: bison -y -o input.c input.y" -at_fn_check_prepare_trace "regression.at:113" -( $at_check_trace; bison -y -o input.c input.y +$as_echo "$at_srcdir/regression.at:1594: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:1594" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:113" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:114: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:114" + { set +x +$as_echo "$at_srcdir/regression.at:1594: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1594" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:114" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:114: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:114" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +$as_echo "$at_srcdir/regression.at:1594: \$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:1594" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:114" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1594: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1594" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "x: 1, y: 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/regression.at:1594: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1594" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:1594" $at_failed && at_fn_log_failure $at_traceon; } + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_270 -#AT_START_271 -at_fn_group_banner 271 'regression.at:125' \ - "Early token definitions without --yacc" " " 17 +#AT_STOP_417 +#AT_START_418 +at_fn_group_banner 418 'regression.at:1595' \ + "Lex and parse params: lalr1.cc" " " 18 at_xfail=no ( - $as_echo "271. $at_setup_line: testing $at_desc ..." + $as_echo "418. $at_setup_line: testing $at_desc ..." $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. +## FIXME: Improve parsing of parse-param. cat >input.y <<'_ATEOF' @@ -140253,31 +178681,61 @@ cat >input.y <<'_ATEOF' #undef realloc } +%locations +%skeleton "lalr1.cc" +%union { int ival; } +%parse-param { int x } +// Spaces, tabs, and new lines. +%parse-param { + int y + + +} + %{ -#include -void yyerror ( const char *msg); -int yylex (void); -void print_my_token (void); + + static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %} -%union -{ - int val; -}; -%{ +%% +exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; +%% +/* A C++ error reporting function. */ void -print_my_token (void) +yy::parser::error (const location_type& l, const std::string& m) { - enum yytokentype my_token = MY_TOKEN; - printf ("%d\n", my_token); + std::cerr << l << ": " << m << '\n'; } -%} -%token MY_TOKEN -%% -exp: MY_TOKEN; -%% -_ATEOF +#include +static +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + static char const input[] = "a"; + static size_t toknum = 0; + int res; + (void) lvalp;(void) llocp; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (*llocp).begin.line = (*llocp).end.line = 1; + (*llocp).begin.column = (*llocp).end.column = toknum; + return res; +} + +int +yyparse (int x, int y) +{ + yy::parser parser(x, y); + return parser.parse (); +} + +int +main (void) +{ + return yyparse(1, 2); +} +_ATEOF @@ -140287,39 +178745,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:158" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/regression.at:1595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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' "regression.at:1595" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:158" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:158" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/regression.at:1595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1595" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:158" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1595: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:158" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1595" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -140328,16 +178786,16 @@ at_status=$? at_failed=false $at_check_filter 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:158" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1595: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:158" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1595" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -140346,7 +178804,7 @@ at_status=$? at_failed=false $at_check_filter 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:158" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } @@ -140354,198 +178812,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:158: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:158" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/regression.at:1595: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "regression.at:1595" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:158" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:159: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:159" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:159" -$at_failed && at_fn_log_failure -$at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:159: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:159" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:159" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_271 -#AT_START_272 -at_fn_group_banner 272 'regression.at:170' \ - "Braces parsing" " " 17 -at_xfail=no -( - $as_echo "272. $at_setup_line: testing $at_desc ..." - $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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:182" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -v -o input.c input.y +$as_echo "$at_srcdir/regression.at:1595: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1595" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:182" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:182" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y +{ set +x +$as_echo "$at_srcdir/regression.at:1595: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1595" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:182" -$at_failed && at_fn_log_failure -$at_traceon; } - - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/regression.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' "regression.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" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:182" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/regression.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.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 | sort +{ set +x +$as_echo "$at_srcdir/regression.at:1595: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1595" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:182" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "x: 1, y: 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/regression.at:182: bison -v -o input.c input.y" -at_fn_check_prepare_trace "regression.at:182" -( $at_check_trace; bison -v -o input.c input.y +$as_echo "$at_srcdir/regression.at:1595: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1595" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:182" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:184: grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c" -at_fn_check_prepare_trace "regression.at:184" -( $at_check_trace; grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:184" -$at_failed && at_fn_log_failure -$at_traceon; } - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_272 -#AT_START_273 -at_fn_group_banner 273 'regression.at:194' \ - "Duplicate string" " " 17 +#AT_STOP_418 +#AT_START_419 +at_fn_group_banner 419 'regression.at:1596' \ + "Lex and parse params: glr.cc" " " 18 at_xfail=no ( - $as_echo "273. $at_setup_line: testing $at_desc ..." + $as_echo "419. $at_setup_line: testing $at_desc ..." $at_traceon +## FIXME: Improve parsing of parse-param. + cat >input.y <<'_ATEOF' -/* 'Bison -v' used to dump core when two tokens are defined with the same - string, as LE and GE below. */ +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -%token NUM -%token LE "<=" -%token GE "<=" +%locations +%skeleton "glr.cc" +%union { int ival; } +%parse-param { int x } +// Spaces, tabs, and new lines. +%parse-param { + int y + + +} + +%{ + + static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +%} %% -exp: '(' exp ')' | NUM ; +exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; %% +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + static char const input[] = "a"; + static size_t toknum = 0; + int res; + (void) lvalp;(void) llocp; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (*llocp).begin.line = (*llocp).end.line = 1; + (*llocp).begin.column = (*llocp).end.column = toknum; + return res; +} + +int +yyparse (int x, int y) +{ + yy::parser parser(x, y); + return parser.parse (); +} + + +int +main (void) +{ + return yyparse(1, 2); +} _ATEOF @@ -140556,39 +178973,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:211" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -v -o input.c input.y +$as_echo "$at_srcdir/regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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' "regression.at:1596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:211" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:211" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y +$as_echo "$at_srcdir/regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:211" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:211: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1596: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:211" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1596" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -140597,16 +179014,16 @@ at_status=$? at_failed=false $at_check_filter 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:211" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:211: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1596: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:211" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1596" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -140615,7 +179032,7 @@ at_status=$? at_failed=false $at_check_filter 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:211" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } @@ -140623,184 +179040,120 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:211: bison -v -o input.c input.y" -at_fn_check_prepare_trace "regression.at:211" -( $at_check_trace; bison -v -o input.c input.y +$as_echo "$at_srcdir/regression.at:1596: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "regression.at:1596" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - # To avoid expanding it repeatedly, store specified stdout. - : >expout - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror" "regression.at:211" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y -Werror +{ set +x +$as_echo "$at_srcdir/regression.at:1596: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1596" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:211" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } - - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:6.8-14: warning: symbol "<=" used more than once as a literal string -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/regression.at:211: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:211" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 +{ set +x +$as_echo "$at_srcdir/regression.at:1596: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1596" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 0 $at_status "$at_srcdir/regression.at:211" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error" "regression.at:211" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=error +{ set +x +$as_echo "$at_srcdir/regression.at:1596: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1596" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:211" +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "x: 1, y: 2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror" "regression.at:211" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y -Wnone -Werror +{ set +x +$as_echo "$at_srcdir/regression.at:1596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "regression.at:1596" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:211" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror" "regression.at:211" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -v -o input.c input.y --warnings=none -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:211" -$at_failed && at_fn_log_failure -$at_traceon; } - at_restore_special_files -fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_273 -#AT_START_274 -at_fn_group_banner 274 'regression.at:222' \ - "Rule Line Numbers" " " 17 +#AT_STOP_419 +#AT_START_420 +at_fn_group_banner 420 'regression.at:1607' \ + "stdio.h is not needed" " " 18 at_xfail=no ( - $as_echo "274. $at_setup_line: testing $at_desc ..." + $as_echo "420. $at_setup_line: testing $at_desc ..." $at_traceon - cat >input.y <<'_ATEOF' -%% -expr: -'a' - -{ - +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc } -'b' - +%locations +%code { - + static int yylex (void) { return 0; } + static void yyerror (const char* msg) { (void) msg; } } - -| - - +%% +exp: {} +%% +#include /* getenv. */ +#include /* strcmp. */ +int +main (int argc, char const* argv[]) { - - + (void) argc; + (void) argv; + return yyparse (); } - -'c' - -{ - -}; _ATEOF @@ -140811,39 +179164,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:258" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c -v input.y +$as_echo "$at_srcdir/regression.at:1624: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1624" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:258" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y" "regression.at:258" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -v input.y +$as_echo "$at_srcdir/regression.at:1624: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1624" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:258" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1624: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:258" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1624" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -140852,16 +179205,16 @@ at_status=$? at_failed=false $at_check_filter 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:258" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\ +$as_echo "$at_srcdir/regression.at:1624: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:258" +at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1624" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -140870,7 +179223,7 @@ at_status=$? at_failed=false $at_check_filter 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:258" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624" $at_failed && at_fn_log_failure $at_traceon; } @@ -140878,195 +179231,167 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:258: bison -o input.c -v input.y" -at_fn_check_prepare_trace "regression.at:258" -( $at_check_trace; bison -o input.c -v input.y +$as_echo "$at_srcdir/regression.at:1624: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "regression.at:1624" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:258" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624" $at_failed && at_fn_log_failure $at_traceon; } - -# Check the contents of the report. -{ set +x -$as_echo "$at_srcdir/regression.at:261: cat input.output" -at_fn_check_prepare_trace "regression.at:261" -( $at_check_trace; cat input.output + { set +x +$as_echo "$at_srcdir/regression.at:1624: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1624" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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' . +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624" +$at_failed && at_fn_log_failure +$at_traceon; } - \$default reduce using rule 2 (expr) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:261" +{ set +x +$as_echo "$at_srcdir/regression.at:1624: \$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:1624" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1624" $at_failed && at_fn_log_failure $at_traceon; } + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_274 -#AT_START_275 -at_fn_group_banner 275 'regression.at:368' \ - "Mixing %token styles" " " 17 +#AT_STOP_420 +#AT_START_421 +at_fn_group_banner 421 'push.at:24' \ + "Memory Leak for Early Deletion" " " 19 at_xfail=no ( - $as_echo "275. $at_setup_line: testing $at_desc ..." + $as_echo "421. $at_setup_line: testing $at_desc ..." $at_traceon -# Taken from the documentation. +# Requires Valgrind. + cat >input.y <<'_ATEOF' -%token OR "||" -%token LE 134 "<=" -%left OR "<=" +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + + +%{ + #include + #include + #define YYINITDEPTH 1 +#include + +static void yyerror (const char *msg); +%} + +%define api.pure +%define api.push-pull push + %% -exp: ; + +start: 'a' 'b' 'c' ; + %% + + + +/* A C error reporting function. */ +static +void yyerror (const char *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', YY_NULLPTR) == YYPUSH_MORE); + yypstate_delete (ps); + + ps = yypstate_new (); + assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE); + assert (yypush_parse (ps, 'b', YY_NULLPTR) == YYPUSH_MORE); + yypstate_delete (ps); + + return 0; +} _ATEOF + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:380" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -v -o input.c input.y +$as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:73" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:380" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:380" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y +$as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:73" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:380" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:380: \$XSLTPROC \\ +$as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:380" +at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -141075,16 +179400,16 @@ at_status=$? at_failed=false $at_check_filter 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:380" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:380: \$XSLTPROC \\ +$as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:380" +at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -141093,7 +179418,7 @@ at_status=$? at_failed=false $at_check_filter 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:380" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } @@ -141101,109 +179426,68 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:380: bison -v -o input.c input.y" -at_fn_check_prepare_trace "regression.at:380" -( $at_check_trace; bison -v -o input.c input.y +$as_echo "$at_srcdir/push.at:73: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "push.at:73" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:380" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:73" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/push.at:74: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:74" +( $at_check_trace; $BISON_C_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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 - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_275 -#AT_START_276 -at_fn_group_banner 276 'regression.at:391' \ - "Invalid inputs" " " 17 -at_xfail=no -( - $as_echo "276. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' -%% -? -default: 'a' } -%& -%a-does-not-exist -%- -%{ -_ATEOF - - +{ set +x +$as_echo "$at_srcdir/push.at:74: \$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:74" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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/regression.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" "regression.at:403" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y +$as_echo "$at_srcdir/push.at:75: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:75" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:2.1: error: invalid character: '?' -input.y:3.14: error: invalid character: '}' -input.y:4.1: error: invalid character: '%' -input.y:4.2: error: invalid character: '&' -input.y:5.1-17: error: invalid directive: '%a-does-not-exist' -input.y:6.1: error: invalid character: '%' -input.y:6.2: error: invalid character: '-' -input.y:7.1-8.0: error: missing '%}' at end of file -input.y:7.1-8.0: error: syntax error, unexpected %{...%} -" | \ - $at_diff - "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:403" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:75" $at_failed && at_fn_log_failure $at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_276 -#AT_START_277 -at_fn_group_banner 277 'regression.at:418' \ - "Invalid inputs with {}" " " 17 -at_xfail=no -( - $as_echo "277. $at_setup_line: testing $at_desc ..." - $at_traceon - - -cat >input.y <<'_ATEOF' - -%destructor -%initial-action -%lex-param -%parse-param -%printer -%union -_ATEOF - - - { set +x -$as_echo "$at_srcdir/regression.at:430: 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:430" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y +$as_echo "$at_srcdir/push.at:75: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "push.at:75" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...} -" | \ - $at_diff - "$at_stderr" || at_failed=: +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/regression.at:430" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:75" $at_failed && at_fn_log_failure $at_traceon; } @@ -141213,18 +179497,20 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_277 -#AT_START_278 -at_fn_group_banner 278 'regression.at:443' \ - "Token definitions" " " 17 +#AT_STOP_421 +#AT_START_422 +at_fn_group_banner 422 'push.at:83' \ + "Multiple impure instances" " " 19 at_xfail=no ( - $as_echo "278. $at_setup_line: testing $at_desc ..." + $as_echo "422. $at_setup_line: testing $at_desc ..." $at_traceon -# Bison managed, when fed with '%token 'f' "f"' to #define 'f'! + + + cat >input.y <<'_ATEOF' %code top { #include @@ -141234,27 +179520,28 @@ cat >input.y <<'_ATEOF' #undef realloc } + %{ -#include + #include + #include #include -static void yyerror ( const char *msg); + +static void yyerror (const char *msg); static 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??!" + +%define api.push-pull both + %% -exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"; + +start: ; + %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -141262,7 +179549,7 @@ void yyerror ( const char *msg) static int yylex (void) { - static int const input[] = { SPECIAL }; + static char const input[] = ""; static size_t toknum = 0; int res; ; @@ -141275,56 +179562,65 @@ int yylex (void) int main (void) { - return yyparse (); + int i; + for (i = 0; i < 2; ++i) + { + yypstate *ps = yypstate_new (); + assert (ps); + assert (yypstate_new () == YY_NULLPTR); + assert (yyparse () == 2); + yychar = 0; + assert (yypush_parse (ps) == 0); + assert (yypstate_new () == YY_NULLPTR); + assert (yyparse () == 2); + yypstate_delete (ps); + } + + return 0; } _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 at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:480" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:133" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:480" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:133" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:480: \$XSLTPROC \\ +$as_echo "$at_srcdir/push.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' "regression.at:480" +at_fn_check_prepare_notrace 'a `...` command substitution' "push.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 @@ -141333,16 +179629,16 @@ at_status=$? at_failed=false $at_check_filter 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:480" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:480: \$XSLTPROC \\ +$as_echo "$at_srcdir/push.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:480" +at_fn_check_prepare_notrace 'a `...` command substitution' "push.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 | sort @@ -141351,7 +179647,7 @@ at_status=$? at_failed=false $at_check_filter 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:480" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } @@ -141359,179 +179655,174 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:480: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:480" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/push.at:133: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "push.at:133" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - - # To avoid expanding it repeatedly, store specified stdout. - : >expout - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "regression.at:480" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror +{ set +x +$as_echo "$at_srcdir/push.at:133: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:133" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:480" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } - - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -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 -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/regression.at:480: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:480" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 +{ set +x +$as_echo "$at_srcdir/push.at:133: \$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:133" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 0 $at_status "$at_srcdir/regression.at:480" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "regression.at:480" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error +{ set +x +$as_echo "$at_srcdir/push.at:133: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:133" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:480" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "regression.at:480" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror +{ set +x +$as_echo "$at_srcdir/push.at:133: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "push.at:133" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:480" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "regression.at:480" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:480" -$at_failed && at_fn_log_failure -$at_traceon; } - at_restore_special_files -fi + + + +cat >input.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + + +%{ + #include + #include +#include + +static void yyerror (const char *msg); + +%} + +%define api.push-pull push + +%% + +start: ; + +%% + + +/* A C error reporting function. */ +static +void yyerror (const char *msg) +{ + fprintf (stderr, "%s\n", msg); +} + + +int +main (void) +{ + int i; + for (i = 0; i < 2; ++i) + { + yypstate *ps = yypstate_new (); + assert (ps); + assert (yypstate_new () == YY_NULLPTR); + ; + yychar = 0; + assert (yypush_parse (ps) == 0); + assert (yypstate_new () == YY_NULLPTR); + ; + yypstate_delete (ps); + } + + return 0; +} +_ATEOF + + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -fcaret -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:484" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -fcaret -o input.c input.y +$as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:134" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:484" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y" "regression.at:484" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -fcaret -o input.c input.y +$as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:134" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:484" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:484: \$XSLTPROC \\ +$as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:484" +at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -141540,16 +179831,16 @@ at_status=$? at_failed=false $at_check_filter 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:484" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:484: \$XSLTPROC \\ +$as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:484" +at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -141558,7 +179849,7 @@ at_status=$? at_failed=false $at_check_filter 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:484" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } @@ -141566,221 +179857,130 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:484: bison -fcaret -o input.c input.y" -at_fn_check_prepare_trace "regression.at:484" -( $at_check_trace; bison -fcaret -o input.c input.y +$as_echo "$at_srcdir/push.at:134: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "push.at:134" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared - %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\" - ^^^^^^^ -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 - %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:484" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - - # To avoid expanding it repeatedly, store specified stdout. - : >expout - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror" "regression.at:484" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Werror +{ set +x +$as_echo "$at_srcdir/push.at:134: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:134" +( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:484" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } - - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:22.8-14: warning: symbol SPECIAL redeclared - %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" - ^^^^^^^ -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 - %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/regression.at:484: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:484" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 +{ set +x +$as_echo "$at_srcdir/push.at:134: \$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:134" +( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 0 $at_status "$at_srcdir/regression.at:484" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error" "regression.at:484" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=error +{ set +x +$as_echo "$at_srcdir/push.at:134: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:134" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:484" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } - - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror" "regression.at:484" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y -Wnone -Werror +{ set +x +$as_echo "$at_srcdir/push.at:134: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "push.at:134" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:484" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror" "regression.at:484" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fcaret -o input.c input.y --warnings=none -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:484" -$at_failed && at_fn_log_failure -$at_traceon; } - at_restore_special_files -fi -{ set +x -$as_echo "$at_srcdir/regression.at:492: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:492" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:492" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:492: \$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:492" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:492" -$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 + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_422 +#AT_START_423 +at_fn_group_banner 423 'push.at:144' \ + "Unsupported Skeletons" " " 19 +at_xfail=no +( + $as_echo "423. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.y <<'_ATEOF' +%glr-parser +%define api.push-pull push +%% +start: ; _ATEOF -{ set +x -$as_echo "$at_srcdir/regression.at:501: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:501" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:501" -$at_failed && at_fn_log_failure -$at_traceon; } + + { set +x -$as_echo "$at_srcdir/regression.at:501: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:501" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/push.at:157: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "push.at:157" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "input.y:2.9-21: error: %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/regression.at:501" +at_fn_check_status 1 $at_status "$at_srcdir/push.at:157" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_278 -#AT_START_279 -at_fn_group_banner 279 'regression.at:511' \ - "Characters Escapes" " " 17 +#AT_STOP_423 +#AT_START_424 +at_fn_group_banner 424 'c++.at:26' \ + "C++ Locations" " " 20 at_xfail=no ( - $as_echo "279. $at_setup_line: testing $at_desc ..." + $as_echo "424. $at_setup_line: testing $at_desc ..." $at_traceon @@ -141794,19 +179994,79 @@ cat >input.y <<'_ATEOF' #undef realloc } -%{ -void yyerror ( const char *msg); -int yylex (void); -%} +%code {#include } +%locations +%debug +%skeleton "lalr1.cc" +%code +{ + +static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); +} %% -exp: - '\'' "\'" -| '\"' "\"" -| '"' "'" /* Pacify font-lock-mode: ". */ -; -_ATEOF +exp: %empty; +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + (void) lvalp;(void) llocp; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + (*llocp).begin.line = (*llocp).end.line = 1; + (*llocp).begin.column = (*llocp).end.column = toknum; + return res; +} + +template +bool +check (const T& in, const std::string& s) +{ + std::stringstream os; + os << in; + if (os.str () != s) + { + std::cerr << "fail: " << os.str () << ", expected: " << s << '\n'; + return false; + } + return true; +} + +int +main (void) +{ + int fail = 0; + yy::parser::location_type loc; fail += check (loc, "1.1"); + fail += check (loc + 10, "1.1-10"); + loc += 10; fail += check (loc, "1.1-10"); + loc += -5; fail += check (loc, "1.1-5"); + fail += check (loc - 5, "1.1"); + loc -= 5; fail += check (loc, "1.1"); + // Check that we don't go below. + // http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html + loc -= 10; fail += check (loc, "1.1"); + loc.columns (10); loc.lines (10); fail += check (loc, "1.1-11.0"); + loc.lines (-2); fail += check (loc, "1.1-9.0"); + loc.lines (-10); fail += check (loc, "1.1"); + yy::parser::location_type loc2 (YY_NULLPTR, 5, 10); + fail += check (loc2, "5.10"); + fail += check (loc + loc2, "1.1-5.9"); + loc += loc2; fail += check (loc, "1.1-5.9"); + return !fail; +} +_ATEOF @@ -141816,39 +180076,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:529" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/c++.at:85: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:85" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:529" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:85" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:529" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/c++.at:85: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:85" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:529" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:85" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:529: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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' "regression.at:529" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 @@ -141857,16 +180117,16 @@ at_status=$? at_failed=false $at_check_filter 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:529" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:85" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:529: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:529" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 | sort @@ -141875,7 +180135,7 @@ at_status=$? at_failed=false $at_check_filter 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:529" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:85" $at_failed && at_fn_log_failure $at_traceon; } @@ -141883,122 +180143,222 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:529: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:529" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/c++.at:85: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "c++.at:85" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:529" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:85" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/regression.at:530: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:530" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/c++.at:85: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:85" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:530" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:85" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:530: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:530" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c +$as_echo "$at_srcdir/c++.at:85: \$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:85" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:530" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:85" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:86: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:86" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:86" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:86: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:86" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:86" $at_failed && at_fn_log_failure $at_traceon; } + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_279 -#AT_START_280 -at_fn_group_banner 280 'regression.at:544' \ - "Web2c Report" " " 17 +#AT_STOP_424 +#AT_START_425 +at_fn_group_banner 425 'c++.at:95' \ + "C++ Variant-based Symbols" " " 20 at_xfail=no ( - $as_echo "280. $at_setup_line: testing $at_desc ..." + $as_echo "425. $at_setup_line: testing $at_desc ..." $at_traceon -cat >input.y <<'_ATEOF' -%token undef_id_tok const_id_tok -%start CONST_DEC_PART +# Store strings and integers in a vector of strings. +cat >list.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -%% -CONST_DEC_PART: - CONST_DEC_LIST - ; +%skeleton "lalr1.cc" +%define api.value.type variant +%define parse.assert +%debug -CONST_DEC_LIST: - CONST_DEC - | CONST_DEC_LIST CONST_DEC - ; +%code top +{ + // Get access to stack_symbol_type for the tests. +# define private public +} +%code provides +{ + static int yylex (yy::parser::semantic_type *lvalp); +} + +%token INT "int" +%type < std::vector > exp + +%printer { yyo << $$; } +%printer + { + for (std::vector::const_iterator i = $$.begin (); i != $$.end (); ++i) + { + if (i != $$.begin ()) + yyo << ", "; + yyo << *i; + } + } < std::vector > + +%code requires { #include } +%code { int yylex (yy::parser::semantic_type* yylval); } -CONST_DEC: - { } undef_id_tok '=' const_id_tok ';' - ; %% +exp: "int" { $$.push_back ($1); } +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include +static +int yylex (yy::parser::semantic_type *lvalp) +{ + static char const input[] = ""; + static size_t toknum = 0; + int res; + (void) lvalp;; + assert (toknum < sizeof input / sizeof input[0]); + res = input[toknum++]; + ; + return res; +} + +int main() +{ + { + yy::parser::symbol_type s = yy::parser::make_INT(12); + std::cerr << s.value.as() << '\n'; + } + + { + yy::parser::symbol_type s = yy::parser::make_INT(123); + yy::parser::stack_symbol_type ss(1, s); + std::cerr << ss.value.as() << '\n'; + } + + { + yy::parser::stack_type st; + for (int i = 0; i < 100; ++i) + { + yy::parser::symbol_type s(yy::parser::make_INT(i)); + yy::parser::stack_symbol_type ss(1, s); + st.push(ss); + } + } +} _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:569: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:569" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -v input.y +$as_echo "$at_srcdir/c++.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o list.cc list.y" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:165" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:569" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:165" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:569: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y" "regression.at:569" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v input.y +$as_echo "$at_srcdir/c++.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:165" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:569" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:165" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:569: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:165: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:569" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:165" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -142007,16 +180367,16 @@ at_status=$? at_failed=false $at_check_filter 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:569" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:165" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:569: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:165: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:569" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:165" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -142025,7 +180385,7 @@ at_status=$? at_failed=false $at_check_filter 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:569" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:165" $at_failed && at_fn_log_failure $at_traceon; } @@ -142033,222 +180393,300 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:569: bison -v input.y" -at_fn_check_prepare_trace "regression.at:569" -( $at_check_trace; bison -v input.y +$as_echo "$at_srcdir/c++.at:165: bison -fno-caret -o list.cc list.y" +at_fn_check_prepare_trace "c++.at:165" +( $at_check_trace; bison -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:569" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:165" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/regression.at:570: cat input.output" -at_fn_check_prepare_trace "regression.at:570" -( $at_check_trace; cat input.output +$as_echo "$at_srcdir/c++.at:165: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:165" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:165" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:165: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:165" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:165" +$at_failed && at_fn_log_failure +$at_traceon; } -State 6 +{ set +x +$as_echo "$at_srcdir/c++.at:169: \$PREPARSER ./list" +at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:169" +( $at_check_trace; $PREPARSER ./list +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +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; } - 3 CONST_DEC_LIST: CONST_DEC_LIST CONST_DEC . +{ set +x +$as_echo "$at_srcdir/c++.at:169: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:169" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "12 +123 +" | \ + $at_diff - "$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; } - \$default reduce using rule 3 (CONST_DEC_LIST) -State 7 - 5 CONST_DEC: \$@1 undef_id_tok . '=' const_id_tok ';' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_425 +#AT_START_426 +at_fn_group_banner 426 'c++.at:378' \ + "Variants lalr1.cc " " " 20 +at_xfail=no +( + $as_echo "426. $at_setup_line: testing $at_desc ..." + $at_traceon - '=' shift, and go to state 8 -State 8 +# Store strings and integers in a vector of strings. +cat >list.y <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} - 5 CONST_DEC: \$@1 undef_id_tok '=' . const_id_tok ';' +%debug +%define api.value.type variant +%skeleton "lalr1.cc" - const_id_tok shift, and go to state 9 +%code requires // code for the .hh file +{ +#include +#include +typedef std::vector strings_type; +} +%code top // code for the .cc file. +{ +#include // abort, getenv +#include +#include +#include +#include -State 9 - 5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok . ';' + typedef std::vector strings_type; - ';' shift, and go to state 10 + namespace yy + { + // Must be available early, as is used in %destructor. + std::ostream& + operator<<(std::ostream& o, const strings_type& s) + { + o << '('; + for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) + { + if (i != s.begin ()) + o << ", "; + o << *i; + } + return o << ')'; + } + } +} +%code // code for the .cc file. +{ + namespace yy + { + static + parser::token_type yylex (parser::semantic_type* yylval); + + // Conversion to string. + template + inline + std::string + to_string (const T& t) + { + std::ostringstream o; + o << t; + return o.str (); + } + } +} -State 10 +%token <::std::string> TEXT; +%token NUMBER; +%token END_OF_FILE 0; +%token COMMA "," - 5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';' . +%type <::std::string> item; +// Using the template type to exercize its parsing. +// Starting with :: to ensure we don't output "<::" which starts by the +// digraph for the left square bracket. +%type <::std::vector> list; - \$default reduce using rule 5 (CONST_DEC) -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:570" -$at_failed && at_fn_log_failure -$at_traceon; } +%printer { yyo << $$; } + <::std::string> <::std::vector>; +%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; +%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>; +%% +result: + list { std::cout << $1 << '\n'; } +; - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_280 -#AT_START_281 -at_fn_group_banner 281 'regression.at:721' \ - "Web2c Actions" " " 17 -at_xfail=no -( - $as_echo "281. $at_setup_line: testing $at_desc ..." - $at_traceon +list: + item { $$.push_back ($1); } +| list "," item { std::swap ($$, $1); $$.push_back ($3); } +| list error { std::swap ($$, $1); } +; +item: + TEXT { std::swap ($$, $1); } +| NUMBER { if ($1 == 3) YYERROR; else $$ = to_string ($1); } +; +%% +#ifdef TWO_STAGE_BUILD +# define BUILD(Type, Value) build () = Value +#else +# define BUILD(Type, Value) build (Value) +#endif +#define STAGE_MAX 5 +namespace yy +{ + static + parser::token_type yylex (parser::semantic_type* yylval) + { + // The 5 is a syntax error whose recovery requires that we discard + // the lookahead. This tests a regression, see + // . + static char const *input = "0,1,2,3,45,6"; + switch (int stage = *input++) + { + case 0: + return parser::token::END_OF_FILE; + + case ',': + + + return parser::token::COMMA; + + default: + stage = stage - '0'; + if (stage % 2) + { + yylval->BUILD (int, stage); + return parser::token::NUMBER; + } + else + { + yylval->BUILD (std::string, to_string (stage)); + return parser::token::TEXT; + } + } + abort (); + } +} -cat >input.y <<'_ATEOF' -%% -statement: struct_stat; -struct_stat: /* empty. */ | if else; -if: "if" "const" "then" statement; -else: "else" statement; -%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); +} _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:734" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -v -o input.c input.y +$as_echo "$at_srcdir/c++.at:378: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o list.cc list.y" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:378" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:734" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:378" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:734" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -v -o input.c input.y +$as_echo "$at_srcdir/c++.at:378: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:378" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:734" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:378" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:734: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:378: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:734" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:378" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -142257,16 +180695,16 @@ at_status=$? at_failed=false $at_check_filter 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:734" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:378" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:734: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:378: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:734" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:378" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -142275,7 +180713,7 @@ at_status=$? at_failed=false $at_check_filter 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:734" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:378" $at_failed && at_fn_log_failure $at_traceon; } @@ -142283,144 +180721,116 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:734: bison -v -o input.c input.y" -at_fn_check_prepare_trace "regression.at:734" -( $at_check_trace; bison -v -o input.c input.y +$as_echo "$at_srcdir/c++.at:378: bison -fno-caret -o list.cc list.y" +at_fn_check_prepare_trace "c++.at:378" +( $at_check_trace; bison -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:734" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:378" $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/c++.at:378: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:378" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:378" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:739: cat tables.c" -at_fn_check_prepare_trace "regression.at:739" -( $at_check_trace; cat tables.c +$as_echo "$at_srcdir/c++.at:378: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:378" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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\", YY_NULL -}; -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 -}; +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:378" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:378: \$PREPARSER ./list" +at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:378" +( $at_check_trace; $PREPARSER ./list +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:739" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:378" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:378: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:378" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "Destroy: \"\" +Destroy: \"0\" +Destroy: 1 +Destroy: \"1\" +Destroy: () +Destroy: \"\" +Destroy: \"2\" +Destroy: () +Destroy: \"\" +Destroy: 3 +Destroy: () +Destroy: \"\" +Destroy: \"4\" +Destroy: () +Destroy: () +Destroy: 5 +Destroy: () +Destroy: \"\" +Destroy: \"6\" +Destroy: () +Destroy: (0, 1, 2, 4, 6) +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:378" $at_failed && at_fn_log_failure $at_traceon; } + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_281 -#AT_START_282 -at_fn_group_banner 282 'regression.at:936' \ - "Dancer " " " 17 +#AT_STOP_426 +#AT_START_427 +at_fn_group_banner 427 'c++.at:379' \ + "Variants lalr1.cc parse.assert" " " 20 at_xfail=no ( - $as_echo "282. $at_setup_line: testing $at_desc ..." + $as_echo "427. $at_setup_line: testing $at_desc ..." $at_traceon -cat >dancer.y <<'_ATEOF' + +# Store strings and integers in a vector of strings. +cat >list.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -142429,81 +180839,159 @@ cat >dancer.y <<'_ATEOF' #undef realloc } -%code provides +%debug +%define api.value.type variant +%skeleton "lalr1.cc" %define parse.assert + +%code requires // code for the .hh file +{ +#include +#include +typedef std::vector strings_type; +} + +%code top // code for the .cc file. +{ +#include // abort, getenv +#include +#include +#include +#include + + + typedef std::vector strings_type; + + namespace yy + { + // Must be available early, as is used in %destructor. + std::ostream& + operator<<(std::ostream& o, const strings_type& s) + { + o << '('; + for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) + { + if (i != s.begin ()) + o << ", "; + o << *i; + } + return o << ')'; + } + } +} + +%code // code for the .cc file. { - static void yyerror ( const char *msg); - static int yylex (void); + namespace yy + { + static + parser::token_type yylex (parser::semantic_type* yylval); + + // Conversion to string. + template + inline + std::string + to_string (const T& t) + { + std::ostringstream o; + o << t; + return o.str (); + } + } } -%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 ':' - | '<' '>' - ; +%token <::std::string> TEXT; +%token NUMBER; +%token END_OF_FILE 0; +%token COMMA "," -from: DATA - | STRING - | INVALID - ; +%type <::std::string> item; +// Using the template type to exercize its parsing. +// Starting with :: to ensure we don't output "<::" which starts by the +// digraph for the left square bracket. +%type <::std::vector> list; -to: DATA - | STRING - | INVALID - ; +%printer { yyo << $$; } + <::std::string> <::std::vector>; +%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; +%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>; +%% -type: DATA - | STRING - | INVALID - ; +result: + list { std::cout << $1 << '\n'; } +; -body: /* empty */ - | body member - ; +list: + item { $$.push_back ($1); } +| list "," item { std::swap ($$, $1); $$.push_back ($3); } +| list error { std::swap ($$, $1); } +; -member: STRING - | DATA - | '+' NUMBER - | '-' NUMBER - | NUMBER - | INVALID - ; +item: + TEXT { std::swap ($$, $1); } +| NUMBER { if ($1 == 3) YYERROR; else $$ = to_string ($1); } +; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) +#ifdef TWO_STAGE_BUILD +# define BUILD(Type, Value) build () = Value +#else +# define BUILD(Type, Value) build (Value) +#endif + +#define STAGE_MAX 5 +namespace yy { - fprintf (stderr, "%s\n", msg); + static + parser::token_type yylex (parser::semantic_type* yylval) + { + // The 5 is a syntax error whose recovery requires that we discard + // the lookahead. This tests a regression, see + // . + static char const *input = "0,1,2,3,45,6"; + switch (int stage = *input++) + { + case 0: + return parser::token::END_OF_FILE; + + case ',': + + + return parser::token::COMMA; + + default: + stage = stage - '0'; + if (stage % 2) + { + yylval->BUILD (int, stage); + return parser::token::NUMBER; + } + else + { + yylval->BUILD (std::string, to_string (stage)); + return parser::token::TEXT; + } + } + + abort (); + } } -#include -static -int yylex (void) + +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - static char const input[] = ":"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; + std::cerr << m << '\n'; } - - +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return yyparse (); + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF @@ -142515,39 +181003,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:936: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:936" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o dancer.c dancer.y +$as_echo "$at_srcdir/c++.at:379: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o list.cc list.y" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:379" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:936" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:936: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:936" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y +$as_echo "$at_srcdir/c++.at:379: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:379" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:936" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:936: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:379: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:936" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:379" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -142556,16 +181044,16 @@ at_status=$? at_failed=false $at_check_filter 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:936" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:936: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:379: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:936" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:379" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -142574,7 +181062,7 @@ at_status=$? at_failed=false $at_check_filter 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:936" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } @@ -142582,91 +181070,116 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:936: bison -o dancer.c dancer.y" -at_fn_check_prepare_trace "regression.at:936" -( $at_check_trace; bison -o dancer.c dancer.y +$as_echo "$at_srcdir/c++.at:379: bison -fno-caret -o list.cc list.y" +at_fn_check_prepare_trace "c++.at:379" +( $at_check_trace; bison -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:936" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:936: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:936" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/c++.at:379: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:379" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:936" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:936: \$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:936" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS +$as_echo "$at_srcdir/c++.at:379: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:379" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:936" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:936: \$PREPARSER ./dancer" -at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:936" -( $at_check_trace; $PREPARSER ./dancer +$as_echo "$at_srcdir/c++.at:379: \$PREPARSER ./list" +at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:379" +( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:936" +echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:936: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:936" +$as_echo "$at_srcdir/c++.at:379: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:379" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':' +echo >>"$at_stderr"; $as_echo "Destroy: \"\" +Destroy: \"0\" +Destroy: 1 +Destroy: \"1\" +Destroy: () +Destroy: \"\" +Destroy: \"2\" +Destroy: () +Destroy: \"\" +Destroy: 3 +Destroy: () +Destroy: \"\" +Destroy: \"4\" +Destroy: () +Destroy: () +Destroy: 5 +Destroy: () +Destroy: \"\" +Destroy: \"6\" +Destroy: () +Destroy: (0, 1, 2, 4, 6) " | \ $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:936" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:379" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_282 -#AT_START_283 -at_fn_group_banner 283 'regression.at:937' \ - "Dancer %glr-parser" " " 17 +#AT_STOP_427 +#AT_START_428 +at_fn_group_banner 428 'c++.at:380' \ + "Variants lalr1.cc parse.assert %locations" " " 20 at_xfail=no ( - $as_echo "283. $at_setup_line: testing $at_desc ..." + $as_echo "428. $at_setup_line: testing $at_desc ..." $at_traceon -cat >dancer.y <<'_ATEOF' + +# Store strings and integers in a vector of strings. +cat >list.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -142675,81 +181188,166 @@ cat >dancer.y <<'_ATEOF' #undef realloc } -%code provides +%debug +%define api.value.type variant +%skeleton "lalr1.cc" %define parse.assert %locations + +%code requires // code for the .hh file { - static void yyerror ( const char *msg); - static int yylex (void); +#include +#include +typedef std::vector strings_type; } -%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 ':' - | '<' '>' - ; +%code top // code for the .cc file. +{ +#include // abort, getenv +#include +#include +#include +#include -from: DATA - | STRING - | INVALID - ; -to: DATA - | STRING - | INVALID - ; + typedef std::vector strings_type; -type: DATA - | STRING - | INVALID - ; + namespace yy + { + // Must be available early, as is used in %destructor. + std::ostream& + operator<<(std::ostream& o, const strings_type& s) + { + o << '('; + for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) + { + if (i != s.begin ()) + o << ", "; + o << *i; + } + return o << ')'; + } + } +} -body: /* empty */ - | body member - ; +%code // code for the .cc file. +{ + namespace yy + { + static + parser::token_type yylex (parser::semantic_type* yylval, + parser::location_type* yylloc); + + // Conversion to string. + template + inline + std::string + to_string (const T& t) + { + std::ostringstream o; + o << t; + return o.str (); + } + } +} -member: STRING - | DATA - | '+' NUMBER - | '-' NUMBER - | NUMBER - | INVALID - ; +%token <::std::string> TEXT; +%token NUMBER; +%token END_OF_FILE 0; +%token COMMA "," + +%type <::std::string> item; +// Using the template type to exercize its parsing. +// Starting with :: to ensure we don't output "<::" which starts by the +// digraph for the left square bracket. +%type <::std::vector> list; + +%printer { yyo << $$; } + <::std::string> <::std::vector>; +%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; +%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) + +result: + list { std::cout << $1 << '\n'; } +; + +list: + item { $$.push_back ($1); } +| list "," item { std::swap ($$, $1); $$.push_back ($3); } +| list error { std::swap ($$, $1); } +; + +item: + TEXT { std::swap ($$, $1); } +| NUMBER { if ($1 == 3) YYERROR; else $$ = to_string ($1); } +; +%% +#ifdef TWO_STAGE_BUILD +# define BUILD(Type, Value) build () = Value +#else +# define BUILD(Type, Value) build (Value) +#endif + +#define STAGE_MAX 5 +namespace yy { - fprintf (stderr, "%s\n", msg); + static + parser::token_type yylex (parser::semantic_type* yylval, + parser::location_type* yylloc) + { + typedef parser::location_type location; + // The 5 is a syntax error whose recovery requires that we discard + // the lookahead. This tests a regression, see + // . + static char const *input = "0,1,2,3,45,6"; + switch (int stage = *input++) + { + case 0: + *yylloc = location (); + return parser::token::END_OF_FILE; + + case ',': + + + *yylloc = location (); + return parser::token::COMMA; + + default: + stage = stage - '0'; + if (stage % 2) + { + yylval->BUILD (int, stage); + *yylloc = location (); + return parser::token::NUMBER; + } + else + { + yylval->BUILD (std::string, to_string (stage)); + *yylloc = location (); + return parser::token::TEXT; + } + } + + abort (); + } } -#include -static -int yylex (void) + +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) { - static char const input[] = ":"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; + std::cerr << l << ": " << m << '\n'; } - - +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return yyparse (); + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF @@ -142761,39 +181359,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:937: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:937" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o dancer.c dancer.y +$as_echo "$at_srcdir/c++.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o list.cc list.y" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:380" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:937" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:937: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:937" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.c dancer.y +$as_echo "$at_srcdir/c++.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:380" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:937" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:937: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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' "regression.at:937" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 @@ -142802,16 +181400,16 @@ at_status=$? at_failed=false $at_check_filter 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:937" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:937: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:937" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 | sort @@ -142820,7 +181418,7 @@ at_status=$? at_failed=false $at_check_filter 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:937" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } @@ -142828,91 +181426,116 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:937: bison -o dancer.c dancer.y" -at_fn_check_prepare_trace "regression.at:937" -( $at_check_trace; bison -o dancer.c dancer.y +$as_echo "$at_srcdir/c++.at:380: bison -fno-caret -o list.cc list.y" +at_fn_check_prepare_trace "c++.at:380" +( $at_check_trace; bison -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:937" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:937: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:937" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/c++.at:380: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:380" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:937" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:937: \$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:937" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS +$as_echo "$at_srcdir/c++.at:380: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:380" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:937" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:937: \$PREPARSER ./dancer" -at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:937" -( $at_check_trace; $PREPARSER ./dancer +$as_echo "$at_srcdir/c++.at:380: \$PREPARSER ./list" +at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:380" +( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:937" +echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:937: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:937" +$as_echo "$at_srcdir/c++.at:380: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:380" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':' +echo >>"$at_stderr"; $as_echo "Destroy: \"\" +Destroy: \"0\" +Destroy: 1 +Destroy: \"1\" +Destroy: () +Destroy: \"\" +Destroy: \"2\" +Destroy: () +Destroy: \"\" +Destroy: 3 +Destroy: () +Destroy: \"\" +Destroy: \"4\" +Destroy: () +Destroy: () +Destroy: 5 +Destroy: () +Destroy: \"\" +Destroy: \"6\" +Destroy: () +Destroy: (0, 1, 2, 4, 6) " | \ $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:937" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:380" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_283 -#AT_START_284 -at_fn_group_banner 284 'regression.at:938' \ - "Dancer %skeleton \"lalr1.cc\"" " " 17 +#AT_STOP_428 +#AT_START_429 +at_fn_group_banner 429 'c++.at:381' \ + "Variants lalr1.cc parse.assert %code {\\n#define TWO_STAGE_BUILD\\n}" "" 20 at_xfail=no ( - $as_echo "284. $at_setup_line: testing $at_desc ..." + $as_echo "429. $at_setup_line: testing $at_desc ..." $at_traceon -cat >dancer.y <<'_ATEOF' + +# Store strings and integers in a vector of strings. +cat >list.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -142921,90 +181544,161 @@ cat >dancer.y <<'_ATEOF' #undef realloc } -%code provides +%debug +%define api.value.type variant +%skeleton "lalr1.cc" %define parse.assert %code { +#define TWO_STAGE_BUILD +} + +%code requires // code for the .hh file +{ +#include +#include +typedef std::vector strings_type; +} + +%code top // code for the .cc file. { +#include // abort, getenv +#include +#include +#include +#include - static int yylex (yy::parser::semantic_type *lvalp); + + typedef std::vector strings_type; + + namespace yy + { + // Must be available early, as is used in %destructor. + std::ostream& + operator<<(std::ostream& o, const strings_type& s) + { + o << '('; + for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) + { + if (i != s.begin ()) + o << ", "; + o << *i; + } + return o << ')'; + } + } } -%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 ':' - | '<' '>' - ; +%code // code for the .cc file. +{ + namespace yy + { + static + parser::token_type yylex (parser::semantic_type* yylval); + + // Conversion to string. + template + inline + std::string + to_string (const T& t) + { + std::ostringstream o; + o << t; + return o.str (); + } + } +} -from: DATA - | STRING - | INVALID - ; +%token <::std::string> TEXT; +%token NUMBER; +%token END_OF_FILE 0; +%token COMMA "," -to: DATA - | STRING - | INVALID - ; +%type <::std::string> item; +// Using the template type to exercize its parsing. +// Starting with :: to ensure we don't output "<::" which starts by the +// digraph for the left square bracket. +%type <::std::vector> list; -type: DATA - | STRING - | INVALID - ; +%printer { yyo << $$; } + <::std::string> <::std::vector>; +%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; +%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>; +%% -body: /* empty */ - | body member - ; +result: + list { std::cout << $1 << '\n'; } +; -member: STRING - | DATA - | '+' NUMBER - | '-' NUMBER - | NUMBER - | INVALID - ; +list: + item { $$.push_back ($1); } +| list "," item { std::swap ($$, $1); $$.push_back ($3); } +| list error { std::swap ($$, $1); } +; + +item: + TEXT { std::swap ($$, $1); } +| NUMBER { if ($1 == 3) YYERROR; else $$ = to_string ($1); } +; %% -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << m << std::endl; -} -#include -static -int yylex (yy::parser::semantic_type *lvalp) +#ifdef TWO_STAGE_BUILD +# define BUILD(Type, Value) build () = Value +#else +# define BUILD(Type, Value) build (Value) +#endif + +#define STAGE_MAX 5 +namespace yy { - static char const input[] = ":"; - static size_t toknum = 0; - int res; - (void) lvalp;; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; + static + parser::token_type yylex (parser::semantic_type* yylval) + { + // The 5 is a syntax error whose recovery requires that we discard + // the lookahead. This tests a regression, see + // . + static char const *input = "0,1,2,3,45,6"; + switch (int stage = *input++) + { + case 0: + return parser::token::END_OF_FILE; + + case ',': + + + return parser::token::COMMA; + + default: + stage = stage - '0'; + if (stage % 2) + { + yylval->BUILD (int, stage); + return parser::token::NUMBER; + } + else + { + yylval->BUILD (std::string, to_string (stage)); + return parser::token::TEXT; + } + } + + abort (); + } } -int -yyparse () + +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - yy::parser parser; -#if YYDEBUG - parser.set_debug_level (YYDEBUG); -#endif - return parser.parse (); + std::cerr << m << '\n'; } - - +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return yyparse (); + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF @@ -143016,39 +181710,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:938: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:938" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o dancer.cc dancer.y +$as_echo "$at_srcdir/c++.at:381: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o list.cc list.y" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:381" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:938" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:938: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y" "regression.at:938" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y +$as_echo "$at_srcdir/c++.at:381: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:381" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:938" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:938: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:381: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:938" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:381" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -143057,16 +181751,16 @@ at_status=$? at_failed=false $at_check_filter 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:938" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:938: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:381: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:938" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:381" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -143075,7 +181769,7 @@ at_status=$? at_failed=false $at_check_filter 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:938" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } @@ -143083,92 +181777,116 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:938: bison -o dancer.cc dancer.y" -at_fn_check_prepare_trace "regression.at:938" -( $at_check_trace; bison -o dancer.cc dancer.y +$as_echo "$at_srcdir/c++.at:381: bison -fno-caret -o list.cc list.y" +at_fn_check_prepare_trace "c++.at:381" +( $at_check_trace; bison -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:938" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:938: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:938" +$as_echo "$at_srcdir/c++.at:381: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:381" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:938" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:938: \$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:938" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS +$as_echo "$at_srcdir/c++.at:381: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:381" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:938" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:938: \$PREPARSER ./dancer" -at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:938" -( $at_check_trace; $PREPARSER ./dancer +$as_echo "$at_srcdir/c++.at:381: \$PREPARSER ./list" +at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:381" +( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:938" +echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:938: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:938" +$as_echo "$at_srcdir/c++.at:381: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:381" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':' +echo >>"$at_stderr"; $as_echo "Destroy: \"\" +Destroy: \"0\" +Destroy: 1 +Destroy: \"1\" +Destroy: () +Destroy: \"\" +Destroy: \"2\" +Destroy: () +Destroy: \"\" +Destroy: 3 +Destroy: () +Destroy: \"\" +Destroy: \"4\" +Destroy: () +Destroy: () +Destroy: 5 +Destroy: () +Destroy: \"\" +Destroy: \"6\" +Destroy: () +Destroy: (0, 1, 2, 4, 6) " | \ $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:938" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:381" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_284 -#AT_START_285 -at_fn_group_banner 285 'regression.at:1020' \ - "Expecting two tokens " " " 17 +#AT_STOP_429 +#AT_START_430 +at_fn_group_banner 430 'c++.at:382' \ + "Variants lalr1.cc parse.assert api.token.constructor" "" 20 at_xfail=no ( - $as_echo "285. $at_setup_line: testing $at_desc ..." + $as_echo "430. $at_setup_line: testing $at_desc ..." $at_traceon -cat >expect2.y <<'_ATEOF' + +# Store strings and integers in a vector of strings. +cat >list.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -143177,54 +181895,151 @@ cat >expect2.y <<'_ATEOF' #undef realloc } -%{ -static int yylex (void); -#include -#include -static void yyerror ( const char *msg); -%} +%debug +%define api.value.type variant +%skeleton "lalr1.cc" %define parse.assert %define api.token.constructor -%defines -%error-verbose -%token A 1000 -%token B +%code requires // code for the .hh file +{ +#include +#include +typedef std::vector strings_type; +} -%% -program: /* empty */ - | program e ';' - | program error ';'; +%code top // code for the .cc file. +{ +#include // abort, getenv +#include +#include +#include +#include -e: e '+' t | t; -t: A | B; -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) + typedef std::vector strings_type; + + namespace yy + { + // Must be available early, as is used in %destructor. + std::ostream& + operator<<(std::ostream& o, const strings_type& s) + { + o << '('; + for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) + { + if (i != s.begin ()) + o << ", "; + o << *i; + } + return o << ')'; + } + } +} + +%code // code for the .cc file. { - fprintf (stderr, "%s\n", msg); + namespace yy + { + static + parser::symbol_type yylex (); + + // Conversion to string. + template + inline + std::string + to_string (const T& t) + { + std::ostringstream o; + o << t; + return o.str (); + } + } } +%token <::std::string> TEXT; +%token NUMBER; +%token END_OF_FILE 0; +%token COMMA "," -#include -static int -yylex (void) +%type <::std::string> item; +// Using the template type to exercize its parsing. +// Starting with :: to ensure we don't output "<::" which starts by the +// digraph for the left square bracket. +%type <::std::vector> list; + +%printer { yyo << $$; } + <::std::string> <::std::vector>; +%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; +%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>; +%% + +result: + list { std::cout << $1 << '\n'; } +; + +list: + item { $$.push_back ($1); } +| list "," item { std::swap ($$, $1); $$.push_back ($3); } +| list error { std::swap ($$, $1); } +; + +item: + TEXT { std::swap ($$, $1); } +| NUMBER { if ($1 == 3) YYERROR; else $$ = to_string ($1); } +; +%% + +#define STAGE_MAX 5 +namespace yy { - static int const tokens[] = + static + parser::symbol_type yylex () + { + // The 5 is a syntax error whose recovery requires that we discard + // the lookahead. This tests a regression, see + // . + static char const *input = "0,1,2,3,45,6"; + switch (int stage = *input++) { - 1000, '+', '+', -1 - }; - static size_t toknum; + case 0: + return parser::make_END_OF_FILE (); + + case ',': + + return parser::make_COMMA (); + + default: + stage = stage - '0'; + if (stage % 2) + { + return parser::make_NUMBER (stage); + } + else + { + return parser::make_TEXT (to_string (stage)); + } + } - assert (toknum < sizeof tokens / sizeof *tokens); - return tokens[toknum++]; + abort (); + } } +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return yyparse (); + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF @@ -143236,39 +182051,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1020" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o expect2.c expect2.y +$as_echo "$at_srcdir/c++.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o list.cc list.y" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:382" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1020" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:1020" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y +$as_echo "$at_srcdir/c++.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:382" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1020" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1020: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:382: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1020" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:382" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -143277,16 +182092,16 @@ at_status=$? at_failed=false $at_check_filter 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:1020" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1020: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:382: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1020" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:382" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -143295,7 +182110,7 @@ at_status=$? at_failed=false $at_check_filter 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:1020" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } @@ -143303,91 +182118,116 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1020: bison -o expect2.c expect2.y" -at_fn_check_prepare_trace "regression.at:1020" -( $at_check_trace; bison -o expect2.c expect2.y +$as_echo "$at_srcdir/c++.at:382: bison -fno-caret -o list.cc list.y" +at_fn_check_prepare_trace "c++.at:382" +( $at_check_trace; bison -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1020" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1020: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1020" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/c++.at:382: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:382" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1020" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1020: \$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:1020" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS +$as_echo "$at_srcdir/c++.at:382: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:382" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1020" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1020: \$PREPARSER ./expect2" -at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1020" -( $at_check_trace; $PREPARSER ./expect2 +$as_echo "$at_srcdir/c++.at:382: \$PREPARSER ./list" +at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:382" +( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1020" +echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1020: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1020" +$as_echo "$at_srcdir/c++.at:382: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:382" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B +echo >>"$at_stderr"; $as_echo "Destroy: \"\" +Destroy: \"0\" +Destroy: 1 +Destroy: \"1\" +Destroy: () +Destroy: \"\" +Destroy: \"2\" +Destroy: () +Destroy: \"\" +Destroy: 3 +Destroy: () +Destroy: \"\" +Destroy: \"4\" +Destroy: () +Destroy: () +Destroy: 5 +Destroy: () +Destroy: \"\" +Destroy: \"6\" +Destroy: () +Destroy: (0, 1, 2, 4, 6) " | \ $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:1020" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:382" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_285 -#AT_START_286 -at_fn_group_banner 286 'regression.at:1021' \ - "Expecting two tokens %glr-parser" " " 17 +#AT_STOP_430 +#AT_START_431 +at_fn_group_banner 431 'c++.at:383' \ + "Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_}" "" 20 at_xfail=no ( - $as_echo "286. $at_setup_line: testing $at_desc ..." + $as_echo "431. $at_setup_line: testing $at_desc ..." $at_traceon -cat >expect2.y <<'_ATEOF' + +# Store strings and integers in a vector of strings. +cat >list.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -143396,54 +182236,151 @@ cat >expect2.y <<'_ATEOF' #undef realloc } -%{ -static int yylex (void); -#include -#include -static void yyerror ( const char *msg); -%} -%glr-parser -%defines -%error-verbose -%token A 1000 -%token B +%debug +%define api.value.type variant +%skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_} -%% -program: /* empty */ - | program e ';' - | program error ';'; +%code requires // code for the .hh file +{ +#include +#include +typedef std::vector strings_type; +} -e: e '+' t | t; -t: A | B; +%code top // code for the .cc file. +{ +#include // abort, getenv +#include +#include +#include +#include -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) + + typedef std::vector strings_type; + + namespace yy + { + // Must be available early, as is used in %destructor. + std::ostream& + operator<<(std::ostream& o, const strings_type& s) + { + o << '('; + for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) + { + if (i != s.begin ()) + o << ", "; + o << *i; + } + return o << ')'; + } + } +} + +%code // code for the .cc file. { - fprintf (stderr, "%s\n", msg); + namespace yy + { + static + parser::symbol_type yylex (); + + // Conversion to string. + template + inline + std::string + to_string (const T& t) + { + std::ostringstream o; + o << t; + return o.str (); + } + } } +%token <::std::string> TEXT; +%token NUMBER; +%token END_OF_FILE 0; +%token COMMA "," -#include -static int -yylex (void) +%type <::std::string> item; +// Using the template type to exercize its parsing. +// Starting with :: to ensure we don't output "<::" which starts by the +// digraph for the left square bracket. +%type <::std::vector> list; + +%printer { yyo << $$; } + <::std::string> <::std::vector>; +%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; +%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>; +%% + +result: + list { std::cout << $1 << '\n'; } +; + +list: + item { $$.push_back ($1); } +| list "," item { std::swap ($$, $1); $$.push_back ($3); } +| list error { std::swap ($$, $1); } +; + +item: + TEXT { std::swap ($$, $1); } +| NUMBER { if ($1 == 3) YYERROR; else $$ = to_string ($1); } +; +%% + +#define STAGE_MAX 5 +namespace yy { - static int const tokens[] = + static + parser::symbol_type yylex () + { + // The 5 is a syntax error whose recovery requires that we discard + // the lookahead. This tests a regression, see + // . + static char const *input = "0,1,2,3,45,6"; + switch (int stage = *input++) { - 1000, '+', '+', -1 - }; - static size_t toknum; + case 0: + return parser::make_END_OF_FILE (); + + case ',': + + return parser::make_COMMA (); + + default: + stage = stage - '0'; + if (stage % 2) + { + return parser::make_NUMBER (stage); + } + else + { + return parser::make_TEXT (to_string (stage)); + } + } - assert (toknum < sizeof tokens / sizeof *tokens); - return tokens[toknum++]; + abort (); + } } +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return yyparse (); + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF @@ -143455,39 +182392,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1021: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1021" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o expect2.c expect2.y +$as_echo "$at_srcdir/c++.at:383: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o list.cc list.y" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:383" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1021" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1021: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:1021" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.c expect2.y +$as_echo "$at_srcdir/c++.at:383: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:383" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1021" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1021: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:383: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1021" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:383" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -143496,16 +182433,16 @@ at_status=$? at_failed=false $at_check_filter 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:1021" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1021: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:383: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1021" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:383" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -143514,7 +182451,7 @@ at_status=$? at_failed=false $at_check_filter 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:1021" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } @@ -143522,91 +182459,116 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1021: bison -o expect2.c expect2.y" -at_fn_check_prepare_trace "regression.at:1021" -( $at_check_trace; bison -o expect2.c expect2.y +$as_echo "$at_srcdir/c++.at:383: bison -fno-caret -o list.cc list.y" +at_fn_check_prepare_trace "c++.at:383" +( $at_check_trace; bison -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1021" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1021: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1021" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/c++.at:383: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:383" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1021" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1021: \$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:1021" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS +$as_echo "$at_srcdir/c++.at:383: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:383" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1021" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1021: \$PREPARSER ./expect2" -at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1021" -( $at_check_trace; $PREPARSER ./expect2 +$as_echo "$at_srcdir/c++.at:383: \$PREPARSER ./list" +at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:383" +( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1021" +echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1021: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1021" +$as_echo "$at_srcdir/c++.at:383: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:383" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B +echo >>"$at_stderr"; $as_echo "Destroy: \"\" +Destroy: \"0\" +Destroy: 1 +Destroy: \"1\" +Destroy: () +Destroy: \"\" +Destroy: \"2\" +Destroy: () +Destroy: \"\" +Destroy: 3 +Destroy: () +Destroy: \"\" +Destroy: \"4\" +Destroy: () +Destroy: () +Destroy: 5 +Destroy: () +Destroy: \"\" +Destroy: \"6\" +Destroy: () +Destroy: (0, 1, 2, 4, 6) " | \ $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:1021" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:383" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_286 -#AT_START_287 -at_fn_group_banner 287 'regression.at:1022' \ - "Expecting two tokens %skeleton \"lalr1.cc\"" " " 17 +#AT_STOP_431 +#AT_START_432 +at_fn_group_banner 432 'c++.at:384' \ + "Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations" "" 20 at_xfail=no ( - $as_echo "287. $at_setup_line: testing $at_desc ..." + $as_echo "432. $at_setup_line: testing $at_desc ..." $at_traceon -cat >expect2.y <<'_ATEOF' + +# Store strings and integers in a vector of strings. +cat >list.y <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -143615,58 +182577,152 @@ cat >expect2.y <<'_ATEOF' #undef realloc } -%{ -static int yylex (int *); +%debug +%define api.value.type variant +%skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_} %locations -%} -%skeleton "lalr1.cc" -%defines -%error-verbose -%token A 1000 -%token B +%code requires // code for the .hh file +{ +#include +#include +typedef std::vector strings_type; +} -%% -program: /* empty */ - | program e ';' - | program error ';'; +%code top // code for the .cc file. +{ +#include // abort, getenv +#include +#include +#include +#include -e: e '+' t | t; -t: A | B; -%% -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << m << std::endl; + typedef std::vector strings_type; + + namespace yy + { + // Must be available early, as is used in %destructor. + std::ostream& + operator<<(std::ostream& o, const strings_type& s) + { + o << '('; + for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) + { + if (i != s.begin ()) + o << ", "; + o << *i; + } + return o << ')'; + } + } } -int -yyparse () + +%code // code for the .cc file. { - yy::parser parser; - return parser.parse (); + namespace yy + { + static + parser::symbol_type yylex (); + + // Conversion to string. + template + inline + std::string + to_string (const T& t) + { + std::ostringstream o; + o << t; + return o.str (); + } + } } +%token <::std::string> TEXT; +%token NUMBER; +%token END_OF_FILE 0; +%token COMMA "," -#include -static int -yylex (int *lval) +%type <::std::string> item; +// Using the template type to exercize its parsing. +// Starting with :: to ensure we don't output "<::" which starts by the +// digraph for the left square bracket. +%type <::std::vector> list; + +%printer { yyo << $$; } + <::std::string> <::std::vector>; +%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; +%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>; +%% + +result: + list { std::cout << $1 << '\n'; } +; + +list: + item { $$.push_back ($1); } +| list "," item { std::swap ($$, $1); $$.push_back ($3); } +| list error { std::swap ($$, $1); } +; + +item: + TEXT { std::swap ($$, $1); } +| NUMBER { if ($1 == 3) YYERROR; else $$ = to_string ($1); } +; +%% + +#define STAGE_MAX 5 +namespace yy { - static int const tokens[] = + static + parser::symbol_type yylex () + { + typedef parser::location_type location; + // The 5 is a syntax error whose recovery requires that we discard + // the lookahead. This tests a regression, see + // . + static char const *input = "0,1,2,3,45,6"; + switch (int stage = *input++) { - 1000, '+', '+', -1 - }; - static size_t toknum; - *lval = 0; /* Pacify GCC. */ - assert (toknum < sizeof tokens / sizeof *tokens); - return tokens[toknum++]; + case 0: + return parser::make_END_OF_FILE (location ()); + + case ',': + + return parser::make_COMMA (location ()); + + default: + stage = stage - '0'; + if (stage % 2) + { + return parser::make_NUMBER (stage, location ()); + } + else + { + return parser::make_TEXT (to_string (stage), location ()); + } + } + + abort (); + } } +/* A C++ error reporting function. */ +void +yy::parser::error (const location_type& l, const std::string& m) +{ + std::cerr << l << ": " << m << '\n'; +} +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return yyparse (); + yy::parser p; + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + p.set_debug_level (true); + return p.parse (); } _ATEOF @@ -143678,39 +182734,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1022: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1022" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o expect2.cc expect2.y +$as_echo "$at_srcdir/c++.at:384: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o list.cc list.y" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:384" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1022" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1022: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y" "regression.at:1022" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y +$as_echo "$at_srcdir/c++.at:384: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:384" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1022" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1022: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:384: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1022" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:384" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -143719,16 +182775,16 @@ at_status=$? at_failed=false $at_check_filter 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:1022" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1022: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:384: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1022" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:384" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -143737,7 +182793,7 @@ at_status=$? at_failed=false $at_check_filter 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:1022" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } @@ -143745,195 +182801,170 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1022: bison -o expect2.cc expect2.y" -at_fn_check_prepare_trace "regression.at:1022" -( $at_check_trace; bison -o expect2.cc expect2.y +$as_echo "$at_srcdir/c++.at:384: bison -fno-caret -o list.cc list.y" +at_fn_check_prepare_trace "c++.at:384" +( $at_check_trace; bison -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1022" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1022: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1022" +$as_echo "$at_srcdir/c++.at:384: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:384" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1022" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1022: \$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:1022" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS +$as_echo "$at_srcdir/c++.at:384: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:384" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1022" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1022: \$PREPARSER ./expect2" -at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1022" -( $at_check_trace; $PREPARSER ./expect2 +$as_echo "$at_srcdir/c++.at:384: \$PREPARSER ./list" +at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:384" +( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1022" +echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1022: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1022" +$as_echo "$at_srcdir/c++.at:384: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:384" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B +echo >>"$at_stderr"; $as_echo "Destroy: \"\" +Destroy: \"0\" +Destroy: 1 +Destroy: \"1\" +Destroy: () +Destroy: \"\" +Destroy: \"2\" +Destroy: () +Destroy: \"\" +Destroy: 3 +Destroy: () +Destroy: \"\" +Destroy: \"4\" +Destroy: () +Destroy: () +Destroy: 5 +Destroy: () +Destroy: \"\" +Destroy: \"6\" +Destroy: () +Destroy: (0, 1, 2, 4, 6) " | \ $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:1022" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:384" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_287 -#AT_START_288 -at_fn_group_banner 288 'regression.at:1030' \ - "Braced code in declaration in rules section" " " 17 +#AT_STOP_432 +#AT_START_433 +at_fn_group_banner 433 'c++.at:468' \ + "Doxygen Public Documentation" " " 20 at_xfail=no ( - $as_echo "288. $at_setup_line: testing $at_desc ..." + $as_echo "433. $at_setup_line: testing $at_desc ..." $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 -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%{ -#include -static void yyerror ( const char *msg); -static int yylex (void); -%} - -%error-verbose +cat >input.yy <<'_ATEOF' +%skeleton "lalr1.cc" +%locations +%defines +%debug %% - -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'; - +exp: /* empty */; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) -{ - static char const input[] = "a"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; -} - -int -main (void) +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) { - yydebug = 1; - return !yyparse (); + std::cerr << m << '\n'; } _ATEOF - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1069: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1069" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:468: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:468" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1069" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:468" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1069: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" "regression.at:1069" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:468: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:468" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1069" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:468" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1069: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:468: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1069" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:468" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -143942,16 +182973,16 @@ at_status=$? at_failed=false $at_check_filter 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:1069" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:468" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1069: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:468: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1069" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:468" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -143960,7 +182991,7 @@ at_status=$? at_failed=false $at_check_filter 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:1069" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:468" $at_failed && at_fn_log_failure $at_traceon; } @@ -143968,84 +182999,282 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1069: bison -t -o input.c input.y" -at_fn_check_prepare_trace "regression.at:1069" -( $at_check_trace; bison -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:468: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:468" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1069" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:468" $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/regression.at:1070: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1070" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/c++.at:468: doxygen --version || exit 77" +at_fn_check_prepare_trace "c++.at:468" +( $at_check_trace; doxygen --version || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1070" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:468" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1070: \$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:1070" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:468: doxygen" +at_fn_check_prepare_trace "c++.at:468" +( $at_check_trace; doxygen +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:468" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_433 +#AT_START_434 +at_fn_group_banner 434 'c++.at:469' \ + "Doxygen Private Documentation" " " 20 +at_xfail=no +( + $as_echo "434. $at_setup_line: testing $at_desc ..." + $at_traceon + + + +cat >input.yy <<'_ATEOF' +%skeleton "lalr1.cc" +%locations +%defines +%debug +%% +exp: /* empty */; +%% +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + std::cerr << m << '\n'; +} +_ATEOF + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:469: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:469" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:469" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/c++.at:469: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:469" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1070" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:469" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/c++.at:469: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:469" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:469" $at_failed && at_fn_log_failure $at_traceon; } + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/c++.at:469: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:469" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:469" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/regression.at:1071: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1071" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/c++.at:469: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:469" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -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:1071" +at_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:469" $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/regression.at:1071: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1071" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/c++.at:469: doxygen --version || exit 77" +at_fn_check_prepare_trace "c++.at:469" +( $at_check_trace; doxygen --version || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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=: +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:469" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:469: doxygen" +at_fn_check_prepare_trace "c++.at:469" +( $at_check_trace; doxygen +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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/regression.at:1071" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:469" $at_failed && at_fn_log_failure $at_traceon; } @@ -144055,67 +183284,106 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_288 -#AT_START_289 -at_fn_group_banner 289 'regression.at:1097' \ - "String alias declared after use" " " 17 +#AT_STOP_434 +#AT_START_435 +at_fn_group_banner 435 'c++.at:523' \ + "Relative namespace references" " " 20 at_xfail=no ( - $as_echo "289. $at_setup_line: testing $at_desc ..." + $as_echo "435. $at_setup_line: testing $at_desc ..." $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.yy <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%language "C++" +%define api.namespace {foo} +%union { int i; } +%define global_tokens_and_yystype +%locations + +%code { + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const foo::parser::location_type*) { + lval->i = 3; + return 0; + } +} -cat >input.y <<'_ATEOF' %% -start: 'a' "A" 'b'; -%token 'a' "A"; + +start: ; + +%% + +void +foo::parser::error (const foo::parser::location_type &loc, + const std::string &msg) +{ + std::cerr << "At " << loc << ": " << msg << '\n'; +} + +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + foo::parser p; + (void) argc; + (void) argv; + return p.parse (); +} _ATEOF + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1110: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1110" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:524: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:524" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1110" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1110: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y" "regression.at:1110" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:524: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:524" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1110" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1110: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:524: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1110" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:524" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -144124,16 +183392,16 @@ at_status=$? at_failed=false $at_check_filter 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:1110" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1110: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:524: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1110" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:524" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -144142,7 +183410,7 @@ at_status=$? at_failed=false $at_check_filter 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:1110" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524" $at_failed && at_fn_log_failure $at_traceon; } @@ -144150,87 +183418,167 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1110: bison -t -o input.c input.y" -at_fn_check_prepare_trace "regression.at:1110" -( $at_check_trace; bison -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:524: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:524" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1110" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_289 -#AT_START_290 -at_fn_group_banner 290 'regression.at:1120' \ - "Extra lookahead sets in report" " " 17 -at_xfail=no -( - $as_echo "290. $at_setup_line: testing $at_desc ..." - $at_traceon +{ set +x +$as_echo "$at_srcdir/c++.at:524: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:524" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:524" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:524: \$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:524" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:524" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:524: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:524" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:524: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:524" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:524" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + +cat >input.yy <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%language "C++" +%define api.namespace {foo::bar} +%union { int i; } +%define global_tokens_and_yystype +%locations + +%code { + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const foo::bar::parser::location_type*) { + lval->i = 3; + return 0; + } +} + +%% -# 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. +start: ; -cat >input.y <<'_ATEOF' %% -start: a | 'a' a 'a' ; -a: 'a' ; + +void +foo::bar::parser::error (const foo::bar::parser::location_type &loc, + const std::string &msg) +{ + std::cerr << "At " << loc << ": " << msg << '\n'; +} + +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + foo::bar::parser p; + (void) argc; + (void) argv; + return p.parse (); +} _ATEOF + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1135" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot --report=all input.y +$as_echo "$at_srcdir/c++.at:525: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:525" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1135" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1135: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y" "regression.at:1135" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml --report=all input.y +$as_echo "$at_srcdir/c++.at:525: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:525" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1135" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1135: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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' "regression.at:1135" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 @@ -144239,16 +183587,16 @@ at_status=$? at_failed=false $at_check_filter 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:1135" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1135: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1135" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 | sort @@ -144257,7 +183605,7 @@ at_status=$? at_failed=false $at_check_filter 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:1135" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525" $at_failed && at_fn_log_failure $at_traceon; } @@ -144265,66 +183613,78 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1135: bison --report=all input.y" -at_fn_check_prepare_trace "regression.at:1135" -( $at_check_trace; bison --report=all input.y +$as_echo "$at_srcdir/c++.at:525: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:525" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1135" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/regression.at:1136: 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:1136" -( $at_check_trace; sed -n '/^State 1$/,/^State 2$/p' input.output +$as_echo "$at_srcdir/c++.at:525: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:525" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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) +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525" +$at_failed && at_fn_log_failure +$at_traceon; } - a go to state 5 +{ set +x +$as_echo "$at_srcdir/c++.at:525: \$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:525" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:525" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:525: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:525" +( $at_check_trace; $PREPARSER ./input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525" +$at_failed && at_fn_log_failure +$at_traceon; } -State 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1136" +{ set +x +$as_echo "$at_srcdir/c++.at:525: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:525" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:525" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_290 -#AT_START_291 -at_fn_group_banner 291 'regression.at:1161' \ - "Token number in precedence declaration" " " 17 -at_xfail=no -( - $as_echo "291. $at_setup_line: testing $at_desc ..." - $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' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -144333,54 +183693,42 @@ cat >input.y <<'_ATEOF' #undef realloc } -%{ - #include - static void yyerror ( const char *msg); - static int yylex (void); -%} +%language "C++" +%define api.namespace {foo::bar::baz} +%union { int i; } +%define global_tokens_and_yystype +%locations -%error-verbose -%right END 0 -%left TK1 1 TK2 2 "tok alias" 3 +%code { + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const foo::bar::baz::parser::location_type*) { + lval->i = 3; + return 0; + } +} %% -start: - TK1 sr_conflict "tok alias" - | start %prec END - ; -sr_conflict: - TK2 - | TK2 "tok alias" - ; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) +void +foo::bar::baz::parser::error (const foo::bar::baz::parser::location_type &loc, + const std::string &msg) { - static int const input[] = { 1, 2, 3, 0 }; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; + std::cerr << "At " << loc << ": " << msg << '\n'; } +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return yyparse (); + foo::bar::baz::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF @@ -144393,39 +183741,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1201" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/c++.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:526" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1201" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1201" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/c++.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:526" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1201" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1201: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:526: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1201" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:526" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -144434,16 +183782,16 @@ at_status=$? at_failed=false $at_check_filter 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:1201" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1201: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:526: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1201" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:526" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -144452,7 +183800,7 @@ at_status=$? at_failed=false $at_check_filter 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:1201" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } @@ -144460,250 +183808,180 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1201: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:1201" -( $at_check_trace; bison -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start -input.y:27.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:1201" -$at_failed && at_fn_log_failure -$at_traceon; } - -# Defining POSIXLY_CORRECT causes bison to complain if options are -# added after the grammar file name, so skip these checks in that -# case. -if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then - at_save_special_files - - # To avoid expanding it repeatedly, store specified stdout. - : >expout - - # Run with -Werror. - { set +x -$as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Werror" "regression.at:1201" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1201" -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Build expected stderr up to and including the "warnings being - # treated as errors" message. - cat >at-bison-check-warnings <<'_ATEOF' -input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start -input.y:27.5-19: warning: rule useless in parser due to conflicts: sr_conflict: TK2 "tok alias" -_ATEOF - - at_bison_check_first=`sed -n \ - '/: warning: /{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first:=1} - at_bison_check_first_tmp=`sed -n \ - '/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings` - : ${at_bison_check_first_tmp:=1} - if test $at_bison_check_first_tmp -lt $at_bison_check_first; then - at_bison_check_first=$at_bison_check_first_tmp - fi - if test $at_bison_check_first -gt 1; then - sed -n "1,`expr $at_bison_check_first - 1`"p \ - at-bison-check-warnings > experr - fi - echo 'bison: warnings being treated as errors' >> experr - - # Finish building expected stderr and check. Unlike warnings, - # complaints cause bison to exit early. Thus, with -Werror, bison - # does not necessarily report all warnings that it does without - # -Werror, but it at least reports one. - at_bison_check_last=`sed -n '$=' stderr` - : ${at_bison_check_last:=1} - at_bison_check_last=`expr $at_bison_check_last - 1` - sed -n "$at_bison_check_first,$at_bison_check_last"p \ - at-bison-check-warnings >> experr - { set +x -$as_echo "$at_srcdir/regression.at:1201: sed 's,.*/\\(bison: warnings being treated as errors\\)\$,\\1,' \\ - stderr 1>&2" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1201" -( $at_check_trace; sed 's,.*/\(bison: warnings being treated as errors\)$,\1,' \ - stderr 1>&2 +$as_echo "$at_srcdir/c++.at:526: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:526" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -$at_diff experr "$at_stderr" || at_failed=: +at_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:1201" -$at_failed && at_fn_log_failure -$at_traceon; } - - - # Now check --warnings=error. - cp stderr experr - { set +x -$as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error" "regression.at:1201" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=error -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -$at_diff experr "$at_stderr" || at_failed=: -$at_diff expout "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1201" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } - # Now check -Wnone and --warnings=none by making sure that - # -Werror doesn't change the exit status when -Wnone or - # --warnings=none is specified. - { set +x -$as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror" "regression.at:1201" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y -Wnone -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1201" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/regression.at:1201: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror" "regression.at:1201" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y --warnings=none -Werror -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1201" -$at_failed && at_fn_log_failure -$at_traceon; } - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/regression.at:1205: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1205" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/c++.at:526: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:526" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1205" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1205: \$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:1205" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:526: \$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:526" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1205" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1206: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1206" +$as_echo "$at_srcdir/c++.at:526: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:526" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1206" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1206: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1206" +$as_echo "$at_srcdir/c++.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:526" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1206" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_291 -#AT_START_292 -at_fn_group_banner 292 'regression.at:1219' \ - "parse-gram.y: LALR = IELR" " " 17 +#AT_STOP_435 +#AT_START_436 +at_fn_group_banner 436 'c++.at:529' \ + "Absolute namespace references" " " 20 at_xfail=no ( - $as_echo "292. $at_setup_line: testing $at_desc ..." + $as_echo "436. $at_setup_line: testing $at_desc ..." $at_traceon -# Avoid differences in synclines by telling bison that the output files -# have the same name. -cp $abs_top_srcdir/src/parse-gram.y input.y +cat >input.yy <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%language "C++" +%define api.namespace {::foo} +%union { int i; } +%define global_tokens_and_yystype +%locations + +%code { + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const ::foo::parser::location_type*) { + 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 << '\n'; +} + +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + ::foo::parser p; + (void) argc; + (void) argv; + return p.parse (); +} +_ATEOF + + + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1224" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y +$as_echo "$at_srcdir/c++.at:530: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:530" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1224" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1224: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" "regression.at:1224" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y +$as_echo "$at_srcdir/c++.at:530: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:530" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1224" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1224: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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' "regression.at:1224" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 @@ -144712,16 +183990,16 @@ at_status=$? at_failed=false $at_check_filter 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:1224" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1224: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1224" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 | sort @@ -144730,7 +184008,7 @@ at_status=$? at_failed=false $at_check_filter 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:1224" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" $at_failed && at_fn_log_failure $at_traceon; } @@ -144738,146 +184016,78 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1224: bison -o input.c -Dlr.type=lalr input.y" -at_fn_check_prepare_trace "regression.at:1224" -( $at_check_trace; bison -o input.c -Dlr.type=lalr input.y +$as_echo "$at_srcdir/c++.at:530: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:530" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1224" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" $at_failed && at_fn_log_failure $at_traceon; } -mv input.c lalr.c -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1227" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y + +{ set +x +$as_echo "$at_srcdir/c++.at:530: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:530" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1227" -$at_failed && at_fn_log_failure \ -"lalr.c" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" +$at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" "regression.at:1227" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y +{ set +x +$as_echo "$at_srcdir/c++.at:530: \$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:530" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1227" -$at_failed && at_fn_log_failure \ -"lalr.c" -$at_traceon; } - - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/regression.at:1227: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1227" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1227" -$at_failed && at_fn_log_failure \ -"lalr.c" -$at_traceon; } - - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/regression.at:1227: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1227" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:1227" -$at_failed && at_fn_log_failure \ -"lalr.c" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" +$at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/regression.at:1227: bison -o input.c -Dlr.type=ielr input.y" -at_fn_check_prepare_trace "regression.at:1227" -( $at_check_trace; bison -o input.c -Dlr.type=ielr input.y +$as_echo "$at_srcdir/c++.at:530: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:530" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1227" -$at_failed && at_fn_log_failure \ -"lalr.c" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" +$at_failed && at_fn_log_failure $at_traceon; } - -mv input.c ielr.c - { set +x -$as_echo "$at_srcdir/regression.at:1230: diff lalr.c ielr.c" -at_fn_check_prepare_trace "regression.at:1230" -( $at_check_trace; diff lalr.c ielr.c +$as_echo "$at_srcdir/c++.at:530: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:530" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1230" -$at_failed && at_fn_log_failure \ -"lalr.c" \ -"ielr.c" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:530" +$at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_292 -#AT_START_293 -at_fn_group_banner 293 'regression.at:1240' \ - "%error-verbose and YYSTACK_USE_ALLOCA" " " 17 -at_xfail=no -( - $as_echo "293. $at_setup_line: testing $at_desc ..." - $at_traceon -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -144886,72 +184096,42 @@ cat >input.y <<'_ATEOF' #undef realloc } +%language "C++" +%define api.namespace {::foo::bar} +%union { int i; } +%define global_tokens_and_yystype +%locations + %code { - #include - static void yyerror ( const char *msg); - static int yylex (void); - #define YYSTACK_USE_ALLOCA 1 + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const ::foo::bar::parser::location_type*) { + lval->i = 3; + return 0; + } } -%error-verbose - %% -start: check syntax_error syntax_error ; - -check: -{ - if (128 < sizeof yymsgbuf) - { - fprintf (stderr, - "The initial size of yymsgbuf in yyparse has increased\n" - "since this test group was last updated. As a result,\n" - "this test group may no longer manage to induce a\n" - "reallocation of the syntax error message buffer.\n" - "This test group must be adjusted to produce a longer\n" - "error message.\n"); - YYABORT; - } -} -; - -// Induce a syntax error message whose total length is more than -// sizeof yymsgbuf in yyparse. Each token here is 64 bytes. -syntax_error: - "123456789112345678921234567893123456789412345678951234567896123A" -| "123456789112345678921234567893123456789412345678951234567896123B" -| error 'a' 'b' 'c' -; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -/* Induce two syntax error messages (which requires full error - recovery by shifting 3 tokens) in order to detect any loss of the - reallocated buffer. */ -#include -static -int yylex (void) +void +::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc, + const std::string &msg) { - static char const input[] = "abc"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; + std::cerr << "At " << loc << ": " << msg << '\n'; } + +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return yyparse (); + ::foo::bar::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF @@ -144964,39 +184144,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1296" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/c++.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:531" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1296" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1296: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1296" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/c++.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:531" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1296" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1296: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:531: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1296" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:531" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -145005,16 +184185,16 @@ at_status=$? at_failed=false $at_check_filter 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:1296" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1296: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:531: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1296" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:531" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -145023,7 +184203,7 @@ at_status=$? at_failed=false $at_check_filter 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:1296" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } @@ -145031,91 +184211,78 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1296: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:1296" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/c++.at:531: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:531" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1296" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/regression.at:1297: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1297" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/c++.at:531: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:531" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1297" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1297: \$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:1297" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:531: \$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:531" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1297" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1298: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1298" +$as_echo "$at_srcdir/c++.at:531: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:531" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1298" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1298: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1298" +$as_echo "$at_srcdir/c++.at:531: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:531" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B -syntax error, unexpected \$end, expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1298" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_293 -#AT_START_294 -at_fn_group_banner 294 'regression.at:1319' \ - "%error-verbose overflow" " " 17 -at_xfail=no -( - $as_echo "294. $at_setup_line: testing $at_desc ..." - $at_traceon -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -145124,149 +184291,87 @@ cat >input.y <<'_ATEOF' #undef realloc } -%code { - #include - static void yyerror ( const char *msg); - static int yylex (void); - - /* This prevents this test case from having to induce error messages - large enough to overflow size_t. */ - #define YYSIZE_T unsigned char - - /* Bring in malloc and set EXIT_SUCCESS so yacc.c doesn't try to - provide a malloc prototype using our YYSIZE_T. */ - #include - #ifndef EXIT_SUCCESS - # define EXIT_SUCCESS 0 - #endif +%language "C++" +%define api.namespace {::foo::bar::baz} +%union { int i; } +%define global_tokens_and_yystype +%locations - /* Max depth is usually much smaller than YYSTACK_ALLOC_MAXIMUM, and - we don't want gcc to warn everywhere this constant would be too big - to make sense for our YYSIZE_T. */ - #define YYMAXDEPTH 100 +%code { + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const ::foo::bar::baz::parser::location_type*) { + lval->i = 3; + return 0; + } } -%error-verbose - %% -start: syntax_error1 check syntax_error2 ; - -// Induce a syntax error message whose total length causes yymsg in -// yyparse to be reallocated to size YYSTACK_ALLOC_MAXIMUM, which -// should be 255. Each token here is 64 bytes. -syntax_error1: - "123456789112345678921234567893123456789412345678951234567896123A" -| "123456789112345678921234567893123456789412345678951234567896123B" -| "123456789112345678921234567893123456789412345678951234567896123C" -| error 'a' 'b' 'c' -; - -check: -{ - if (yymsg_alloc != YYSTACK_ALLOC_MAXIMUM - || YYSTACK_ALLOC_MAXIMUM != YYSIZE_MAXIMUM - || YYSIZE_MAXIMUM != 255) - { - fprintf (stderr, - "The assumptions of this test group are no longer\n" - "valid, so it may no longer catch the error it was\n" - "designed to catch. Specifically, the following\n" - "values should all be 255:\n\n"); - fprintf (stderr, " yymsg_alloc = %d\n", yymsg_alloc); - fprintf (stderr, " YYSTACK_ALLOC_MAXIMUM = %d\n", - YYSTACK_ALLOC_MAXIMUM); - fprintf (stderr, " YYSIZE_MAXIMUM = %d\n", YYSIZE_MAXIMUM); - YYABORT; - } -} -; - -// Now overflow. -syntax_error2: - "123456789112345678921234567893123456789412345678951234567896123A" -| "123456789112345678921234567893123456789412345678951234567896123B" -| "123456789112345678921234567893123456789412345678951234567896123C" -| "123456789112345678921234567893123456789412345678951234567896123D" -| "123456789112345678921234567893123456789412345678951234567896123E" -; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -/* Induce two syntax error messages (which requires full error - recovery by shifting 3 tokens). */ -#include -static -int yylex (void) +void +::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc, + const std::string &msg) { - static char const input[] = "abc"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; + std::cerr << "At " << loc << ": " << msg << '\n'; } + +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - /* Push parsers throw away the message buffer between tokens, so skip - this test under maintainer-push-check. */ - if (YYPUSH) - return 77; - return yyparse (); + ::foo::bar::baz::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1406" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/c++.at:532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:532" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1406" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/c++.at:532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:532" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1406: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:532: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1406" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:532" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -145275,16 +184380,16 @@ at_status=$? at_failed=false $at_check_filter 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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1406: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:532: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1406" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:532" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -145293,7 +184398,7 @@ at_status=$? at_failed=false $at_check_filter 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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } @@ -145301,105 +184406,78 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1406: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:1406" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/c++.at:532: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:532" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1406" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } -# gcc warns about tautologies and fallacies involving comparisons for -# unsigned char. However, it doesn't produce these same warnings for -# size_t and many other types when the warnings would seem to make just -# as much sense. We ignore the warnings. -CFLAGS="$NO_WERROR_CFLAGS" + { set +x -$as_echo "$at_srcdir/regression.at:1413: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1413" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/c++.at:532: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:532" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1413" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1413: \$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:1413" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:532: \$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:532" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1413" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1415: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1415" +$as_echo "$at_srcdir/c++.at:532: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:532" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1415" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1415: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1415" +$as_echo "$at_srcdir/c++.at:532: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:532" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B or 123456789112345678921234567893123456789412345678951234567896123C -syntax error -memory exhausted -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1415" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_294 -#AT_START_295 -at_fn_group_banner 295 'regression.at:1429' \ - "LAC: Exploratory stack" " " 17 -at_xfail=no -( - $as_echo "295. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - - - -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -145408,100 +184486,87 @@ cat >input.y <<'_ATEOF' #undef realloc } +%language "C++" +%define api.namespace { ::foo} +%union { int i; } +%define global_tokens_and_yystype +%locations + %code { - #include - static void yyerror ( const char *msg); - int yylex (void); + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const ::foo::parser::location_type*) { + lval->i = 3; + return 0; + } } -%define api.push-pull pull -%error-verbose -%token 'c' - %% -// default reductions in inconsistent states -// v v v v v v v v v v v v v v -S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; -// ^ ^ ^ -// LAC reallocs - -A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; -B: 'b' ; -C: /*empty*/ { printf ("consistent default reduction\n"); } ; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -int -yylex (void) + +void + ::foo::parser::error (const ::foo::parser::location_type &loc, + const std::string &msg) { - static char const *input = "bbbbc"; - return *input++; + std::cerr << "At " << loc << ": " << msg << '\n'; } +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - yydebug = 1; - return yyparse (); + ::foo::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:533: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:533" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:533: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:533" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1508: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:533: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1508" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:533" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -145510,16 +184575,16 @@ at_status=$? at_failed=false $at_check_filter 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:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1508: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:533: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1508" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:533" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -145528,7 +184593,7 @@ at_status=$? at_failed=false $at_check_filter 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:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } @@ -145536,150 +184601,70 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1508: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" -( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:533: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:533" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/regression.at:1508: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1508" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/c++.at:533: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:533" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1508: \$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:1508" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:533: \$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:533" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1508: \$PREPARSER ./input > stdout.txt 2> stderr.txt" -at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1508" -( $at_check_trace; $PREPARSER ./input > stdout.txt 2> stderr.txt +$as_echo "$at_srcdir/c++.at:533: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:533" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1508: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1508" +$as_echo "$at_srcdir/c++.at:533: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:533" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1508" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Make sure syntax error doesn't forget that 'a' is expected. It would -# be forgotten without lookahead correction. -{ set +x -$as_echo "$at_srcdir/regression.at:1508: grep 'syntax error,' stderr.txt" -at_fn_check_prepare_trace "regression.at:1508" -( $at_check_trace; grep 'syntax error,' stderr.txt -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of default reductions in inconsistent states to be sure -# syntax error is detected before unnecessary reductions are performed. -{ set +x -$as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ - < stdout.txt || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" -( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ - < stdout.txt || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "14" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of default reductions in consistent states to be sure -# it is performed before the syntax error is detected. -{ set +x -$as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ - < stdout.txt || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" -( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ - < stdout.txt || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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/regression.at:1508" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of reallocs to be sure reallocated memory isn't somehow -# lost between LAC invocations. -{ set +x -$as_echo "$at_srcdir/regression.at:1508: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ - || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1508" -( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ - || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "3" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1508" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:533" $at_failed && at_fn_log_failure $at_traceon; } @@ -145687,10 +184672,7 @@ $at_traceon; } - - - -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -145699,101 +184681,87 @@ cat >input.y <<'_ATEOF' #undef realloc } +%language "C++" +%define api.namespace { ::foo::bar} +%union { int i; } +%define global_tokens_and_yystype +%locations + %code { - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *); + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const ::foo::bar::parser::location_type*) { + lval->i = 3; + return 0; + } } -%define api.push-pull pull %define api.pure -%error-verbose -%token 'c' - %% -// default reductions in inconsistent states -// v v v v v v v v v v v v v v -S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; -// ^ ^ ^ -// LAC reallocs - -A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; -B: 'b' ; -C: /*empty*/ { printf ("consistent default reduction\n"); } ; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -int -yylex (YYSTYPE *v) + +void + ::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc, + const std::string &msg) { - static char const *input = "bbbbc"; - *v = 0; - return *input++; + std::cerr << "At " << loc << ": " << msg << '\n'; } +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - yydebug = 1; - return yyparse (); + ::foo::bar::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:534: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:534" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1509: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:534: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:534" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1509: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:534: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1509" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:534" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -145802,16 +184770,16 @@ at_status=$? at_failed=false $at_check_filter 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:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1509: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:534: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1509" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:534" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -145820,7 +184788,7 @@ at_status=$? at_failed=false $at_check_filter 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:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } @@ -145828,150 +184796,70 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1509: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" -( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:534: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:534" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/regression.at:1509: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1509" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/c++.at:534: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:534" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1509: \$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:1509" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:534: \$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:534" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1509: \$PREPARSER ./input > stdout.txt 2> stderr.txt" -at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1509" -( $at_check_trace; $PREPARSER ./input > stdout.txt 2> stderr.txt +$as_echo "$at_srcdir/c++.at:534: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:534" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1509: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1509" +$as_echo "$at_srcdir/c++.at:534: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:534" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1509" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Make sure syntax error doesn't forget that 'a' is expected. It would -# be forgotten without lookahead correction. -{ set +x -$as_echo "$at_srcdir/regression.at:1509: grep 'syntax error,' stderr.txt" -at_fn_check_prepare_trace "regression.at:1509" -( $at_check_trace; grep 'syntax error,' stderr.txt -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of default reductions in inconsistent states to be sure -# syntax error is detected before unnecessary reductions are performed. -{ set +x -$as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ - < stdout.txt || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" -( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ - < stdout.txt || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "14" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of default reductions in consistent states to be sure -# it is performed before the syntax error is detected. -{ set +x -$as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ - < stdout.txt || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" -( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ - < stdout.txt || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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/regression.at:1509" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of reallocs to be sure reallocated memory isn't somehow -# lost between LAC invocations. -{ set +x -$as_echo "$at_srcdir/regression.at:1509: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ - || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1509" -( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ - || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "3" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1509" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:534" $at_failed && at_fn_log_failure $at_traceon; } @@ -145979,10 +184867,7 @@ $at_traceon; } - - - -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -145991,100 +184876,87 @@ cat >input.y <<'_ATEOF' #undef realloc } +%language "C++" +%define api.namespace { ::foo::bar::baz} +%union { int i; } +%define global_tokens_and_yystype +%locations + %code { - #include - static void yyerror ( const char *msg); - int yylex (void); + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const ::foo::bar::baz::parser::location_type*) { + lval->i = 3; + return 0; + } } -%define api.push-pull both -%error-verbose -%token 'c' - %% -// default reductions in inconsistent states -// v v v v v v v v v v v v v v -S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; -// ^ ^ ^ -// LAC reallocs - -A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; -B: 'b' ; -C: /*empty*/ { printf ("consistent default reduction\n"); } ; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -int -yylex (void) + +void + ::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc, + const std::string &msg) { - static char const *input = "bbbbc"; - return *input++; + std::cerr << "At " << loc << ": " << msg << '\n'; } +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - yydebug = 1; - return yyparse (); + ::foo::bar::baz::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:535: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:535" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:535: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:535" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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' "regression.at:1510" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 @@ -146093,16 +184965,16 @@ at_status=$? at_failed=false $at_check_filter 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:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 | sort @@ -146111,7 +184983,7 @@ at_status=$? at_failed=false $at_check_filter 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:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } @@ -146119,161 +184991,91 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1510: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" -( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:535: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:535" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } + + { set +x -$as_echo "$at_srcdir/regression.at:1510: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1510" -( $at_check_trace; $BISON_C_WORKS +$as_echo "$at_srcdir/c++.at:535: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:535" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1510: \$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:1510" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:535: \$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:535" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1510: \$PREPARSER ./input > stdout.txt 2> stderr.txt" -at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1510" -( $at_check_trace; $PREPARSER ./input > stdout.txt 2> stderr.txt +$as_echo "$at_srcdir/c++.at:535: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:535" +( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1510: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1510" +$as_echo "$at_srcdir/c++.at:535: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:535" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1510" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -# Make sure syntax error doesn't forget that 'a' is expected. It would -# be forgotten without lookahead correction. -{ set +x -$as_echo "$at_srcdir/regression.at:1510: grep 'syntax error,' stderr.txt" -at_fn_check_prepare_trace "regression.at:1510" -( $at_check_trace; grep 'syntax error,' stderr.txt -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of default reductions in inconsistent states to be sure -# syntax error is detected before unnecessary reductions are performed. -{ set +x -$as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ - < stdout.txt || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" -( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ - < stdout.txt || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "14" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of default reductions in consistent states to be sure -# it is performed before the syntax error is detected. -{ set +x -$as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ - < stdout.txt || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" -( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ - < stdout.txt || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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/regression.at:1510" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of reallocs to be sure reallocated memory isn't somehow -# lost between LAC invocations. -{ set +x -$as_echo "$at_srcdir/regression.at:1510: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ - || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510" -( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ - || exit 77 -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "3" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_436 +#AT_START_437 +at_fn_group_banner 437 'c++.at:538' \ + "Syntactically invalid namespace references" " " 20 +at_xfail=no +( + $as_echo "437. $at_setup_line: testing $at_desc ..." + $at_traceon - - -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -146282,101 +185084,87 @@ cat >input.y <<'_ATEOF' #undef realloc } +%language "C++" +%define api.namespace {:foo:bar} +%union { int i; } +%define global_tokens_and_yystype +%locations + %code { - #include - static void yyerror ( const char *msg); - int yylex (YYSTYPE *); + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const :foo:bar::parser::location_type*) { + lval->i = 3; + return 0; + } } -%define api.push-pull both %define api.pure -%error-verbose -%token 'c' - %% -// default reductions in inconsistent states -// v v v v v v v v v v v v v v -S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; -// ^ ^ ^ -// LAC reallocs - -A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ; -B: 'b' ; -C: /*empty*/ { printf ("consistent default reduction\n"); } ; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -int -yylex (YYSTYPE *v) + +void +:foo:bar::parser::error (const :foo:bar::parser::location_type &loc, + const std::string &msg) { - static char const *input = "bbbbc"; - *v = 0; - return *input++; + std::cerr << "At " << loc << ": " << msg << '\n'; } +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - yydebug = 1; - return yyparse (); + :foo:bar::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:539" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1511" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:539" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1511: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:539" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1511" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:539" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1511: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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' "regression.at:1511" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 @@ -146385,16 +185173,16 @@ at_status=$? at_failed=false $at_check_filter 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:1511" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:539" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1511: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1511" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 | sort @@ -146403,7 +185191,7 @@ at_status=$? at_failed=false $at_check_filter 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:1511" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:539" $at_failed && at_fn_log_failure $at_traceon; } @@ -146411,150 +185199,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1511: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -Dparse.lac.memory-trace=full \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" -( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -Dparse.lac.memory-trace=full \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:539: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:539" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 21 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1511" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:539" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:1511: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1511" -( $at_check_trace; $BISON_C_WORKS + + + + + +cat >input.yy <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%language "C++" +%define api.namespace {foo: :bar} +%union { int i; } +%define global_tokens_and_yystype +%locations + +%code { + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const foo: :bar::parser::location_type*) { + 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 << '\n'; +} + +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + foo: :bar::parser p; + (void) argc; + (void) argv; + return p.parse (); +} +_ATEOF + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:540: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:540" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1511" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:540" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:1511: \$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:1511" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS + { set +x +$as_echo "$at_srcdir/c++.at:540: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:540" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1511" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/regression.at:1511: \$PREPARSER ./input > stdout.txt 2> stderr.txt" -at_fn_check_prepare_dynamic " $PREPARSER ./input > stdout.txt 2> stderr.txt" "regression.at:1511" -( $at_check_trace; $PREPARSER ./input > stdout.txt 2> stderr.txt -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1511" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/regression.at:1511: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1511" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:1511" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:540" $at_failed && at_fn_log_failure $at_traceon; } - - -# Make sure syntax error doesn't forget that 'a' is expected. It would -# be forgotten without lookahead correction. -{ set +x -$as_echo "$at_srcdir/regression.at:1511: grep 'syntax error,' stderr.txt" -at_fn_check_prepare_trace "regression.at:1511" -( $at_check_trace; grep 'syntax error,' stderr.txt -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b' -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" -$at_failed && at_fn_log_failure -$at_traceon; } - - -# Check number of default reductions in inconsistent states to be sure -# syntax error is detected before unnecessary reductions are performed. -{ set +x -$as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\ - < stdout.txt || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" -( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \ - < stdout.txt || exit 77 + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/c++.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' "c++.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" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "14" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:540" $at_failed && at_fn_log_failure $at_traceon; } - -# Check number of default reductions in consistent states to be sure -# it is performed before the syntax error is detected. -{ set +x -$as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\ - < stdout.txt || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" -( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \ - < stdout.txt || exit 77 + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/c++.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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/regression.at:1511" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:540" $at_failed && at_fn_log_failure $at_traceon; } - -# Check number of reallocs to be sure reallocated memory isn't somehow -# lost between LAC invocations. + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/regression.at:1511: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\ - || exit 77" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1511" -( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \ - || exit 77 +$as_echo "$at_srcdir/c++.at:540: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:540" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "3" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1511" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:540" $at_failed && at_fn_log_failure $at_traceon; } @@ -146563,26 +185358,10 @@ $at_traceon; } +# This one is interesting because '[3]' is encoded as '[3]', which +# contains single occurrences of ':'. - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_295 -#AT_START_296 -at_fn_group_banner 296 'regression.at:1523' \ - "LAC: Memory exhaustion" " " 17 -at_xfail=no -( - $as_echo "296. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - -# Check for memory exhaustion during parsing. - -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -146591,94 +185370,87 @@ cat >input.y <<'_ATEOF' #undef realloc } +%language "C++" +%define api.namespace {foo[3]::bar::baz} +%union { int i; } +%define global_tokens_and_yystype +%locations + %code { - #include - static void yyerror ( const char *msg); - static int yylex (void); - #define YYMAXDEPTH 8 + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const foo[3]::bar::baz::parser::location_type*) { + lval->i = 3; + return 0; + } } -%error-verbose - %% -S: A A A A A A A A A ; -A: /*empty*/ | 'a' ; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) + +void +foo[3]::bar::baz::parser::error (const foo[3]::bar::baz::parser::location_type &loc, + const std::string &msg) { - static char const input[] = ""; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; + std::cerr << "At " << loc << ": " << msg << '\n'; } + +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - yydebug = 1; - return yyparse (); + foo[3]::bar::baz::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1562: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:543" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1562" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:543" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1562: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:543" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1562" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:543" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1562: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:543: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1562" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:543" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -146687,16 +185459,16 @@ at_status=$? at_failed=false $at_check_filter 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:1562" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:543" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1562: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:543: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1562" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:543" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -146705,7 +185477,7 @@ at_status=$? at_failed=false $at_check_filter 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:1562" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:543" $at_failed && at_fn_log_failure $at_traceon; } @@ -146713,92 +185485,25 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1562: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1562" -( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:543: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:543" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 8 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1562" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:543" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:1562: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1562" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1562" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/regression.at:1562: \$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:1562" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:1562" -$at_failed && at_fn_log_failure -$at_traceon; } - - - -{ set +x -$as_echo "$at_srcdir/regression.at:1563: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1563" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1563" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:1563: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1563" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "Starting parse -Entering state 0 -Reading a token: Now at end of input. -LAC: initial context established for \$end -LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded) -memory exhausted -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 0 $at_status "$at_srcdir/regression.at:1563" -$at_failed && at_fn_log_failure -$at_traceon; } -# Induce an immediate syntax error with an undefined token, and check -# for memory exhaustion while building syntax error message. -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -146807,94 +185512,87 @@ cat >input.y <<'_ATEOF' #undef realloc } +%language "C++" +%define api.namespace {foo::bar,baz} +%union { int i; } +%define global_tokens_and_yystype +%locations + %code { - #include - static void yyerror ( const char *msg); - static int yylex (void); - #define YYMAXDEPTH 8 + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const foo::bar,baz::parser::location_type*) { + lval->i = 3; + return 0; + } } -%error-verbose - %% -S: A A A A A A A A A ; -A: /*empty*/ | 'a' ; +start: ; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) + +void +foo::bar,baz::parser::error (const foo::bar,baz::parser::location_type &loc, + const std::string &msg) { - static char const input[] = "z"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; + std::cerr << "At " << loc << ": " << msg << '\n'; } + +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - yydebug = 1; - return yyparse (); + foo::bar,baz::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1576: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:544: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:544" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1576" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:544" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1576: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:544: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:544" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1576" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:544" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1576: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:544: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1576" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:544" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -146903,16 +185601,16 @@ at_status=$? at_failed=false $at_check_filter 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:1576" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:544" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1576: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:544: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1576" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:544" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -146921,7 +185619,7 @@ at_status=$? at_failed=false $at_check_filter 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:1576" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:544" $at_failed && at_fn_log_failure $at_traceon; } @@ -146929,86 +185627,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1576: bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\ - -t -o input.c input.y" -at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1576" -( $at_check_trace; bison -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \ - -t -o input.c input.y +$as_echo "$at_srcdir/c++.at:544: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:544" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 8 shift/reduce -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1576" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:544" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:1576: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1576" -( $at_check_trace; $BISON_C_WORKS + + + + + +cat >input.yy <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} + +%language "C++" +%define api.namespace {foo::bar::(baz /* Pacify Emacs ) */} +%union { int i; } +%define global_tokens_and_yystype +%locations + +%code { + // YYSTYPE contains a namespace reference. + int yylex (YYSTYPE *lval, const foo::bar::(baz /* Pacify Emacs ) */::parser::location_type*) { + lval->i = 3; + return 0; + } +} + +%% + +start: ; + +%% + +void +foo::bar::(baz /* Pacify Emacs ) */::parser::error (const foo::bar::(baz /* Pacify Emacs ) */::parser::location_type &loc, + const std::string &msg) +{ + std::cerr << "At " << loc << ": " << msg << '\n'; +} + +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) +{ + foo::bar::(baz /* Pacify Emacs ) */::parser p; + (void) argc; + (void) argv; + return p.parse (); +} +_ATEOF + + + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1576" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:545" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/regression.at:1576: \$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:1576" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS + { set +x +$as_echo "$at_srcdir/c++.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1576" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:545" $at_failed && at_fn_log_failure $at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/c++.at:545: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:545" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:545" +$at_failed && at_fn_log_failure +$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/regression.at:1577: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1577" -( $at_check_trace; $PREPARSER ./input + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/c++.at:545: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:545" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1577" +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:545" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/regression.at:1577: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1577" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/c++.at:545: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:545" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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 \$undefined () -LAC: initial context established for \$undefined -LAC: checking lookahead \$undefined: Always Err -Constructing syntax error message -LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded) -syntax error -memory exhausted -Cleanup: discarding lookahead token \$undefined () -Stack now 0 -" | \ - $at_diff - "$at_stderr" || at_failed=: +at_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:1577" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:545" $at_failed && at_fn_log_failure $at_traceon; } @@ -147016,24 +185785,23 @@ $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_296 -#AT_START_297 -at_fn_group_banner 297 'regression.at:1664' \ - "Lex and parse params: yacc.c" " " 17 +#AT_STOP_437 +#AT_START_438 +at_fn_group_banner 438 'c++.at:558' \ + "Syntax error discarding no lookahead" " " 20 at_xfail=no ( - $as_echo "297. $at_setup_line: testing $at_desc ..." + $as_echo "438. $at_setup_line: testing $at_desc ..." $at_traceon -## FIXME: Improve parsing of parse-param and use the generated -## yyerror. cat >input.y <<'_ATEOF' %code top { #include @@ -147043,62 +185811,64 @@ cat >input.y <<'_ATEOF' #undef realloc } -%defines -%locations -%skeleton "yacc.c" -%union { int ival; } -%parse-param { int x } -// Spaces, tabs, and new lines. -%parse-param { - int y - - +%skeleton "lalr1.cc" + +%code { + #include + int yylex (yy::parser::semantic_type *); + #define USE(Args) } -%{ -#include -#include +%define parse.error verbose - static void yyerror (int x, int y, const char *msg); - static int yylex (void); -%} +%nonassoc 'a' ; + +%destructor { + std::cerr << "Discarding 'a'.\n"; +} 'a' %% -exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; + +start: error-reduce consistent-error 'a' { USE ($3); }; + +error-reduce: + 'a' 'a' consistent-error 'a' { USE (($1, $2, $4)); } +| 'a' error { std::cerr << "Reducing 'a'.\n"; USE ($1); } +; + +consistent-error: + 'a' +| /*empty*/ %prec 'a' +; + +// Provide another context in which all rules are useful so that this +// test case looks a little more realistic. +start: 'b' consistent-error ; + %% -#include -/* A C error reporting function. */ -static -void yyerror (int x, int y, const char *msg) + +int +yylex (yy::parser::semantic_type *) { - YYUSE(x); - YYUSE(y); - YY_LOCATION_PRINT (stderr, (yylloc)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); + static char const *input = "aa"; + return *input++; } -#include -static -int yylex (void) + +void +yy::parser::error (const std::string &m) { - static char const input[] = "a"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - (yylloc).first_line = (yylloc).last_line = 1; - (yylloc).first_column = (yylloc).last_column = toknum; - return res; + std::cerr << m << '\n'; } - - +#include // getenv. +#include // strcmp. int -main (void) +main (int argc, char const* argv[]) { - return !!yyparse(1, 2); + yy::parser p; + (void) argc; + (void) argv; + return p.parse (); } _ATEOF @@ -147110,39 +185880,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1664" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/c++.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:615" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1664" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1664: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1664" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/c++.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:615" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1664" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:615" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1664: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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' "regression.at:1664" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 @@ -147151,16 +185921,16 @@ at_status=$? at_failed=false $at_check_filter 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:1664" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:615" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1664: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1664" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.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 | sort @@ -147169,7 +185939,7 @@ at_status=$? at_failed=false $at_check_filter 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:1664" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:615" $at_failed && at_fn_log_failure $at_traceon; } @@ -147177,71 +185947,74 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1664: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:1664" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/c++.at:615: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "c++.at:615" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1664" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:615" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1664: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1664" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/c++.at:615: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:615" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1664" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:615" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1664: \$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:1664" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:615: \$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:615" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1664" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:615" $at_failed && at_fn_log_failure $at_traceon; } - +# This used to print "Discarding 'a'." again at the end. { set +x -$as_echo "$at_srcdir/regression.at:1664: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1664" +$as_echo "$at_srcdir/c++.at:621: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:621" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "x: 1, y: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1664" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/c++.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1664: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1664" +$as_echo "$at_srcdir/c++.at:621: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:621" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "syntax error +Discarding 'a'. +Reducing 'a'. +" | \ + $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:1664" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:621" $at_failed && at_fn_log_failure $at_traceon; } @@ -147252,20 +186025,18 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_297 -#AT_START_298 -at_fn_group_banner 298 'regression.at:1665' \ - "Lex and parse params: glr.c" " " 17 +#AT_STOP_438 +#AT_START_439 +at_fn_group_banner 439 'c++.at:631' \ + "Syntax error as exception" " " 20 at_xfail=no ( - $as_echo "298. $at_setup_line: testing $at_desc ..." + $as_echo "439. $at_setup_line: testing $at_desc ..." $at_traceon -## FIXME: Improve parsing of parse-param and use the generated -## yyerror. cat >input.y <<'_ATEOF' %code top { #include @@ -147275,62 +186046,79 @@ cat >input.y <<'_ATEOF' #undef realloc } +%skeleton "lalr1.cc" %defines -%locations -%skeleton "glr.c" -%union { int ival; } -%parse-param { int x } -// Spaces, tabs, and new lines. -%parse-param { - int y - - + +%code +{ + #include + int yylex (yy::parser::semantic_type *); } -%{ -#include -#include +%define api.value.type variant +%define parse.error verbose +%define parse.trace +%% - static void yyerror (int x, int y, const char *msg); - static int yylex (void); -%} +start: + thing +| start thing +; + +thing: + error { std::cerr << "caught error\n"; } +| item +; + +item: + 'a' +| 's' + { + throw yy::parser::syntax_error ("invalid expression"); + } %% -exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; -%% -#include -/* A C error reporting function. */ -static -void yyerror (int x, int y, const char *msg) + +void +yy::parser::error (const std::string &m) { - YYUSE(x); - YYUSE(y); - YY_LOCATION_PRINT (stderr, (yylloc)); - fprintf (stderr, ": "); - fprintf (stderr, "%s\n", msg); + std::cerr << "error: " << m << '\n'; } -#include -static -int yylex (void) +#include // getenv. +#include // strcmp. +int +main (int argc, char const* argv[]) { - static char const input[] = "a"; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - (yylloc).first_line = (yylloc).last_line = 1; - (yylloc).first_column = (yylloc).last_column = toknum; - return res; + yy::parser p; + (void) argc; + (void) argv; + return p.parse (); } +_ATEOF + +cat >input-scan.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include "input.hh" int -main (void) +yylex (yy::parser::semantic_type *) { - return !!yyparse(1, 2); + // 's': syntax error, 'l': lexical error. + static char const *input = "asal"; + switch (int res = *input++) + { + case 'l': + throw yy::parser::syntax_error ("invalid character"); + default: + return res; + } } _ATEOF @@ -147342,39 +186130,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1665: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1665" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/c++.at:695: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:695" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1665" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:695" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1665: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1665" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/c++.at:695: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:695" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1665" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:695" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1665: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:695: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1665" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:695" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -147383,16 +186171,16 @@ at_status=$? at_failed=false $at_check_filter 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:1665" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:695" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1665: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:695: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1665" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:695" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -147401,7 +186189,7 @@ at_status=$? at_failed=false $at_check_filter 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:1665" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:695" $at_failed && at_fn_log_failure $at_traceon; } @@ -147409,71 +186197,75 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1665: bison -o input.c input.y" -at_fn_check_prepare_trace "regression.at:1665" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/c++.at:695: bison -fno-caret -o input.cc input.y" +at_fn_check_prepare_trace "c++.at:695" +( $at_check_trace; bison -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1665" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:695" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1665: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1665" -( $at_check_trace; $BISON_C_WORKS + +{ set +x +$as_echo "$at_srcdir/c++.at:695: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:695" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1665" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:695" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1665: \$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:1665" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS +$as_echo "$at_srcdir/c++.at:695: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc input-scan.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc input-scan.cc $LIBS" "c++.at:695" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc input-scan.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1665" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:695" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1665: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1665" +$as_echo "$at_srcdir/c++.at:702: \$PREPARSER ./input" +at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:702" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "x: 1, y: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1665" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:702" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1665: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1665" +$as_echo "$at_srcdir/c++.at:702: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:702" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "error: invalid expression +caught error +error: invalid character +caught error +" | \ + $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:1665" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:702" $at_failed && at_fn_log_failure $at_traceon; } @@ -147484,21 +186276,102 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_298 -#AT_START_299 -at_fn_group_banner 299 'regression.at:1666' \ - "Lex and parse params: lalr1.cc" " " 17 +#AT_STOP_439 +#AT_START_440 +at_fn_group_banner 440 'c++.at:992' \ + "Exception safety with error recovery " " " 20 at_xfail=no ( - $as_echo "299. $at_setup_line: testing $at_desc ..." + $as_echo "440. $at_setup_line: testing $at_desc ..." $at_traceon +cat >exception.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include +#include + +void foo() +{ + try + { + throw std::runtime_error("foo"); + } + catch (...) + { + std::cerr << "Inner caught\n"; + throw; + } +} + +int main() +{ + try + { + foo(); + } + catch (...) + { + std::cerr << "Outer caught\n"; + return 0; + } + return 1; +} +_ATEOF + -## FIXME: Improve parsing of parse-param and use the generated -## yyerror. -cat >input.y <<'_ATEOF' +{ set +x +$as_echo "$at_srcdir/c++.at:992: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:992" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:992" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:992: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exception exception.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS" "c++.at:992" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:992" +$at_failed && at_fn_log_failure +$at_traceon; } + +# The "empty" quadrigraph is to protect from cfg.mk's +# sc_at_parser_check. +{ set +x +$as_echo "$at_srcdir/c++.at:992: ./exception || exit 77" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; ./exception || exit 77 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:992" +$at_failed && at_fn_log_failure +$at_traceon; } + + + + + +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -147507,108 +186380,266 @@ cat >input.y <<'_ATEOF' #undef realloc } -%defines -%locations %skeleton "lalr1.cc" -%union { int ival; } -%parse-param { int x } -// Spaces, tabs, and new lines. -%parse-param { - int y - - -} +%debug +%error-verbose -%{ -#include -#include +%code requires +{ + #include + #include // size_t and getenv. + #include + #include + #include + bool debug = false; - static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -%} + /// A class that tracks its instances. + struct Object + { + char val; -%% -exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; -%% -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) + Object () + : val ('?') + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + Object (const Object& that) + : val (that.val) + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + Object (char v) + : val (v) + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + ~Object () + { + log (this, "Object::~Object"); + objects::iterator i = instances.find (this); + // Make sure this object is alive. + assert (i != instances.end ()); + Object::instances.erase (i); + } + + Object& operator= (const Object& that) + { + val = that.val; + return *this; + } + + Object& operator= (char v) + { + val = v; + return *this; + } + + // Static part. + typedef std::set objects; + static objects instances; + + static bool + empty () + { + return instances.empty (); + } + + static void + log (Object const *o, const std::string& msg) + { + if (debug) + { + if (o) + std::cerr << o << "->"; + std::cerr << msg << " {"; + const char* sep = " "; + for (objects::const_iterator i = instances.begin(), + i_end = instances.end(); + i != i_end; + ++i) + { + std::cerr << sep << *i; + sep = ", "; + } + std::cerr << " }\n"; + } + } + }; +} + +%code { - (void) l; - std::cerr << l << ": " << m << std::endl; + #include + #include // strchr + #include + int yylex (yy::parser::semantic_type *); + Object::objects Object::instances; + static char const *input; } -#include -static -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) + + +%union { - static char const input[] = "a"; - static size_t toknum = 0; - int res; - (void) lvalp;(void) llocp; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - (*llocp).begin.line = (*llocp).end.line = 1; - (*llocp).begin.column = (*llocp).end.column = toknum; - return res; + Object *obj; +} +%destructor { delete $$; } ; +%printer +{ + yyo << $$ << " '" << $$->val << '\''; + if ($$->val == 'p') + throw std::runtime_error ("printer"); +} ; + +%token 'a' 'E' 'e' 'p' 'R' 's' 'T' +%type list item + + +%initial-action +{ + if (strchr (input, 'i')) + throw std::runtime_error ("initial-action"); } +%% + +start: list { delete $1; }; + +list: + item { $$ = $1; } + // Right recursion to load the stack. +| item list { $$ = $1; delete $2; } +; + +item: + 'a' { $$ = $1; } +| 'e' { YYUSE ($$); YYUSE ($1); error ("syntax error"); } +// Not just 'E', otherwise we reduce when 'E' is the lookahead, and +// then the stack is emptied, defeating the point of the test. +| 'E' 'a' { YYUSE ($1); $$ = $2; } +| 'R' { $$ = YY_NULLPTR; delete $1; YYERROR; } +| 'p' { $$ = $1; } +| 's' { $$ = $1; throw std::runtime_error ("reduction"); } +| 'T' { $$ = YY_NULLPTR; delete $1; YYABORT; } +| error { $$ = new Object ('R'); yyerrok; } +; +%% + int -yyparse (int x, int y) +yylex (yy::parser::semantic_type *lvalp) { - yy::parser parser(x, y); - return parser.parse (); + // 'a': no error. + // 'e': user action calls error. + // 'E': syntax error, with yyerror that throws. + // 'i': initial action throws. + // 'l': yylex throws. + // 'R': call YYERROR in the action + // 's': reduction throws. + // 'T': call YYABORT in the action + switch (int res = *input++) + { + case 'l': + throw std::runtime_error ("yylex"); + default: + lvalp->obj = new Object (res); + // Fall through. + case 0: + return res; + } } +/* A C++ error reporting function. */ +void +yy::parser::error (const std::string& m) +{ + throw std::runtime_error (m); +} int -main (void) +main (int argc, const char *argv[]) { - return !!yyparse(1, 2); + switch (argc) + { + case 2: + input = argv[1]; + break; + case 3: + assert (std::string(argv[1]) == "--debug"); + debug = 1; + input = argv[2]; + break; + default: + abort (); + } + + yy::parser parser; + debug |= !!getenv ("YYDEBUG"); + parser.set_debug_level (debug); + int res = 2; + try + { + res = parser.parse (); + } + catch (const std::exception& e) + { + std::cerr << "exception caught: " << e.what () << '\n'; + } + catch (...) + { + std::cerr << "unknown exception caught\n"; + } + Object::log (YY_NULLPTR, "end"); + assert (Object::empty()); + return res; } _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1666: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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' "regression.at:1666" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/c++.at:992: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o input.cc --report=all input.yy" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:992" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1666" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1666: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1666" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/c++.at:992: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:992" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1666" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/regression.at:1666: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:992: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1666" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:992" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -147617,16 +186648,16 @@ at_status=$? at_failed=false $at_check_filter 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:1666" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/regression.at:1666: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:992: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1666" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:992" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -147635,7 +186666,7 @@ at_status=$? at_failed=false $at_check_filter 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:1666" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } @@ -147643,801 +186674,692 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/regression.at:1666: bison -o input.cc input.y" -at_fn_check_prepare_trace "regression.at:1666" -( $at_check_trace; bison -o input.cc input.y +$as_echo "$at_srcdir/c++.at:992: bison -fno-caret -o input.cc --report=all input.yy" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; bison -fno-caret -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1666" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1666: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1666" +$as_echo "$at_srcdir/c++.at:992: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:992" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1666" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1666: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1666" +$as_echo "$at_srcdir/c++.at:992: \$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:992" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1666" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1666: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1666" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input aaaas" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:992" +( $at_check_trace; $PREPARSER ./input aaaas ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "x: 1, y: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1666" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1666: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1666" +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "exception caught: reduction +" | \ + $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:1666" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input aaaal" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:992" +( $at_check_trace; $PREPARSER ./input aaaal +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:992" +$at_failed && at_fn_log_failure +$at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_299 -#AT_START_300 -at_fn_group_banner 300 'regression.at:1667' \ - "Lex and parse params: glr.cc" " " 17 -at_xfail=no -( - $as_echo "300. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - -## FIXME: Improve parsing of parse-param and use the generated -## yyerror. -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - -%defines -%locations -%skeleton "glr.cc" -%union { int ival; } -%parse-param { int x } -// Spaces, tabs, and new lines. -%parse-param { - int y - - -} - -%{ -#include -#include - - - static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); -%} - -%% -exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; -%% -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << l << ": " << m << std::endl; -} -#include -static -int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) -{ - static char const input[] = "a"; - static size_t toknum = 0; - int res; - (void) lvalp;(void) llocp; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - (*llocp).begin.line = (*llocp).end.line = 1; - (*llocp).begin.column = (*llocp).end.column = toknum; - return res; -} - -int -yyparse (int x, int y) -{ - yy::parser parser(x, y); - return parser.parse (); -} - - -int -main (void) -{ - return !!yyparse(1, 2); -} -_ATEOF +{ set +x +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "exception caught: yylex +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" +$at_failed && at_fn_log_failure +$at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:1667: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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' "regression.at:1667" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input i" +at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:992" +( $at_check_trace; $PREPARSER ./input i ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1667" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/regression.at:1667: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1667" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1667" +echo >>"$at_stderr"; $as_echo "exception caught: initial-action +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/regression.at:1667: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1667" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml + + +{ set +x +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input aaaap" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:992" +( $at_check_trace; $PREPARSER ./input aaaap ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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:1667" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/regression.at:1667: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1667" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort +{ set +x +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1667" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + + { set +x -$as_echo "$at_srcdir/regression.at:1667: bison -o input.cc input.y" -at_fn_check_prepare_trace "regression.at:1667" -( $at_check_trace; bison -o input.cc input.y +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input --debug aaaap" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:992" +( $at_check_trace; $PREPARSER ./input --debug aaaap ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } - - { set +x -$as_echo "$at_srcdir/regression.at:1667: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1667" -( $at_check_trace; $BISON_CXX_WORKS +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1667" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } + { set +x -$as_echo "$at_srcdir/regression.at:1667: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" -at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1667" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +$as_echo "$at_srcdir/c++.at:992: grep '^exception caught: printer\$' stderr" +at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:992" +( $at_check_trace; grep '^exception caught: printer$' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1667: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1667" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input aaaae" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:992" +( $at_check_trace; $PREPARSER ./input aaaae ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" -echo >>"$at_stdout"; $as_echo "x: 1, y: 2 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1667" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/regression.at:1667: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "regression.at:1667" +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "exception caught: 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/regression.at:1667" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_300 -#AT_START_301 -at_fn_group_banner 301 'c++.at:101' \ - "Doxygen Public Documentation" " " 18 -at_xfail=no -( - $as_echo "301. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -cat >input.yy <<'_ATEOF' -%skeleton "lalr1.cc" -%locations -%debug -%defines -%% -exp:; -%% -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - (void) l; - std::cerr << m << std::endl; -} -_ATEOF - - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.yy +{ set +x +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input aaaaE" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:992" +( $at_check_trace; $PREPARSER ./input aaaaE ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:101: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:101" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy +{ set +x +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo >>"$at_stderr"; $as_echo "exception caught: syntax error, unexpected \$end, expecting 'a' +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $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" 5>&- -at_status=$? at_failed=false -$at_check_filter -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; } - sort 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 | sort" -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 | sort + +{ set +x +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input aaaaT" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:992" +( $at_check_trace; $PREPARSER ./input aaaaT ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -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 +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $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 +$as_echo "$at_srcdir/c++.at:992: \$PREPARSER ./input aaaaR" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:992" +( $at_check_trace; $PREPARSER ./input aaaaR ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $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 +$as_echo "$at_srcdir/c++.at:992: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:992" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:992" $at_failed && at_fn_log_failure $at_traceon; } + + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_301 -#AT_START_302 -at_fn_group_banner 302 'c++.at:102' \ - "Doxygen Private Documentation" " " 18 +#AT_STOP_440 +#AT_START_441 +at_fn_group_banner 441 'c++.at:993' \ + "Exception safety without error recovery " " " 20 at_xfail=no ( - $as_echo "302. $at_setup_line: testing $at_desc ..." + $as_echo "441. $at_setup_line: testing $at_desc ..." $at_traceon +cat >exception.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc -cat >input.yy <<'_ATEOF' -%skeleton "lalr1.cc" -%locations -%debug -%defines -%% -exp:; -%% -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) +#include +#include + +void foo() +{ + try + { + throw std::runtime_error("foo"); + } + catch (...) + { + std::cerr << "Inner caught\n"; + throw; + } +} + +int main() { - (void) l; - std::cerr << m << std::endl; + try + { + foo(); + } + catch (...) + { + std::cerr << "Outer caught\n"; + return 0; + } + return 1; } _ATEOF -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.yy + +{ set +x +$as_echo "$at_srcdir/c++.at:993: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:993" +( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:102: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:102" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.yy +{ set +x +$as_echo "$at_srcdir/c++.at:993: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exception exception.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS" "c++.at:993" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" 5>&- -at_status=$? at_failed=false -$at_check_filter -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; } - - sort 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 | sort" -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 | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi +# The "empty" quadrigraph is to protect from cfg.mk's +# sc_at_parser_check. { 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 +$as_echo "$at_srcdir/c++.at:993: ./exception || exit 77" +at_fn_check_prepare_trace "c++.at:993" +( $at_check_trace; ./exception || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $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" +cat >input.yy <<'_ATEOF' +%code top { +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc +} -# 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 +%skeleton "lalr1.cc" +%debug +%error-verbose -# If the EXTRACT_PRIVATE tag is set to YES all private members of a -# class will be included in the documentation. -EXTRACT_PRIVATE = YES +%code requires +{ + #include + #include // size_t and getenv. + #include + #include + #include -# 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 + bool debug = false; + /// A class that tracks its instances. + struct Object + { + char val; -{ 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" 5>&- -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; } + Object () + : val ('?') + { + log (this, "Object::Object"); + Object::instances.insert (this); + } -{ 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" 5>&- -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; } + Object (const Object& that) + : val (that.val) + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + Object (char v) + : val (v) + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + ~Object () + { + log (this, "Object::~Object"); + objects::iterator i = instances.find (this); + // Make sure this object is alive. + assert (i != instances.end ()); + Object::instances.erase (i); + } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_302 -#AT_START_303 -at_fn_group_banner 303 'c++.at:160' \ - "Relative namespace references" " " 18 -at_xfail=no -( - $as_echo "303. $at_setup_line: testing $at_desc ..." - $at_traceon + Object& operator= (const Object& that) + { + val = that.val; + return *this; + } + Object& operator= (char v) + { + val = v; + return *this; + } + // Static part. + typedef std::set objects; + static objects instances; -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc + static bool + empty () + { + return instances.empty (); + } + + static void + log (Object const *o, const std::string& msg) + { + if (debug) + { + if (o) + std::cerr << o << "->"; + std::cerr << msg << " {"; + const char* sep = " "; + for (objects::const_iterator i = instances.begin(), + i_end = instances.end(); + i != i_end; + ++i) + { + std::cerr << sep << *i; + sep = ", "; + } + std::cerr << " }\n"; + } + } + }; } -%language "C++" -%defines -%define namespace "foo" -%union { int i; } -%define global_tokens_and_yystype +%code +{ + #include + #include // strchr + #include + int yylex (yy::parser::semantic_type *); + Object::objects Object::instances; + static char const *input; +} -%code { - // YYSTYPE contains a namespace reference. - int yylex (YYSTYPE *lval) { - lval->i = 3; - return 0; - } + +%union +{ + Object *obj; +} +%destructor { delete $$; } ; +%printer +{ + yyo << $$ << " '" << $$->val << '\''; + if ($$->val == 'p') + throw std::runtime_error ("printer"); +} ; + +%token 'a' 'E' 'e' 'p' 'R' 's' 'T' +%type list item + + +%initial-action +{ + if (strchr (input, 'i')) + throw std::runtime_error ("initial-action"); } %% -start: ; +start: list { delete $1; }; + +list: + item { $$ = $1; } + // Right recursion to load the stack. +| item list { $$ = $1; delete $2; } +; + +item: + 'a' { $$ = $1; } +| 'e' { YYUSE ($$); YYUSE ($1); error ("syntax error"); } +// Not just 'E', otherwise we reduce when 'E' is the lookahead, and +// then the stack is emptied, defeating the point of the test. +| 'E' 'a' { YYUSE ($1); $$ = $2; } +| 'R' { $$ = YY_NULLPTR; delete $1; YYERROR; } +| 'p' { $$ = $1; } +| 's' { $$ = $1; throw std::runtime_error ("reduction"); } +| 'T' { $$ = YY_NULLPTR; delete $1; YYABORT; } +; %% +int +yylex (yy::parser::semantic_type *lvalp) +{ + // 'a': no error. + // 'e': user action calls error. + // 'E': syntax error, with yyerror that throws. + // 'i': initial action throws. + // 'l': yylex throws. + // 'R': call YYERROR in the action + // 's': reduction throws. + // 'T': call YYABORT in the action + switch (int res = *input++) + { + case 'l': + throw std::runtime_error ("yylex"); + default: + lvalp->obj = new Object (res); + // Fall through. + case 0: + return res; + } +} + +/* A C++ error reporting function. */ void -foo::parser::error (const foo::parser::location_type &loc, - const std::string &msg) +yy::parser::error (const std::string& m) { - std::cerr << "At " << loc << ": " << msg << std::endl; + throw std::runtime_error (m); } int -main (void) +main (int argc, const char *argv[]) { - foo::parser p; - return p.parse (); + switch (argc) + { + case 2: + input = argv[1]; + break; + case 3: + assert (std::string(argv[1]) == "--debug"); + debug = 1; + input = argv[2]; + break; + default: + abort (); + } + + yy::parser parser; + debug |= !!getenv ("YYDEBUG"); + parser.set_debug_level (debug); + int res = 2; + try + { + res = parser.parse (); + } + catch (const std::exception& e) + { + std::cerr << "exception caught: " << e.what () << '\n'; + } + catch (...) + { + std::cerr << "unknown exception caught\n"; + } + Object::log (YY_NULLPTR, "end"); + assert (Object::empty()); + return res; } _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/c++.at:993: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o input.cc --report=all input.yy" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:993" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:161" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/c++.at:993: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:993" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/c++.at:161: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:993: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:993" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -148446,16 +187368,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/c++.at:161: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:993: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:161" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:993" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -148464,7 +187386,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } @@ -148472,656 +187394,416 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/c++.at:993: bison -fno-caret -o input.cc --report=all input.yy" +at_fn_check_prepare_trace "c++.at:993" +( $at_check_trace; bison -fno-caret -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $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" +$as_echo "$at_srcdir/c++.at:993: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:993" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $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" +$as_echo "$at_srcdir/c++.at:993: \$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:993" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $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 +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input aaaas" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:993" +( $at_check_trace; $PREPARSER ./input aaaas ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161" +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:161: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:161" +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "exception caught: reduction +" | \ + $at_diff - "$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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* 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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input aaaal" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:993" +( $at_check_trace; $PREPARSER ./input aaaal ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:162: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:162" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo >>"$at_stderr"; $as_echo "exception caught: yylex +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $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" 5>&- -at_status=$? at_failed=false -$at_check_filter -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; } - sort 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 | sort" -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 | sort + +{ set +x +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input i" +at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:993" +( $at_check_trace; $PREPARSER ./input i ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -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 +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "exception caught: initial-action +" | \ + $at_diff - "$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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $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 +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input aaaap" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:993" +( $at_check_trace; $PREPARSER ./input aaaap ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $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 +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:993" $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 +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input --debug aaaap" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:993" +( $at_check_trace; $PREPARSER ./input --debug aaaap ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:162: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:162" +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - - - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* 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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/c++.at:993: grep '^exception caught: printer\$' stderr" +at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:993" +( $at_check_trace; grep '^exception caught: printer$' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:163" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y + +{ set +x +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input aaaae" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:993" +( $at_check_trace; $PREPARSER ./input aaaae ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:993" $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 +{ set +x +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo >>"$at_stderr"; $as_echo "exception caught: 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/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - sort 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 | sort" -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 | sort + + +{ set +x +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input aaaaE" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:993" +( $at_check_trace; $PREPARSER ./input aaaaE ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -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 +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "exception caught: syntax error, unexpected \$end, expecting 'a' +" | \ + $at_diff - "$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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $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 +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input aaaaT" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:993" +( $at_check_trace; $PREPARSER ./input aaaaT ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/c++.at:993" $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 +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:993" $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 +$as_echo "$at_srcdir/c++.at:993: \$PREPARSER ./input aaaaR" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:993" +( $at_check_trace; $PREPARSER ./input aaaaR ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163" +at_fn_check_status 1 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:163: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:163" +$as_echo "$at_srcdir/c++.at:993: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:993" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:993" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_303 -#AT_START_304 -at_fn_group_banner 304 'c++.at:166' \ - "Absolute namespace references" " " 18 +#AT_STOP_441 +#AT_START_442 +at_fn_group_banner 442 'c++.at:994' \ + "Exception safety with error recovery api.value.type=variant" "" 20 at_xfail=no ( - $as_echo "304. $at_setup_line: testing $at_desc ..." + $as_echo "442. $at_setup_line: testing $at_desc ..." $at_traceon - -cat >input.y <<'_ATEOF' -%code top { +cat >exception.cc <<'_ATEOF' #include /* 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: ; -%% +#include +#include -void -::foo::parser::error (const ::foo::parser::location_type &loc, - const std::string &msg) +void foo() { - std::cerr << "At " << loc << ": " << msg << std::endl; + try + { + throw std::runtime_error("foo"); + } + catch (...) + { + std::cerr << "Inner caught\n"; + throw; + } } -int -main (void) +int main() { - ::foo::parser p; - return p.parse (); + try + { + foo(); + } + catch (...) + { + std::cerr << "Outer caught\n"; + return 0; + } + return 1; } _ATEOF -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:167" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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" 5>&- -at_status=$? at_failed=false -$at_check_filter -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; } - - sort 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 | sort" -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 | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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 - at_restore_special_files -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" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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" +$as_echo "$at_srcdir/c++.at:994: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:994" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $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 +$as_echo "$at_srcdir/c++.at:994: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exception exception.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS" "c++.at:994" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } +# The "empty" quadrigraph is to protect from cfg.mk's +# sc_at_parser_check. { set +x -$as_echo "$at_srcdir/c++.at:167: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:167" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/c++.at:994: ./exception || exit 77" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; ./exception || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } @@ -149129,8 +187811,7 @@ $at_traceon; } - -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -149139,82 +187820,261 @@ cat >input.y <<'_ATEOF' #undef realloc } -%language "C++" -%defines -%define namespace "::foo::bar" -%union { int i; } -%define global_tokens_and_yystype +%skeleton "lalr1.cc" +%debug +%error-verbose +%define api.value.type variant +%code requires +{ + #include + #include // size_t and getenv. + #include + #include + #include -%code { - // YYSTYPE contains a namespace reference. - int yylex (YYSTYPE *lval) { - lval->i = 3; - return 0; - } + bool debug = false; + + /// A class that tracks its instances. + struct Object + { + char val; + + Object () + : val ('?') + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + Object (const Object& that) + : val (that.val) + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + Object (char v) + : val (v) + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + ~Object () + { + log (this, "Object::~Object"); + objects::iterator i = instances.find (this); + // Make sure this object is alive. + assert (i != instances.end ()); + Object::instances.erase (i); + } + + Object& operator= (const Object& that) + { + val = that.val; + return *this; + } + + Object& operator= (char v) + { + val = v; + return *this; + } + + // Static part. + typedef std::set objects; + static objects instances; + + static bool + empty () + { + return instances.empty (); + } + + static void + log (Object const *o, const std::string& msg) + { + if (debug) + { + if (o) + std::cerr << o << "->"; + std::cerr << msg << " {"; + const char* sep = " "; + for (objects::const_iterator i = instances.begin(), + i_end = instances.end(); + i != i_end; + ++i) + { + std::cerr << sep << *i; + sep = ", "; + } + std::cerr << " }\n"; + } + } + }; +} + +%code +{ + #include + #include // strchr + #include + int yylex (yy::parser::semantic_type *); + Object::objects Object::instances; + static char const *input; +} + + +%printer +{ + yyo << &$$ << " '" << $$.val << '\''; + if ($$.val == 'p') + throw std::runtime_error ("printer"); +} ; + +%token 'a' 'E' 'e' 'p' 'R' 's' 'T' +%type list item + + +%initial-action +{ + if (strchr (input, 'i')) + throw std::runtime_error ("initial-action"); } %% -start: ; +start: list {}; + +list: + item { $$ = $1; } + // Right recursion to load the stack. +| item list { $$ = $1; } +; +item: + 'a' { $$ = $1; } +| 'e' { YYUSE ($$); YYUSE ($1); error ("syntax error"); } +// Not just 'E', otherwise we reduce when 'E' is the lookahead, and +// then the stack is emptied, defeating the point of the test. +| 'E' 'a' { YYUSE ($1); $$ = $2; } +| 'R' { YYERROR; } +| 'p' { $$ = $1; } +| 's' { $$ = $1; throw std::runtime_error ("reduction"); } +| 'T' { YYABORT; } +| error { $$ = Object ('R'); yyerrok; } +; %% +int +yylex (yy::parser::semantic_type *lvalp) +{ + // 'a': no error. + // 'e': user action calls error. + // 'E': syntax error, with yyerror that throws. + // 'i': initial action throws. + // 'l': yylex throws. + // 'R': call YYERROR in the action + // 's': reduction throws. + // 'T': call YYABORT in the action + switch (int res = *input++) + { + case 'l': + throw std::runtime_error ("yylex"); + default: + lvalp->build (Object (res)); + // Fall through. + case 0: + return res; + } +} + +/* A C++ error reporting function. */ void -::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc, - const std::string &msg) +yy::parser::error (const std::string& m) { - std::cerr << "At " << loc << ": " << msg << std::endl; + throw std::runtime_error (m); } int -main (void) +main (int argc, const char *argv[]) { - ::foo::bar::parser p; - return p.parse (); + switch (argc) + { + case 2: + input = argv[1]; + break; + case 3: + assert (std::string(argv[1]) == "--debug"); + debug = 1; + input = argv[2]; + break; + default: + abort (); + } + + yy::parser parser; + debug |= !!getenv ("YYDEBUG"); + parser.set_debug_level (debug); + int res = 2; + try + { + res = parser.parse (); + } + catch (const std::exception& e) + { + std::cerr << "exception caught: " << e.what () << '\n'; + } + catch (...) + { + std::cerr << "unknown exception caught\n"; + } + Object::log (YY_NULLPTR, "end"); + assert (Object::empty()); + return res; } _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/c++.at:994: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o input.cc --report=all input.yy" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:994" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:168" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/c++.at:994: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:994" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/c++.at:168: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:994: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:994" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -149223,16 +188083,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/c++.at:168: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:994: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:168" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:994" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -149241,7 +188101,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } @@ -149249,452 +188109,416 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/c++.at:994: bison -fno-caret -o input.cc --report=all input.yy" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; bison -fno-caret -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $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" +$as_echo "$at_srcdir/c++.at:994: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:994" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $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" +$as_echo "$at_srcdir/c++.at:994: \$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:994" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $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 +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input aaaas" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:994" +( $at_check_trace; $PREPARSER ./input aaaas ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168" +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:168: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:168" +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "exception caught: reduction +" | \ + $at_diff - "$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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input aaaal" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:994" +( $at_check_trace; $PREPARSER ./input aaaal +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:994" +$at_failed && at_fn_log_failure +$at_traceon; } - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* 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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo >>"$at_stderr"; $as_echo "exception caught: yylex +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:169: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:169" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y + + +{ set +x +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input i" +at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:994" +( $at_check_trace; $PREPARSER ./input i ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:994" $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 +{ set +x +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo >>"$at_stderr"; $as_echo "exception caught: initial-action +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } - sort 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 | sort" -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 | sort + + +{ set +x +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input aaaap" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:994" +( $at_check_trace; $PREPARSER ./input aaaap ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -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 +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input --debug aaaap" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:994" +( $at_check_trace; $PREPARSER ./input --debug aaaap +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:994" +$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 +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $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 +$as_echo "$at_srcdir/c++.at:994: grep '^exception caught: printer\$' stderr" +at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:994" +( $at_check_trace; grep '^exception caught: printer$' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $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 +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input aaaae" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:994" +( $at_check_trace; $PREPARSER ./input aaaae ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169" +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:169: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:169" +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "exception caught: 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/c++.at:169" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input aaaaE" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:994" +( $at_check_trace; $PREPARSER ./input aaaaE +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:994" +$at_failed && at_fn_log_failure +$at_traceon; } - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* 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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo >>"$at_stderr"; $as_echo "exception caught: syntax error, unexpected \$end, expecting 'a' +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:170: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:170" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y + + +{ set +x +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input aaaaT" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:994" +( $at_check_trace; $PREPARSER ./input aaaaT ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/c++.at:994" $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 +{ set +x +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } - sort 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 | sort" -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 | sort + + +{ set +x +$as_echo "$at_srcdir/c++.at:994: \$PREPARSER ./input aaaaR" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:994" +( $at_check_trace; $PREPARSER ./input aaaaR ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -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 +$as_echo "$at_srcdir/c++.at:994: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:994" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:994" $at_failed && at_fn_log_failure $at_traceon; } + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_442 +#AT_START_443 +at_fn_group_banner 443 'c++.at:995' \ + "Exception safety without error recovery api.value.type=variant" "" 20 +at_xfail=no +( + $as_echo "443. $at_setup_line: testing $at_desc ..." + $at_traceon + + +cat >exception.cc <<'_ATEOF' +#include +/* We don't need perfect functions for these tests. */ +#undef malloc +#undef memcmp +#undef realloc + +#include +#include + +void foo() +{ + try + { + throw std::runtime_error("foo"); + } + catch (...) + { + std::cerr << "Inner caught\n"; + throw; + } +} + +int main() +{ + try + { + foo(); + } + catch (...) + { + std::cerr << "Outer caught\n"; + return 0; + } + return 1; +} +_ATEOF + + + { set +x -$as_echo "$at_srcdir/c++.at:170: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:170" +$as_echo "$at_srcdir/c++.at:995: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:995" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $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 +$as_echo "$at_srcdir/c++.at:995: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exception exception.cc \$LIBS" +at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS" "c++.at:995" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } +# The "empty" quadrigraph is to protect from cfg.mk's +# sc_at_parser_check. { set +x -$as_echo "$at_srcdir/c++.at:170: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:170" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/c++.at:995: ./exception || exit 77" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; ./exception || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } @@ -149702,8 +188526,7 @@ $at_traceon; } - -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -149712,82 +188535,261 @@ cat >input.y <<'_ATEOF' #undef realloc } -%language "C++" -%defines -%define namespace " ::foo::bar" -%union { int i; } -%define global_tokens_and_yystype +%skeleton "lalr1.cc" +%debug +%error-verbose +%define api.value.type variant +%code requires +{ + #include + #include // size_t and getenv. + #include + #include + #include -%code { - // YYSTYPE contains a namespace reference. - int yylex (YYSTYPE *lval) { - lval->i = 3; - return 0; - } + bool debug = false; + + /// A class that tracks its instances. + struct Object + { + char val; + + Object () + : val ('?') + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + Object (const Object& that) + : val (that.val) + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + Object (char v) + : val (v) + { + log (this, "Object::Object"); + Object::instances.insert (this); + } + + ~Object () + { + log (this, "Object::~Object"); + objects::iterator i = instances.find (this); + // Make sure this object is alive. + assert (i != instances.end ()); + Object::instances.erase (i); + } + + Object& operator= (const Object& that) + { + val = that.val; + return *this; + } + + Object& operator= (char v) + { + val = v; + return *this; + } + + // Static part. + typedef std::set objects; + static objects instances; + + static bool + empty () + { + return instances.empty (); + } + + static void + log (Object const *o, const std::string& msg) + { + if (debug) + { + if (o) + std::cerr << o << "->"; + std::cerr << msg << " {"; + const char* sep = " "; + for (objects::const_iterator i = instances.begin(), + i_end = instances.end(); + i != i_end; + ++i) + { + std::cerr << sep << *i; + sep = ", "; + } + std::cerr << " }\n"; + } + } + }; +} + +%code +{ + #include + #include // strchr + #include + int yylex (yy::parser::semantic_type *); + Object::objects Object::instances; + static char const *input; +} + + +%printer +{ + yyo << &$$ << " '" << $$.val << '\''; + if ($$.val == 'p') + throw std::runtime_error ("printer"); +} ; + +%token 'a' 'E' 'e' 'p' 'R' 's' 'T' +%type list item + + +%initial-action +{ + if (strchr (input, 'i')) + throw std::runtime_error ("initial-action"); } %% -start: ; +start: list {}; + +list: + item { $$ = $1; } + // Right recursion to load the stack. +| item list { $$ = $1; } +; + +item: + 'a' { $$ = $1; } +| 'e' { YYUSE ($$); YYUSE ($1); error ("syntax error"); } +// Not just 'E', otherwise we reduce when 'E' is the lookahead, and +// then the stack is emptied, defeating the point of the test. +| 'E' 'a' { YYUSE ($1); $$ = $2; } +| 'R' { YYERROR; } +| 'p' { $$ = $1; } +| 's' { $$ = $1; throw std::runtime_error ("reduction"); } +| 'T' { YYABORT; } +; %% +int +yylex (yy::parser::semantic_type *lvalp) +{ + // 'a': no error. + // 'e': user action calls error. + // 'E': syntax error, with yyerror that throws. + // 'i': initial action throws. + // 'l': yylex throws. + // 'R': call YYERROR in the action + // 's': reduction throws. + // 'T': call YYABORT in the action + switch (int res = *input++) + { + case 'l': + throw std::runtime_error ("yylex"); + default: + lvalp->build (Object (res)); + // Fall through. + case 0: + return res; + } +} + +/* A C++ error reporting function. */ void - ::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc, - const std::string &msg) +yy::parser::error (const std::string& m) { - std::cerr << "At " << loc << ": " << msg << std::endl; + throw std::runtime_error (m); } int -main (void) +main (int argc, const char *argv[]) { - ::foo::bar::parser p; - return p.parse (); + switch (argc) + { + case 2: + input = argv[1]; + break; + case 3: + assert (std::string(argv[1]) == "--debug"); + debug = 1; + input = argv[2]; + break; + default: + abort (); + } + + yy::parser parser; + debug |= !!getenv ("YYDEBUG"); + parser.set_debug_level (debug); + int res = 2; + try + { + res = parser.parse (); + } + catch (const std::exception& e) + { + std::cerr << "exception caught: " << e.what () << '\n'; + } + catch (...) + { + std::cerr << "unknown exception caught\n"; + } + Object::log (YY_NULLPTR, "end"); + assert (Object::empty()); + return res; } _ATEOF - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/c++.at:995: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -o input.cc --report=all input.yy" +at_fn_check_prepare_notrace 'an embedded newline' "c++.at:995" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:171: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:171" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/c++.at:995: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:995" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/c++.at:171: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:995: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:995" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -149796,16 +188798,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/c++.at:171: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:995: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:171" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:995" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -149814,7 +188816,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } @@ -149822,283 +188824,339 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/c++.at:995: bison -fno-caret -o input.cc --report=all input.yy" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; bison -fno-caret -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $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" +$as_echo "$at_srcdir/c++.at:995: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:995" ( $at_check_trace; $BISON_CXX_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $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" +$as_echo "$at_srcdir/c++.at:995: \$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:995" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $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 +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input aaaas" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:995" +( $at_check_trace; $PREPARSER ./input aaaas ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171" +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:171: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:171" +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stderr"; $as_echo "exception caught: reduction +" | \ + $at_diff - "$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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input aaaal" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:995" +( $at_check_trace; $PREPARSER ./input aaaal +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:995" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "exception caught: yylex +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input.y <<'_ATEOF' -%code top { -#include -/* 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 +{ set +x +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input i" +at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:995" +( $at_check_trace; $PREPARSER ./input i +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:995" +$at_failed && at_fn_log_failure +$at_traceon; } -%code { - // YYSTYPE contains a namespace reference. - int yylex (YYSTYPE *lval) { - lval->i = 3; - return 0; - } -} +{ set +x +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "exception caught: initial-action +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" +$at_failed && at_fn_log_failure +$at_traceon; } -%% -start: ; -%% +{ set +x +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input aaaap" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:995" +( $at_check_trace; $PREPARSER ./input aaaap +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" +$at_failed && at_fn_log_failure +$at_traceon; } -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; -} +{ set +x +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:995" +$at_failed && at_fn_log_failure +$at_traceon; } -int -main (void) -{ - ::foo::bar::baz::parser p; - return p.parse (); -} -_ATEOF +{ set +x +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input --debug aaaap" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:995" +( $at_check_trace; $PREPARSER ./input --debug aaaap +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:995" +$at_failed && at_fn_log_failure +$at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:172: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:172" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y + +{ set +x +$as_echo "$at_srcdir/c++.at:995: grep '^exception caught: printer\$' stderr" +at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:995" +( $at_check_trace; grep '^exception caught: printer$' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; cat "$at_stderr" +at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $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 + +{ set +x +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input aaaae" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:995" +( $at_check_trace; $PREPARSER ./input aaaae ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } - sort 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 | sort" -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 | sort +{ set +x +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +echo >>"$at_stderr"; $as_echo "exception caught: 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/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -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 +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input aaaaE" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:995" +( $at_check_trace; $PREPARSER ./input aaaaE ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" +at_fn_check_status 2 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo >>"$at_stderr"; $as_echo "exception caught: syntax error, unexpected \$end, expecting 'a' +" | \ + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" +$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 +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input aaaaT" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:995" +( $at_check_trace; $PREPARSER ./input aaaaT ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +echo stderr:; tee stderr <"$at_stderr" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/c++.at:995" $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 +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" +( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:995" $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 +$as_echo "$at_srcdir/c++.at:995: \$PREPARSER ./input aaaaR" +at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:995" +( $at_check_trace; $PREPARSER ./input aaaaR ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172" +at_fn_check_status 1 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:172: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:172" +$as_echo "$at_srcdir/c++.at:995: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "c++.at:995" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:995" $at_failed && at_fn_log_failure $at_traceon; } + set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_304 -#AT_START_305 -at_fn_group_banner 305 'c++.at:175' \ - "Syntactically invalid namespace references" " " 18 +#AT_STOP_443 +#AT_START_444 +at_fn_group_banner 444 'c++.at:1003' \ + "C++ GLR parser identifier shadowing" " " 20 at_xfail=no ( - $as_echo "305. $at_setup_line: testing $at_desc ..." + $as_echo "444. $at_setup_line: testing $at_desc ..." $at_traceon - -cat >input.y <<'_ATEOF' +cat >input.yy <<'_ATEOF' %code top { #include /* We don't need perfect functions for these tests. */ @@ -150107,39 +189165,40 @@ cat >input.y <<'_ATEOF' #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; - } +%skeleton "glr.cc" + +%union +{ + int ival; } -%% +%token ZERO; -start: ; +%code +{ + int yylex (yy::parser::semantic_type *yylval); +} %% +exp: ZERO -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) +int yylex (yy::parser::semantic_type *yylval) { - :foo:bar::parser p; - return p.parse (); + // Note: this argument is unused, but named on purpose. There used to be a + // bug with a macro that erroneously expanded this identifier to + // yystackp->yyval. + YYUSE (yylval); + return yy::parser::token::ZERO; } + +void yy::parser::error (std::string const&) +{} + +int main () +{} _ATEOF @@ -150150,39 +189209,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/c++.at:1041: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1041" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:1041" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:176" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/c++.at:1041: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:1041" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:1041" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/c++.at:176: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:1041: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:1041" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -150191,16 +189250,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/c++.at:1041" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/c++.at:176: \$XSLTPROC \\ +$as_echo "$at_srcdir/c++.at:1041: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:176" +at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:1041" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -150209,7 +189268,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/c++.at:1041" $at_failed && at_fn_log_failure $at_traceon; } @@ -150217,110 +189276,274 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/c++.at:1041: bison -fno-caret -o input.cc input.yy" +at_fn_check_prepare_trace "c++.at:1041" +( $at_check_trace; bison -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/c++.at:1041" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/c++.at:1042: \$BISON_CXX_WORKS" +at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:1042" +( $at_check_trace; $BISON_CXX_WORKS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1042" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/c++.at:1042: \$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:1042" +( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:1042" +$at_failed && at_fn_log_failure +$at_traceon; } + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_444 +#AT_START_445 +at_fn_group_banner 445 'java.at:367' \ + "Calculator " " " 21 +at_xfail=no +( + $as_echo "445. $at_setup_line: testing $at_desc ..." + $at_traceon -cat >input.y <<'_ATEOF' -%code top { -#include -/* 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 +cat >Calc.y <<'_ATEOF' +/* Infix notation calculator--calc */ +%language "Java" +%name-prefix "Calc" +%define parser_class_name {Calc} +%define public + %code { - // YYSTYPE contains a namespace reference. - int yylex (YYSTYPE *lval) { - lval->i = 3; - return 0; + + 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 NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence 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; } +; -start: ; %% +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 EOF; + + else if (ttype == st.TT_EOL) + { + + return (int) '\n'; + } + + else if (ttype == st.TT_WORD) + { + yylval = new Integer (st.sval); + return NUM; + } + + else + return st.ttype; + } + + -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 (); + +class Position { + public int line; + public int token; + + public Position () + { + line = 0; + token = 0; + } + + public Position (int l, int t) + { + line = l; + token = t; + } + + public boolean equals (Position l) + { + return l.line == line && l.token == token; + } + + public String toString () + { + return Integer.toString (line) + "." + Integer.toString(token); + } + + public int lineno () + { + return line; + } + + public int token () + { + return token; + } } + _ATEOF + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +$as_echo "$at_srcdir/java.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:367" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:177" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y +$as_echo "$at_srcdir/java.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:367" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/c++.at:177: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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_fn_check_prepare_notrace 'a `...` command substitution' "java.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -150329,16 +189552,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/c++.at:177: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:177" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -150347,7 +189570,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -150355,692 +189578,741 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/java.at:367: bison -fno-caret -o Calc.java Calc.y" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; bison -fno-caret -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } +$as_echo "java.at:367" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:367" +$as_echo "java.at:367" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:367" +{ set +x +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:367" +( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:367" +$at_failed && at_fn_log_failure +$at_traceon; } +# Test the priorities. +cat >input <<'_ATEOF' +1 + 2 * 3 = 7 +1 + 2 * -3 = -5 -# This one is interesting because `[3]' is encoded as `[3]', which -# contains single occurrences of `:'. - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} +-1^2 = -1 +(-1)^2 = 1 -%language "C++" -%defines -%define namespace "foo[3]::bar::baz" -%union { int i; } -%define global_tokens_and_yystype +---1 = -1 -%code { - // YYSTYPE contains a namespace reference. - int yylex (YYSTYPE *lval) { - lval->i = 3; - return 0; - } -} +1 - 2 - 3 = -4 +1 - (2 - 3) = 2 -%% +2^2^3 = 256 +(2^2)^3 = 64 +_ATEOF -start: ; +{ set +x +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:367" +$at_failed && at_fn_log_failure +$at_traceon; } -%% -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 (); -} +# Some syntax errors. +cat >input <<'_ATEOF' +0 0 _ATEOF +{ set +x +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:367" +$at_failed && at_fn_log_failure +$at_traceon; } -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Create the reference error message. +cat >expout <<'_ATEOF' +1.2: 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:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:367" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:180: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:180" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y + +cat >input <<'_ATEOF' +1//2 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +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:367" $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 + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Create the reference error message. +cat >expout <<'_ATEOF' +1.3: 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:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } - sort 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 | sort" -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 | sort + +cat >input <<'_ATEOF' +error +_ATEOF + +{ set +x +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +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:367" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Create the reference error message. +cat >expout <<'_ATEOF' +1.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/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 +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } - - - - - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* 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 (); -} +cat >input <<'_ATEOF' +1 = 2 = 3 _ATEOF - - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +{ set +x +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +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:367" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:181: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:181" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Create the reference error message. +cat >expout <<'_ATEOF' +1.4: 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:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:367" $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 + +cat >input <<'_ATEOF' + ++1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +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:367" $at_failed && at_fn_log_failure $at_traceon; } - sort 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 | sort" -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 | sort + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Create the reference error message. +cat >expout <<'_ATEOF' +2.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:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + +# Exercise error messages with EOF: work on an empty file. { 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 +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < /dev/null" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.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:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:367" +$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:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_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:367" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input.y <<'_ATEOF' -%code top { -#include -/* 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 (); -} +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Create the reference error message. +cat >expout <<'_ATEOF' +1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' +1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' +1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' +1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' +1.1-1.27: calc: error: 4444 != 1 _ATEOF - - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc input.y +# 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:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_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:367" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/c++.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:182" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc input.y + + +# 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:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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" +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:367" $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 + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Create the reference error message. +cat >expout <<'_ATEOF' +1.7: syntax error, unexpected number +1.1-1.10: 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:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } - sort 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 | sort" -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 | sort + +cat >input <<'_ATEOF' +(- *) + (0 0) = 1 +_ATEOF + +{ set +x +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -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" +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:367" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi + +# Normalize the observed and expected error messages, depending upon the +# options. +# 1. Create the reference error message. +cat >expout <<'_ATEOF' +1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' +1.8: syntax error, unexpected number +1.1-1.11: 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/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 +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_305 -#AT_START_306 -at_fn_group_banner 306 'c++.at:190' \ - "Exception safety" " " 18 +#AT_STOP_445 +#AT_START_446 +at_fn_group_banner 446 'java.at:367' \ + "Calculator %error-verbose " " " 21 at_xfail=no ( - $as_echo "306. $at_setup_line: testing $at_desc ..." + $as_echo "446. $at_setup_line: testing $at_desc ..." $at_traceon -cat >input.yy <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} -%skeleton "lalr1.cc" -%defines // FIXME: Mandated in 2.6. -%debug +cat >Calc.y <<'_ATEOF' +/* Infix notation calculator--calc */ +%language "Java" +%name-prefix "Calc" +%define parser_class_name {Calc} +%define public + %error-verbose +%code { -%code requires -{ - #include - #include // size_t and getenv. - #include - #include + public static void main (String args[]) throws IOException + { + CalcLexer l = new CalcLexer (System.in); + Calc p = new Calc (l); + p.parse (); + } - bool debug = false; +} - /// A class that counts its number of instances. - struct Object +%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 NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ + +/* Grammar follows */ +%% +input: + line +| input line +; + +line: + '\n' +| exp '\n' +| error '\n' +; + +exp: + NUM { $$ = $1; } +| exp '=' exp { - typedef std::list objects; - static objects instances; - char val; + 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; } +; - static bool - empty () - { - return instances.empty(); - } - static void - log (Object const *o, const std::string& msg) - { - if (debug) - { - if (o) - std::cerr << o << "->"; - std::cerr << msg << " {"; - const char* sep = " "; - for (objects::const_iterator i = instances.begin(), - i_end = instances.end(); - i != i_end; - ++i) - { - std::cerr << sep << *i; - sep = ", "; - } - std::cerr << " }" << std::endl; - } - } +%% +class CalcLexer implements Calc.Lexer { - Object (char v) - : val (v) - { - instances.push_back(this); - log (this, "Object::Object"); - } + StreamTokenizer st; - ~Object () - { - instances.remove(this); - log (this, "Object::~Object"); - } - }; -} + 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); + } -%code -{ - #include - #include // strchr - #include - int yylex (yy::parser::semantic_type *); - Object::objects Object::instances; - static char const *input; -} -%union -{ - Object *obj; -} -%initial-action -{ - if (strchr (input, 'i')) - throw std::runtime_error ("initial-action"); -} + public void yyerror (String s) + { + System.err.println (s); + } -%destructor { delete $$; } ; -%printer -{ - yyo << $$ << " '" << $$->val << '\''; - if ($$->val == 'p') - throw std::runtime_error ("printer"); -} ; -%token 'a' 'E' 'e' 'p' 'R' 's' 'T' -%type list item + Integer yylval; -%% + public Object getLVal() { + return yylval; + } -start: list { delete $1; }; + public int yylex () throws IOException { + int ttype = st.nextToken (); -list: - item { $$ = $1; } -| item list { $$ = $1; delete $2; } // Right recursion to load the stack. -; + if (ttype == st.TT_EOF) + return EOF; -item: - 'a' { $$ = $1; } -| 'e' { YYUSE ($$); YYUSE($1); error (location_type(), "syntax error"); } -// Not just 'E', otherwise we reduce when 'E' is the lookahead, and -// then the stack is emptied, defeating the point of the test. -| 'E' 'a' { YYUSE($1); $$ = $2; } -| 'R' { $$ = YY_NULL; delete $1; YYERROR; } -| 'p' { $$ = $1; } -| 's' { $$ = $1; throw std::runtime_error ("reduction"); } -| 'T' { $$ = YY_NULL; delete $1; YYABORT; } -| error { $$ = YY_NULL; yyerrok; } -; -%% + else if (ttype == st.TT_EOL) + { -int -yylex (yy::parser::semantic_type *lvalp) -{ - // 'a': no error. - // 'e': user action calls error. - // 'E': syntax error, with yyerror that throws. - // 'i': initial action throws. - // 'l': yylex throws. - // 'R': call YYERROR in the action - // 's': reduction throws. - // 'T': call YYABORT in the action - switch (int res = *input++) - { - case 'l': - throw std::runtime_error ("yylex"); - default: - lvalp->obj = new Object (res); - // Fall through. - case 0: - return res; + return (int) '\n'; + } + + else if (ttype == st.TT_WORD) + { + yylval = new Integer (st.sval); + return NUM; + } + + else + return st.ttype; } -} -/* A C++ error reporting function. */ -void -yy::parser::error (const location_type& l, const std::string& m) -{ - YYUSE (l); - throw std::runtime_error (m); + + } -int -main (int argc, const char *argv[]) -{ - switch (argc) + +class Position { + public int line; + public int token; + + public Position () { - case 2: - input = argv[1]; - break; - case 3: - assert (!strcmp (argv[1], "--debug")); - debug = 1; - input = argv[2]; - break; - default: - abort (); + line = 0; + token = 0; } - yy::parser parser; - debug |= !!getenv ("YYDEBUG"); - parser.set_debug_level (debug); - int res = 2; - try + public Position (int l, int t) { - res = parser.parse (); + line = l; + token = t; } - catch (const std::exception& e) + + public boolean equals (Position l) { - std::cerr << "exception caught: " << e.what () << std::endl; + return l.line == line && l.token == token; } - catch (...) + + public String toString () { - std::cerr << "unknown exception caught" << std::endl; + return Integer.toString (line) + "." + Integer.toString(token); + } + + public int lineno () + { + return line; + } + + public int token () + { + return token; } - Object::log (YY_NULL, "end"); - assert (Object::empty()); - return res; } + _ATEOF + + + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -o input.cc --report=all input.yy" -at_fn_check_prepare_notrace 'an embedded newline' "c++.at:382" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.cc --report=all input.yy +$as_echo "$at_srcdir/java.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:367" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:382" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/c++.at:382: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:382" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.cc --report=all input.yy +$as_echo "$at_srcdir/java.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:367" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:382" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/c++.at:382: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:382" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -151049,16 +190321,16 @@ at_status=$? at_failed=false $at_check_filter 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:382" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/c++.at:382: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:382" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -151067,7 +190339,7 @@ at_status=$? at_failed=false $at_check_filter 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:382" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151075,336 +190347,516 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/c++.at:382: bison -o input.cc --report=all input.yy" -at_fn_check_prepare_trace "c++.at:382" -( $at_check_trace; bison -o input.cc --report=all input.yy +$as_echo "$at_srcdir/java.at:367: bison -fno-caret -o Calc.java Calc.y" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; bison -fno-caret -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:382" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } +$as_echo "java.at:367" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:367" +$as_echo "java.at:367" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:367" { set +x -$as_echo "$at_srcdir/c++.at:383: \$BISON_CXX_WORKS" -at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:383" -( $at_check_trace; $BISON_CXX_WORKS +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:367" +( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:383" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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/c++.at:383: \$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:383" -( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:383" +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:367" $at_failed && at_fn_log_failure $at_traceon; } + +# Some syntax errors. +cat >input <<'_ATEOF' +0 0 +_ATEOF + { set +x -$as_echo "$at_srcdir/c++.at:385: \$PREPARSER ./input aaaas" -at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:385" -( $at_check_trace; $PREPARSER ./input aaaas +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/c++.at:385" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.2: 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/c++.at:385: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:385" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "exception caught: reduction -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:385" +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:367" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +1//2 +_ATEOF { set +x -$as_echo "$at_srcdir/c++.at:389: \$PREPARSER ./input aaaal" -at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:389" -( $at_check_trace; $PREPARSER ./input aaaal +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/c++.at:389" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.3: 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/c++.at:389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:389" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "exception caught: yylex -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:389" +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:367" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +error +_ATEOF { set +x -$as_echo "$at_srcdir/c++.at:393: \$PREPARSER ./input i" -at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:393" -( $at_check_trace; $PREPARSER ./input i +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/c++.at:393" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.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/c++.at:393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:393" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "exception caught: initial-action -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:393" +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:367" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +1 = 2 = 3 +_ATEOF { set +x -$as_echo "$at_srcdir/c++.at:397: \$PREPARSER ./input aaaap" -at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:397" -( $at_check_trace; $PREPARSER ./input aaaap +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:397" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.4: 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/c++.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:397" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:397" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' -{ set +x -$as_echo "$at_srcdir/c++.at:399: \$PREPARSER ./input --debug aaaap" -at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:399" -( $at_check_trace; $PREPARSER ./input --debug aaaap -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/c++.at:399" -$at_failed && at_fn_log_failure -$at_traceon; } ++1 +_ATEOF { set +x -$as_echo "$at_srcdir/c++.at:399: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:399" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:399" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.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/c++.at:400: grep '^exception caught: printer\$' stderr" -at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:400" -( $at_check_trace; grep '^exception caught: printer$' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:400" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } +# Exercise error messages with EOF: work on an empty file. { set +x -$as_echo "$at_srcdir/c++.at:402: \$PREPARSER ./input aaaae" -at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:402" -( $at_check_trace; $PREPARSER ./input aaaae +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < /dev/null" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/c++.at:402" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.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/c++.at:402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:402" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "exception caught: 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/c++.at:402" +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:367" $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/c++.at:406: \$PREPARSER ./input aaaaE" -at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:406" -( $at_check_trace; $PREPARSER ./input aaaaE +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/c++.at:406" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' +1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' +1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' +1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' +1.1-1.27: 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/c++.at:406: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:406" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "exception caught: syntax error, unexpected \$end, expecting 'a' -" | \ - $at_diff - "$at_stderr" || at_failed=: -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:406" +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:367" $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/c++.at:410: \$PREPARSER ./input aaaaT" -at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:410" -( $at_check_trace; $PREPARSER ./input aaaaT +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/c++.at:410" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.7: syntax error, unexpected number +1.1-1.10: 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/c++.at:410: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:410" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:410" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } +cat >input <<'_ATEOF' +(- *) + (0 0) = 1 +_ATEOF -# There is error-recovery, so exit success. { set +x -$as_echo "$at_srcdir/c++.at:413: \$PREPARSER ./input aaaaR" -at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:413" -( $at_check_trace; $PREPARSER ./input aaaaR +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/c++.at:413" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' +1.8: syntax error, unexpected number +1.1-1.11: 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/c++.at:413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "c++.at:413" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:413" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_306 -#AT_START_307 -at_fn_group_banner 307 'java.at:360' \ - "Calculator " " " 19 +#AT_STOP_446 +#AT_START_447 +at_fn_group_banner 447 'java.at:367' \ + "Calculator %locations " " " 21 at_xfail=no ( - $as_echo "307. $at_setup_line: testing $at_desc ..." + $as_echo "447. $at_setup_line: testing $at_desc ..." $at_traceon @@ -151415,10 +190867,10 @@ cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" -%define parser_class_name "Calc" +%define parser_class_name {Calc} %define public - +%locations %code { public static void main (String args[]) throws IOException @@ -151442,11 +190894,11 @@ cat >Calc.y <<'_ATEOF' %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -151466,7 +190918,7 @@ exp: | exp '=' exp { if ($1.intValue () != $3.intValue ()) - yyerror ( "calc: error: " + $1 + " != " + $3); + yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } @@ -151499,12 +190951,25 @@ class CalcLexer implements Calc.Lexer { } + Position yypos = new Position (1, 0); - public void yyerror (String s) - { - System.err.println (s); + public Position getStartPos() { + return yypos; + } + + public Position getEndPos() { + return yypos; + } + + public void yyerror (Calc.Location l, String s) +{ + if (l == null) + System.err.println (s); + else + System.err.println (l + ": " + s); } + Integer yylval; public Object getLVal() { @@ -151513,20 +190978,21 @@ class CalcLexer implements Calc.Lexer { public int yylex () throws IOException { int ttype = st.nextToken (); - + yypos = new Position (yypos.lineno (), + yypos.token () + 1); if (ttype == st.TT_EOF) - return Calc.EOF; + return EOF; else if (ttype == st.TT_EOL) { - + yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); - return Calc.NUM; + return NUM; } else @@ -151587,39 +191053,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:360" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:367" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:367" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:360" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -151628,16 +191094,16 @@ at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -151646,7 +191112,7 @@ at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151654,36 +191120,36 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y" -at_fn_check_prepare_trace "java.at:360" -( $at_check_trace; bison -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:367: bison -fno-caret -o Calc.java Calc.y" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; bison -fno-caret -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:360" >"$at_check_line_file" +$as_echo "java.at:367" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:360" -$as_echo "java.at:360" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:367" +$as_echo "java.at:367" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:360" + && at_fn_check_skip 77 "$at_srcdir/java.at:367" { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:367" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151706,15 +191172,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151726,15 +191192,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151747,22 +191213,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151772,15 +191237,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151793,22 +191258,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151818,15 +191282,15 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151839,22 +191303,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151864,15 +191327,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151885,22 +191348,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151911,15 +191373,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151932,37 +191394,36 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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:360: \$SHELL ../../../javaexec.sh Calc < /dev/null" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < /dev/null" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -151975,22 +191436,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152005,7 +191465,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -152017,15 +191477,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152042,22 +191502,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152070,15 +191529,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152092,22 +191551,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152117,15 +191575,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152140,22 +191598,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152166,13 +191623,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_307 -#AT_START_308 -at_fn_group_banner 308 'java.at:360' \ - "Calculator %error-verbose " " " 19 +#AT_STOP_447 +#AT_START_448 +at_fn_group_banner 448 'java.at:367' \ + "Calculator %error-verbose %locations " " " 21 at_xfail=no ( - $as_echo "308. $at_setup_line: testing $at_desc ..." + $as_echo "448. $at_setup_line: testing $at_desc ..." $at_traceon @@ -152183,10 +191640,10 @@ cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" -%define parser_class_name "Calc" +%define parser_class_name {Calc} %define public -%error-verbose +%error-verbose %locations %code { public static void main (String args[]) throws IOException @@ -152210,11 +191667,11 @@ cat >Calc.y <<'_ATEOF' %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -152234,7 +191691,7 @@ exp: | exp '=' exp { if ($1.intValue () != $3.intValue ()) - yyerror ( "calc: error: " + $1 + " != " + $3); + yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } @@ -152267,12 +191724,25 @@ class CalcLexer implements Calc.Lexer { } + Position yypos = new Position (1, 0); - public void yyerror (String s) - { - System.err.println (s); + public Position getStartPos() { + return yypos; } + public Position getEndPos() { + return yypos; + } + + public void yyerror (Calc.Location l, String s) +{ + if (l == null) + System.err.println (s); + else + System.err.println (l + ": " + s); + } + + Integer yylval; public Object getLVal() { @@ -152281,20 +191751,21 @@ class CalcLexer implements Calc.Lexer { public int yylex () throws IOException { int ttype = st.nextToken (); - + yypos = new Position (yypos.lineno (), + yypos.token () + 1); if (ttype == st.TT_EOF) - return Calc.EOF; + return EOF; else if (ttype == st.TT_EOL) { - + yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); - return Calc.NUM; + return NUM; } else @@ -152355,39 +191826,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:360" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:367" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:367" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:360" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -152396,16 +191867,16 @@ at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:367: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:367" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -152414,7 +191885,7 @@ at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152422,36 +191893,36 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y" -at_fn_check_prepare_trace "java.at:360" -( $at_check_trace; bison -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:367: bison -fno-caret -o Calc.java Calc.y" +at_fn_check_prepare_trace "java.at:367" +( $at_check_trace; bison -fno-caret -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:360" >"$at_check_line_file" +$as_echo "java.at:367" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:360" -$as_echo "java.at:360" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:367" +$as_echo "java.at:367" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:360" + && at_fn_check_skip 77 "$at_srcdir/java.at:367" { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:367" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152474,15 +191945,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152494,15 +191965,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152515,21 +191986,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152539,15 +192009,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152560,21 +192030,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152584,15 +192053,15 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152605,21 +192074,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152629,15 +192097,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152650,21 +192118,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152675,15 +192142,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152696,36 +192163,35 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $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:360: \$SHELL ../../../javaexec.sh Calc < /dev/null" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < /dev/null" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152738,21 +192204,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152767,7 +192232,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -152779,15 +192244,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152804,21 +192269,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152831,15 +192295,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152853,21 +192317,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152877,15 +192340,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:367: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:367" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152900,21 +192363,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:367: cat stderr" +at_fn_check_prepare_trace "java.at:367" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:367" $at_failed && at_fn_log_failure $at_traceon; } @@ -152925,13 +192387,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_308 -#AT_START_309 -at_fn_group_banner 309 'java.at:360' \ - "Calculator %locations " " " 19 +#AT_STOP_448 +#AT_START_449 +at_fn_group_banner 449 'java.at:374' \ + "Calculator %lex-param { InputStream is } " " " 21 at_xfail=no ( - $as_echo "309. $at_setup_line: testing $at_desc ..." + $as_echo "449. $at_setup_line: testing $at_desc ..." $at_traceon @@ -152942,17 +192404,15 @@ cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" -%define parser_class_name "Calc" +%define parser_class_name {Calc} %define public -%locations +%lex-param { InputStream is } %code { public static void main (String args[]) throws IOException { - CalcLexer l = new CalcLexer (System.in); - Calc p = new Calc (l); - p.parse (); + new Calc (System.in).parse (); } } @@ -152969,11 +192429,11 @@ cat >Calc.y <<'_ATEOF' %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -152993,7 +192453,7 @@ exp: | exp '=' exp { if ($1.intValue () != $3.intValue ()) - yyerror (@$, "calc: error: " + $1 + " != " + $3); + yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } @@ -153010,12 +192470,11 @@ exp: ; -%% -class CalcLexer implements Calc.Lexer { +%code lexer { StreamTokenizer st; - public CalcLexer (InputStream is) + public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); @@ -153026,22 +192485,10 @@ class CalcLexer implements Calc.Lexer { } - Position yypos = new Position (1, 0); - - public Position getStartPos() { - return yypos; - } - public Position getEndPos() { - return yypos; - } - - public void yyerror (Calc.Location l, String s) + public void yyerror (String s) { - if (l == null) - System.err.println (s); - else - System.err.println (l + ": " + s); + System.err.println (s); } @@ -153053,21 +192500,20 @@ class CalcLexer implements Calc.Lexer { public int yylex () throws IOException { int ttype = st.nextToken (); - yypos = new Position (yypos.lineno (), - yypos.token () + 1); + if (ttype == st.TT_EOF) - return Calc.EOF; + return EOF; else if (ttype == st.TT_EOL) { - yypos = new Position (yypos.lineno () + 1, 0); + return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); - return Calc.NUM; + return NUM; } else @@ -153076,7 +192522,8 @@ class CalcLexer implements Calc.Lexer { -} +}; +%% class Position { @@ -153128,39 +192575,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:360" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:374" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:374" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:374: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:360" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:374" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -153169,16 +192616,16 @@ at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:374: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:374" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -153187,7 +192634,7 @@ at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153195,36 +192642,36 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y" -at_fn_check_prepare_trace "java.at:360" -( $at_check_trace; bison -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: bison -fno-caret -o Calc.java Calc.y" +at_fn_check_prepare_trace "java.at:374" +( $at_check_trace; bison -fno-caret -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:360" >"$at_check_line_file" +$as_echo "java.at:374" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:360" -$as_echo "java.at:360" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:374" +$as_echo "java.at:374" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:360" + && at_fn_check_skip 77 "$at_srcdir/java.at:374" { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:374" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153247,15 +192694,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153267,15 +192714,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153288,21 +192735,22 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153312,15 +192760,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153333,21 +192781,22 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153357,15 +192806,15 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153378,21 +192827,22 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153402,15 +192852,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153423,21 +192873,22 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153448,15 +192899,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153469,36 +192920,37 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $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:360: \$SHELL ../../../javaexec.sh Calc < /dev/null" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < /dev/null" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153511,21 +192963,22 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153540,7 +192993,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -153552,15 +193005,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153577,21 +193030,22 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153604,15 +193058,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153626,21 +193080,22 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153650,15 +193105,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153673,21 +193128,22 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153698,13 +193154,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_309 -#AT_START_310 -at_fn_group_banner 310 'java.at:360' \ - "Calculator %error-verbose %locations " " " 19 +#AT_STOP_449 +#AT_START_450 +at_fn_group_banner 450 'java.at:374' \ + "Calculator %error-verbose %lex-param { InputStream is } " "" 21 at_xfail=no ( - $as_echo "310. $at_setup_line: testing $at_desc ..." + $as_echo "450. $at_setup_line: testing $at_desc ..." $at_traceon @@ -153715,17 +193171,15 @@ cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" -%define parser_class_name "Calc" +%define parser_class_name {Calc} %define public -%error-verbose %locations +%error-verbose %lex-param { InputStream is } %code { public static void main (String args[]) throws IOException { - CalcLexer l = new CalcLexer (System.in); - Calc p = new Calc (l); - p.parse (); + new Calc (System.in).parse (); } } @@ -153742,11 +193196,11 @@ cat >Calc.y <<'_ATEOF' %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -153766,7 +193220,7 @@ exp: | exp '=' exp { if ($1.intValue () != $3.intValue ()) - yyerror (@$, "calc: error: " + $1 + " != " + $3); + yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } @@ -153783,12 +193237,11 @@ exp: ; -%% -class CalcLexer implements Calc.Lexer { +%code lexer { StreamTokenizer st; - public CalcLexer (InputStream is) + public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); @@ -153799,22 +193252,10 @@ class CalcLexer implements Calc.Lexer { } - Position yypos = new Position (1, 0); - public Position getStartPos() { - return yypos; - } - - public Position getEndPos() { - return yypos; - } - - public void yyerror (Calc.Location l, String s) + public void yyerror (String s) { - if (l == null) - System.err.println (s); - else - System.err.println (l + ": " + s); + System.err.println (s); } @@ -153826,21 +193267,20 @@ class CalcLexer implements Calc.Lexer { public int yylex () throws IOException { int ttype = st.nextToken (); - yypos = new Position (yypos.lineno (), - yypos.token () + 1); + if (ttype == st.TT_EOF) - return Calc.EOF; + return EOF; else if (ttype == st.TT_EOL) { - yypos = new Position (yypos.lineno () + 1, 0); + return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); - return Calc.NUM; + return NUM; } else @@ -153849,7 +193289,8 @@ class CalcLexer implements Calc.Lexer { -} +}; +%% class Position { @@ -153901,39 +193342,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:360" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:374" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:374" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:374: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:360" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:374" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -153942,16 +193383,16 @@ at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:374: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:374" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -153960,7 +193401,7 @@ at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -153968,36 +193409,36 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:360: bison -o Calc.java Calc.y" -at_fn_check_prepare_trace "java.at:360" -( $at_check_trace; bison -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: bison -fno-caret -o Calc.java Calc.y" +at_fn_check_prepare_trace "java.at:374" +( $at_check_trace; bison -fno-caret -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:360" >"$at_check_line_file" +$as_echo "java.at:374" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:360" -$as_echo "java.at:360" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:374" +$as_echo "java.at:374" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:360" + && at_fn_check_skip 77 "$at_srcdir/java.at:374" { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:374" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154020,15 +193461,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154040,15 +193481,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154061,20 +193502,21 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154084,15 +193526,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154105,20 +193547,21 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154128,15 +193571,15 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154149,20 +193592,21 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154172,15 +193616,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154193,20 +193637,21 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154217,15 +193662,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154238,35 +193683,36 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $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:360: \$SHELL ../../../javaexec.sh Calc < /dev/null" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < /dev/null" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154279,20 +193725,21 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154307,7 +193754,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -154319,15 +193766,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154344,20 +193791,21 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154370,15 +193818,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154392,20 +193840,21 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154415,15 +193864,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154438,20 +193887,21 @@ cat >expout <<'_ATEOF' _ATEOF # 2. If locations are not used, remove them. - -# 3. If error-verbose is not used, strip the`, unexpected....' part. +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:360: cat stderr" -at_fn_check_prepare_trace "java.at:360" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:360" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154462,13 +193912,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_310 -#AT_START_311 -at_fn_group_banner 311 'java.at:369' \ - "Calculator %lex-param { InputStream is } " " " 19 +#AT_STOP_450 +#AT_START_451 +at_fn_group_banner 451 'java.at:374' \ + "Calculator %locations %lex-param { InputStream is } " "" 21 at_xfail=no ( - $as_echo "311. $at_setup_line: testing $at_desc ..." + $as_echo "451. $at_setup_line: testing $at_desc ..." $at_traceon @@ -154479,10 +193929,10 @@ cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" -%define parser_class_name "Calc" +%define parser_class_name {Calc} %define public -%lex-param { InputStream is } +%locations %lex-param { InputStream is } %code { public static void main (String args[]) throws IOException @@ -154504,11 +193954,11 @@ cat >Calc.y <<'_ATEOF' %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -154528,7 +193978,7 @@ exp: | exp '=' exp { if ($1.intValue () != $3.intValue ()) - yyerror ( "calc: error: " + $1 + " != " + $3); + yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } @@ -154560,12 +194010,25 @@ exp: } + Position yypos = new Position (1, 0); - public void yyerror (String s) - { - System.err.println (s); + public Position getStartPos() { + return yypos; + } + + public Position getEndPos() { + return yypos; + } + + public void yyerror (Calc.Location l, String s) +{ + if (l == null) + System.err.println (s); + else + System.err.println (l + ": " + s); } + Integer yylval; public Object getLVal() { @@ -154574,20 +194037,21 @@ exp: public int yylex () throws IOException { int ttype = st.nextToken (); - + yypos = new Position (yypos.lineno (), + yypos.token () + 1); if (ttype == st.TT_EOF) - return Calc.EOF; + return EOF; else if (ttype == st.TT_EOL) { - + yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); - return Calc.NUM; + return NUM; } else @@ -154649,39 +194113,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:369" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:374" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:374" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:374: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:369" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:374" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -154690,16 +194154,16 @@ at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:374: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:374" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -154708,7 +194172,7 @@ at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154716,36 +194180,36 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; bison -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: bison -fno-caret -o Calc.java Calc.y" +at_fn_check_prepare_trace "java.at:374" +( $at_check_trace; bison -fno-caret -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:369" >"$at_check_line_file" +$as_echo "java.at:374" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:369" -$as_echo "java.at:369" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:374" +$as_echo "java.at:374" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:369" + && at_fn_check_skip 77 "$at_srcdir/java.at:374" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:374" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154768,15 +194232,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154788,15 +194252,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154809,22 +194273,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154834,15 +194297,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154855,22 +194318,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154880,15 +194342,15 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154901,22 +194363,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154926,15 +194387,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154947,22 +194408,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154973,15 +194433,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -154994,37 +194454,36 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $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:369: \$SHELL ../../../javaexec.sh Calc < /dev/null" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < /dev/null" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155037,22 +194496,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155067,7 +194525,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -155079,15 +194537,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155104,22 +194562,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155132,15 +194589,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155154,22 +194611,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155179,15 +194635,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155202,22 +194658,21 @@ cat >expout <<'_ATEOF' _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. + +# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155228,13 +194683,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_311 -#AT_START_312 -at_fn_group_banner 312 'java.at:369' \ - "Calculator %error-verbose %lex-param { InputStream is } " "" 19 +#AT_STOP_451 +#AT_START_452 +at_fn_group_banner 452 'java.at:374' \ + "Calculator %error-verbose %locations %lex-param { InputStream is } " "" 21 at_xfail=no ( - $as_echo "312. $at_setup_line: testing $at_desc ..." + $as_echo "452. $at_setup_line: testing $at_desc ..." $at_traceon @@ -155245,10 +194700,10 @@ cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %name-prefix "Calc" -%define parser_class_name "Calc" +%define parser_class_name {Calc} %define public -%error-verbose %lex-param { InputStream is } +%error-verbose %locations %lex-param { InputStream is } %code { public static void main (String args[]) throws IOException @@ -155270,11 +194725,11 @@ cat >Calc.y <<'_ATEOF' %token NUM "number" %type exp -%nonassoc '=' /* comparison */ +%nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%precedence NEG /* negation--unary minus */ +%right '^' /* exponentiation */ /* Grammar follows */ %% @@ -155294,7 +194749,7 @@ exp: | exp '=' exp { if ($1.intValue () != $3.intValue ()) - yyerror ( "calc: error: " + $1 + " != " + $3); + yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } @@ -155326,12 +194781,25 @@ exp: } + Position yypos = new Position (1, 0); - public void yyerror (String s) - { - System.err.println (s); + public Position getStartPos() { + return yypos; } + public Position getEndPos() { + return yypos; + } + + public void yyerror (Calc.Location l, String s) +{ + if (l == null) + System.err.println (s); + else + System.err.println (l + ": " + s); + } + + Integer yylval; public Object getLVal() { @@ -155340,20 +194808,21 @@ exp: public int yylex () throws IOException { int ttype = st.nextToken (); - + yypos = new Position (yypos.lineno (), + yypos.token () + 1); if (ttype == st.TT_EOF) - return Calc.EOF; + return EOF; else if (ttype == st.TT_EOL) { - + yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); - return Calc.NUM; + return NUM; } else @@ -155415,39 +194884,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:369" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:374" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:374" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:374: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:369" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:374" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -155456,16 +194925,16 @@ at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:374: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:374" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -155474,7 +194943,7 @@ at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155482,36 +194951,36 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; bison -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:374: bison -fno-caret -o Calc.java Calc.y" +at_fn_check_prepare_trace "java.at:374" +( $at_check_trace; bison -fno-caret -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:369" >"$at_check_line_file" +$as_echo "java.at:374" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:369" -$as_echo "java.at:369" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:374" +$as_echo "java.at:374" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:369" + && at_fn_check_skip 77 "$at_srcdir/java.at:374" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:374" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155534,15 +195003,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155554,15 +195023,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155575,21 +195044,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155599,15 +195067,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155620,21 +195088,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155644,15 +195111,15 @@ error _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155665,21 +195132,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155689,15 +195155,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155710,21 +195176,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155735,15 +195200,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155756,36 +195221,35 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $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:369: \$SHELL ../../../javaexec.sh Calc < /dev/null" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < /dev/null" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155798,21 +195262,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155827,7 +195290,7 @@ $at_traceon; } # - (* * *): nothing to pop, a lot to discard # - (1 + 2 * *): some to pop and discard # -# - test the action associated to `error' +# - 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 @@ -155839,15 +195302,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155864,21 +195327,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155891,15 +195353,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155913,21 +195375,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155937,15 +195398,15 @@ cat >input <<'_ATEOF' _ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" +$as_echo "$at_srcdir/java.at:374: \$SHELL ../../../javaexec.sh Calc < input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:374" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155960,21 +195421,20 @@ cat >expout <<'_ATEOF' _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. + +# 3. If error-verbose is not used, strip the', unexpected....' part. # 4. Check { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" +$as_echo "$at_srcdir/java.at:374: cat stderr" +at_fn_check_prepare_trace "java.at:374" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:374" $at_failed && at_fn_log_failure $at_traceon; } @@ -155985,240 +195445,375 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_312 -#AT_START_313 -at_fn_group_banner 313 'java.at:369' \ - "Calculator %locations %lex-param { InputStream is } " "" 19 +#AT_STOP_452 +#AT_START_453 +at_fn_group_banner 453 'java.at:455' \ + "Java parser class and package names" " " 22 at_xfail=no ( - $as_echo "313. $at_setup_line: testing $at_desc ..." + $as_echo "453. $at_setup_line: testing $at_desc ..." $at_traceon +cat >YYParser.y <<'_ATEOF' - -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 NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ +%locations +%debug +%error-verbose +%token-table +%token END "end" -/* Grammar follows */ %% -input: - line -| input line -; +start: END {}; +%% +class Position {} +_ATEOF -line: - '\n' -| exp '\n' -| error '\n' -; +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:457" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:457" +$at_failed && at_fn_log_failure +$at_traceon; } -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; } -; + { set +x +$as_echo "$at_srcdir/java.at:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:457" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:457" +$at_failed && at_fn_log_failure +$at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:457" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:457" +$at_failed && at_fn_log_failure +$at_traceon; } -%code lexer { + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:457" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:457" +$at_failed && at_fn_log_failure +$at_traceon; } - StreamTokenizer st; + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/java.at:457: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:457" +( $at_check_trace; bison -fno-caret YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:457" +$at_failed && at_fn_log_failure +$at_traceon; } - 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); - } +{ set +x +$as_echo "$at_srcdir/java.at:457: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:457" +( $at_check_trace; grep '[mb]4_' YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:457" +$at_failed && at_fn_log_failure +$at_traceon; } - Position yypos = new Position (1, 0); - public Position getStartPos() { - return yypos; - } +$as_echo "java.at:457" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:457" +$as_echo "java.at:457" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:457" +{ set +x +$as_echo "$at_srcdir/java.at:457: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:457" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:457" +$at_failed && at_fn_log_failure +$at_traceon; } - public Position getEndPos() { - return yypos; - } - public void yyerror (Calc.Location l, String s) - { - if (l == null) - System.err.println (s); - else - System.err.println (l + ": " + s); - } +{ set +x +$as_echo "$at_srcdir/java.at:458: grep -c '^class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^class YYParser$' YYParser.java" "java.at:458" +( $at_check_trace; grep -c '^class YYParser$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:458" +$at_failed && at_fn_log_failure +$at_traceon; } - Integer yylval; - public Object getLVal() { - return yylval; - } +cat >YYParser.y <<'_ATEOF' - public int yylex () throws IOException { - int ttype = st.nextToken (); - yypos = new Position (yypos.lineno (), - yypos.token () + 1); - if (ttype == st.TT_EOF) - return Calc.EOF; +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" +%name-prefix "Prefix" +%% +start: END {}; +%% +class Position {} +_ATEOF - else if (ttype == st.TT_EOL) - { - yypos = new Position (yypos.lineno () + 1, 0); - return (int) '\n'; - } +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:460" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:460" +$at_failed && at_fn_log_failure +$at_traceon; } - else if (ttype == st.TT_WORD) - { - yylval = new Integer (st.sval); - return Calc.NUM; - } + { set +x +$as_echo "$at_srcdir/java.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:460" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:460" +$at_failed && at_fn_log_failure +$at_traceon; } - else - return st.ttype; - } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.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' "java.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:460" +$at_failed && at_fn_log_failure +$at_traceon; } + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:460" +$at_failed && at_fn_log_failure +$at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/java.at:460: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:460" +( $at_check_trace; bison -fno-caret YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:460" +$at_failed && at_fn_log_failure +$at_traceon; } -}; -%% +{ set +x +$as_echo "$at_srcdir/java.at:460: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:460" +( $at_check_trace; grep '[mb]4_' YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:460" +$at_failed && at_fn_log_failure +$at_traceon; } -class Position { - public int line; - public int token; - public Position () - { - line = 0; - token = 0; - } +$as_echo "java.at:460" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:460" +$as_echo "java.at:460" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:460" +{ set +x +$as_echo "$at_srcdir/java.at:460: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:460" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:460" +$at_failed && at_fn_log_failure +$at_traceon; } - public Position (int l, int t) - { - line = l; - token = t; - } - public boolean equals (Position l) - { - return l.line == line && l.token == token; - } +{ set +x +$as_echo "$at_srcdir/java.at:461: grep -c '^class PrefixParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^class PrefixParser$' YYParser.java" "java.at:461" +( $at_check_trace; grep -c '^class PrefixParser$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:461" +$at_failed && at_fn_log_failure +$at_traceon; } - public String toString () - { - return Integer.toString (line) + "." + Integer.toString(token); - } - public int lineno () - { - return line; - } - public int token () - { - return token; - } -} +cat >YYParser.y <<'_ATEOF' +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" +%define api.token.prefix {TOK_} +%% +start: END {}; +%% +class Position {} _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:369" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:463" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:463" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:369" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -156227,16 +195822,16 @@ at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -156245,7 +195840,7 @@ at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } @@ -156253,743 +195848,746 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; bison -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:463: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:463" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:463: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:463" +( $at_check_trace; grep '[mb]4_' YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:463" +$at_failed && at_fn_log_failure +$at_traceon; } -$as_echo "java.at:369" >"$at_check_line_file" + +$as_echo "java.at:463" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:369" -$as_echo "java.at:369" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:463" +$as_echo "java.at:463" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:369" + && at_fn_check_skip 77 "$at_srcdir/java.at:463" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369" -( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java +$as_echo "$at_srcdir/java.at:463: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:463" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:463" $at_failed && at_fn_log_failure $at_traceon; } -# Test the priorities. -cat >input <<'_ATEOF' -1 + 2 * 3 = 7 -1 + 2 * -3 = -5 +{ set +x +$as_echo "$at_srcdir/java.at:464: grep -c '^.*TOK_END.*\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^.*TOK_END.*$' YYParser.java" "java.at:464" +( $at_check_trace; grep -c '^.*TOK_END.*$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:464" +$at_failed && at_fn_log_failure +$at_traceon; } --1^2 = -1 -(-1)^2 = 1 ----1 = -1 -1 - 2 - 3 = -4 -1 - (2 - 3) = 2 +cat >YYParser.y <<'_ATEOF' -2^2^3 = 256 -(2^2)^3 = 64 +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" +%define parser_class_name {ParserClassName} +%% +start: END {}; +%% +class Position {} _ATEOF -{ set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:466" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/java.at:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:466" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:466" +$at_failed && at_fn_log_failure +$at_traceon; } + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:466" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:466" +$at_failed && at_fn_log_failure +$at_traceon; } -# Some syntax errors. -cat >input <<'_ATEOF' -0 0 -_ATEOF + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:466" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:466" +$at_failed && at_fn_log_failure +$at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:466: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:466" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $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.2: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:466: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:466" +( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:466" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -1//2 -_ATEOF - +$as_echo "java.at:466" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:466" +$as_echo "java.at:466" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:466" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:466: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:466" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:466" $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.3: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:467: grep -c '^class ParserClassName\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^class ParserClassName$' YYParser.java" "java.at:467" +( $at_check_trace; grep -c '^class ParserClassName$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:467" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -error + +cat >YYParser.y <<'_ATEOF' + +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" +%define package {user_java_package} +%% +start: END {}; +%% +class Position {} _ATEOF -{ set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:469: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:469" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:469" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/java.at:469: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:469" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:469" +$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.1: syntax error, unexpected $undefined -_ATEOF - -# 2. If locations are not used, remove them. + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.at:469: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:469" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:469" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.at:469: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:469" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:469" $at_failed && at_fn_log_failure $at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi +{ set +x +$as_echo "$at_srcdir/java.at:469: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:469" +( $at_check_trace; bison -fno-caret YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:469" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -1 = 2 = 3 -_ATEOF { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:469: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:469" +( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:469" $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.4: syntax error, unexpected '=' -_ATEOF +$as_echo "java.at:469" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:469" +$as_echo "java.at:469" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:469" +{ set +x +$as_echo "$at_srcdir/java.at:469: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:469" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:469" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:470: grep -c '^package user_java_package;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^package user_java_package;$' YYParser.java" "java.at:470" +( $at_check_trace; grep -c '^package user_java_package;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:470" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_453 +#AT_START_454 +at_fn_group_banner 454 'java.at:479' \ + "Java parser class modifiers" " " 22 +at_xfail=no +( + $as_echo "454. $at_setup_line: testing $at_desc ..." + $at_traceon -+1 + + +cat >YYParser.y <<'_ATEOF' + +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" +%define abstract +%% +start: END {}; +%% +class Position {} _ATEOF -{ set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:481" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:481" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/java.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:481" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:481" +$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.1: syntax error, unexpected '+' -_ATEOF + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:481" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:481" +$at_failed && at_fn_log_failure +$at_traceon; } -# 2. If locations are not used, remove them. + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:481" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:481" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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 + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/java.at:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:481: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:481" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:481" $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:369: \$SHELL ../../../javaexec.sh Calc < /dev/null" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null +$as_echo "$at_srcdir/java.at:481: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:481" +( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:481" $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.1: syntax error, unexpected end of input -_ATEOF +$as_echo "java.at:481" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:481" +$as_echo "java.at:481" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:481" +{ set +x +$as_echo "$at_srcdir/java.at:481: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:481" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:481" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:482: grep -c '^abstract class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^abstract class YYParser$' YYParser.java" "java.at:482" +( $at_check_trace; grep -c '^abstract class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:482" $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 +cat >YYParser.y <<'_ATEOF' + +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" +%define final +%% +start: END {}; +%% +class Position {} _ATEOF -{ set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:484" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/java.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:484" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:484" +$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.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' -1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' -1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' -1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' -1.1-1.27: calc: error: 4444 != 1 -_ATEOF - -# 2. If locations are not used, remove them. + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:484" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:484" +$at_failed && at_fn_log_failure +$at_traceon; } -# 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:484" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $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 - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:484: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:484" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $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.7: syntax error, unexpected number -1.1-1.10: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:484: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:484" +( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -(- *) + (0 0) = 1 -_ATEOF - +$as_echo "java.at:484" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:484" +$as_echo "java.at:484" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:484" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:484: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:484" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $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.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' -1.8: syntax error, unexpected number -1.1-1.11: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:485: grep -c '^final class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^final class YYParser$' YYParser.java" "java.at:485" +( $at_check_trace; grep -c '^final class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:485" $at_failed && at_fn_log_failure $at_traceon; } +cat >YYParser.y <<'_ATEOF' - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_313 -#AT_START_314 -at_fn_group_banner 314 'java.at:369' \ - "Calculator %error-verbose %locations %lex-param { InputStream is } " "" 19 -at_xfail=no -( - $as_echo "314. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - - -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 NUM "number" -%type exp - -%nonassoc '=' /* comparison */ -%left '-' '+' -%left '*' '/' -%left NEG /* negation--unary minus */ -%right '^' /* exponentiation */ - -/* Grammar follows */ +%locations +%debug +%error-verbose +%token-table +%token END "end" +%define strictfp %% -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 yypos = new Position (1, 0); - - public Position getStartPos() { - return yypos; - } - - public Position getEndPos() { - return yypos; - } - - public void yyerror (Calc.Location l, String s) - { - if (l == null) - System.err.println (s); - else - System.err.println (l + ": " + s); - } - - - Integer yylval; - - public Object getLVal() { - return yylval; - } - - public int yylex () throws IOException { - int ttype = st.nextToken (); - yypos = new Position (yypos.lineno (), - yypos.token () + 1); - if (ttype == st.TT_EOF) - return Calc.EOF; - - else if (ttype == st.TT_EOL) - { - yypos = new Position (yypos.lineno () + 1, 0); - return (int) '\n'; - } - - else if (ttype == st.TT_WORD) - { - yylval = new Integer (st.sval); - return Calc.NUM; - } - - else - return st.ttype; - } - - - -}; +start: END {}; %% - - -class Position { - public int line; - public int token; - - public Position () - { - line = 0; - token = 0; - } - - public Position (int l, int t) - { - line = l; - token = t; - } - - public boolean equals (Position l) - { - return l.line == line && l.token == token; - } - - public String toString () - { - return Integer.toString (line) + "." + Integer.toString(token); - } - - public int lineno () - { - return line; - } - - public int token () - { - return token; - } -} - +class Position {} _ATEOF - - - - if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:369" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:487" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:487" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:369" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -156998,16 +196596,16 @@ at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -157016,7 +196614,7 @@ at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } @@ -157024,511 +196622,530 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:369: bison -o Calc.java Calc.y" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; bison -o Calc.java Calc.y +$as_echo "$at_srcdir/java.at:487: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:487" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:487: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:487" +( $at_check_trace; grep '[mb]4_' YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:487" +$at_failed && at_fn_log_failure +$at_traceon; } + -$as_echo "java.at:369" >"$at_check_line_file" +$as_echo "java.at:487" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:369" -$as_echo "java.at:369" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:487" +$as_echo "java.at:487" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:369" + && at_fn_check_skip 77 "$at_srcdir/java.at:487" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369" -( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java +$as_echo "$at_srcdir/java.at:487: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:487" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $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:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:488: grep -c '^strictfp class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^strictfp class YYParser$' YYParser.java" "java.at:488" +( $at_check_trace; grep -c '^strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:488" $at_failed && at_fn_log_failure $at_traceon; } -# Some syntax errors. -cat >input <<'_ATEOF' -0 0 +cat >YYParser.y <<'_ATEOF' + +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" + +%define abstract +%define strictfp +%% +start: END {}; +%% +class Position {} _ATEOF -{ set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:492" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/java.at:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:492" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:492" +$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.2: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:492" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:492" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:492" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' -1//2 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:492: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:492" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $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.3: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:492: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:492" +( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:492" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -error -_ATEOF - +$as_echo "java.at:492" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:492" +$as_echo "java.at:492" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:492" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:492: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:492" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:492" $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.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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:493: grep -c '^abstract strictfp class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^abstract strictfp class YYParser$' YYParser.java" "java.at:493" +( $at_check_trace; grep -c '^abstract strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:493" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -1 = 2 = 3 + +cat >YYParser.y <<'_ATEOF' + +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" + +%define final +%define strictfp +%% +start: END {}; +%% +class Position {} _ATEOF -{ set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:497" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/java.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:497" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:497" +$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.4: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:497" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:497" +$at_failed && at_fn_log_failure +$at_traceon; } -cat >input <<'_ATEOF' - -+1 -_ATEOF - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:497: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:497" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $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.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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:497: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:497" +( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:497" $at_failed && at_fn_log_failure $at_traceon; } -# Exercise error messages with EOF: work on an empty file. +$as_echo "java.at:497" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:497" +$as_echo "java.at:497" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:497" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < /dev/null" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < /dev/null +$as_echo "$at_srcdir/java.at:497: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:497" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:497" $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.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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:498: grep -c '^final strictfp class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^final strictfp class YYParser$' YYParser.java" "java.at:498" +( $at_check_trace; grep -c '^final strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:498" $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 +cat >YYParser.y <<'_ATEOF' + +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" +%define public +%% +start: END {}; +%% +class Position {} _ATEOF -{ set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:500" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } + { set +x +$as_echo "$at_srcdir/java.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:500" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:500" +$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.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!' -1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!' -1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!' -1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!' -1.1-1.27: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:500" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:500" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:500" +$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 - + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:500: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:500" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo stderr:; tee stderr <"$at_stderr" +at_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:369" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $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.7: syntax error, unexpected number -1.1-1.10: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:500: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:500" +( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:500" $at_failed && at_fn_log_failure $at_traceon; } -cat >input <<'_ATEOF' -(- *) + (0 0) = 1 -_ATEOF - +$as_echo "java.at:500" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:500" +$as_echo "java.at:500" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:500" { set +x -$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javaexec.sh Calc < input" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369" -( $at_check_trace; $SHELL ../../../javaexec.sh Calc < input +$as_echo "$at_srcdir/java.at:500: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:500" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:369" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:500" $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.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!' -1.8: syntax error, unexpected number -1.1-1.11: 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:369: cat stderr" -at_fn_check_prepare_trace "java.at:369" -( $at_check_trace; cat stderr +$as_echo "$at_srcdir/java.at:501: grep -c '^public class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^public class YYParser$' YYParser.java" "java.at:501" +( $at_check_trace; grep -c '^public class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:501" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_314 -#AT_START_315 -at_fn_group_banner 315 'java.at:455' \ - "Java parser class and package names" " " 20 -at_xfail=no -( - $as_echo "315. $at_setup_line: testing $at_desc ..." - $at_traceon - - - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -157536,9 +197153,12 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" +%define public +%define abstract %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -157549,39 +197169,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:457" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:505" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:457" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:457" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:505" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:457" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:505: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:457" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:505" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -157590,16 +197210,16 @@ at_status=$? at_failed=false $at_check_filter 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:457" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:505: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:457" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:505" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -157608,7 +197228,7 @@ at_status=$? at_failed=false $at_check_filter 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:457" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } @@ -157616,57 +197236,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:457: bison YYParser.y" -at_fn_check_prepare_trace "java.at:457" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:505: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:505" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:457" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:457: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:457" +$as_echo "$at_srcdir/java.at:505: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:505" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:457" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:457" >"$at_check_line_file" +$as_echo "java.at:505" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:457" -$as_echo "java.at:457" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:505" +$as_echo "java.at:505" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:457" + && at_fn_check_skip 77 "$at_srcdir/java.at:505" { set +x -$as_echo "$at_srcdir/java.at:457: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:457" +$as_echo "$at_srcdir/java.at:505: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:505" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:457" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:505" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:458: grep -c '^class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^class YYParser$' YYParser.java" "java.at:458" -( $at_check_trace; grep -c '^class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:506: grep -c '^public abstract class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^public abstract class YYParser$' YYParser.java" "java.at:506" +( $at_check_trace; grep -c '^public abstract class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -157674,13 +197294,12 @@ 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:458" +at_fn_check_skip $at_status "$at_srcdir/java.at:506" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -157688,9 +197307,12 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table -%name-prefix "Prefix" +%token END "end" + +%define public +%define final %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -157701,39 +197323,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:460" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:510" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:460" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:460" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:510" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:460" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:460: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:510: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:460" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:510" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -157742,16 +197364,16 @@ at_status=$? at_failed=false $at_check_filter 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:460" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:460: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:510: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:460" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:510" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -157760,7 +197382,7 @@ at_status=$? at_failed=false $at_check_filter 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:460" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } @@ -157768,57 +197390,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:460: bison YYParser.y" -at_fn_check_prepare_trace "java.at:460" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:510: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:510" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:460" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:460: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:460" +$as_echo "$at_srcdir/java.at:510: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:510" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:460" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:460" >"$at_check_line_file" +$as_echo "java.at:510" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:460" -$as_echo "java.at:460" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:510" +$as_echo "java.at:510" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:460" + && at_fn_check_skip 77 "$at_srcdir/java.at:510" { set +x -$as_echo "$at_srcdir/java.at:460: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:460" +$as_echo "$at_srcdir/java.at:510: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:510" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:460" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:510" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:461: grep -c '^class PrefixParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^class PrefixParser$' YYParser.java" "java.at:461" -( $at_check_trace; grep -c '^class PrefixParser$' YYParser.java +$as_echo "$at_srcdir/java.at:511: grep -c '^public final class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^public final class YYParser$' YYParser.java" "java.at:511" +( $at_check_trace; grep -c '^public final class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -157826,13 +197448,12 @@ 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:461" +at_fn_check_skip $at_status "$at_srcdir/java.at:511" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -157840,9 +197461,12 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table -%define parser_class_name "ParserClassName" +%token END "end" + +%define public +%define strictfp %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -157853,39 +197477,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:463" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:515" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:463" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:463" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:515" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:463" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:463" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -157894,16 +197518,16 @@ at_status=$? at_failed=false $at_check_filter 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:463" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -157912,7 +197536,7 @@ at_status=$? at_failed=false $at_check_filter 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:463" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } @@ -157920,57 +197544,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:463: bison YYParser.y" -at_fn_check_prepare_trace "java.at:463" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:515: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:515" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:463" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:463: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:463" +$as_echo "$at_srcdir/java.at:515: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:515" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:463" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:463" >"$at_check_line_file" +$as_echo "java.at:515" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:463" -$as_echo "java.at:463" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:515" +$as_echo "java.at:515" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:463" + && at_fn_check_skip 77 "$at_srcdir/java.at:515" { set +x -$as_echo "$at_srcdir/java.at:463: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:463" +$as_echo "$at_srcdir/java.at:515: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:515" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:463" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:464: grep -c '^class ParserClassName\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^class ParserClassName$' YYParser.java" "java.at:464" -( $at_check_trace; grep -c '^class ParserClassName$' YYParser.java +$as_echo "$at_srcdir/java.at:516: grep -c '^public strictfp class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^public strictfp class YYParser$' YYParser.java" "java.at:516" +( $at_check_trace; grep -c '^public strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -157978,13 +197602,12 @@ 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:464" +at_fn_check_skip $at_status "$at_srcdir/java.at:516" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -157992,9 +197615,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table -%define package "user_java_package" +%token END "end" + +%define public +%define abstract +%define strictfp %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -158005,39 +197632,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:466" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:521" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:466" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:466" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:521" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:466" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:521: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:466" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:521" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -158046,16 +197673,16 @@ at_status=$? at_failed=false $at_check_filter 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:466" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:521: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:466" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:521" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -158064,7 +197691,7 @@ at_status=$? at_failed=false $at_check_filter 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:466" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } @@ -158072,57 +197699,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:466: bison YYParser.y" -at_fn_check_prepare_trace "java.at:466" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:521: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:521" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:466" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:466: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:466" +$as_echo "$at_srcdir/java.at:521: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:521" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:466" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:466" >"$at_check_line_file" +$as_echo "java.at:521" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:466" -$as_echo "java.at:466" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:521" +$as_echo "java.at:521" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:466" + && at_fn_check_skip 77 "$at_srcdir/java.at:521" { set +x -$as_echo "$at_srcdir/java.at:466: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:466" +$as_echo "$at_srcdir/java.at:521: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:521" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:466" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:467: grep -c '^package user_java_package;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^package user_java_package;$' YYParser.java" "java.at:467" -( $at_check_trace; grep -c '^package user_java_package;$' YYParser.java +$as_echo "$at_srcdir/java.at:522: 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:522" +( $at_check_trace; grep -c '^public abstract strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -158130,27 +197757,12 @@ 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:467" +at_fn_check_skip $at_status "$at_srcdir/java.at:522" $at_failed && at_fn_log_failure $at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_315 -#AT_START_316 -at_fn_group_banner 316 'java.at:476' \ - "Java parser class modifiers" " " 20 -at_xfail=no -( - $as_echo "316. $at_setup_line: testing $at_desc ..." - $at_traceon - - - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -158158,9 +197770,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table -%define abstract +%token END "end" + +%define public +%define final +%define strictfp %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -158171,39 +197787,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:478" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:527" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:478" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:527" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:478" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:527" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:478" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:527" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:478: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:527: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:478" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:527" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -158212,16 +197828,16 @@ at_status=$? at_failed=false $at_check_filter 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:478" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:527" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:478: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:527: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:478" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:527" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -158230,7 +197846,7 @@ at_status=$? at_failed=false $at_check_filter 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:478" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:527" $at_failed && at_fn_log_failure $at_traceon; } @@ -158238,57 +197854,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:478: bison YYParser.y" -at_fn_check_prepare_trace "java.at:478" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:527: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:527" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:478" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:527" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:478: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:478" +$as_echo "$at_srcdir/java.at:527: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:527" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:478" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:527" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:478" >"$at_check_line_file" +$as_echo "java.at:527" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:478" -$as_echo "java.at:478" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:527" +$as_echo "java.at:527" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:478" + && at_fn_check_skip 77 "$at_srcdir/java.at:527" { set +x -$as_echo "$at_srcdir/java.at:478: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:478" +$as_echo "$at_srcdir/java.at:527: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:527" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:478" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:527" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:479: grep -c '^abstract class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^abstract class YYParser$' YYParser.java" "java.at:479" -( $at_check_trace; grep -c '^abstract class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:528: 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:528" +( $at_check_trace; grep -c '^public final strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -158296,12 +197912,12 @@ 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:479" +at_fn_check_skip $at_status "$at_srcdir/java.at:528" $at_failed && at_fn_log_failure $at_traceon; } - +# FIXME: Can't do a Java compile because javacomp.sh is configured for 1.3 cat >YYParser.y <<'_ATEOF' @@ -158310,9 +197926,12 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table -%define final +%token END "end" + +%define annotations {/*@Deprecated @SupressWarnings("unchecked") @SupressWarnings({"unchecked", "deprecation"}) @SupressWarnings(value={"unchecked", "deprecation"})*/} +%define public %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -158323,39 +197942,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:481" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:533: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:533" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:481" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:481" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:533: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:533" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:481" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:533" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:533: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:481" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:533" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -158364,16 +197983,16 @@ at_status=$? at_failed=false $at_check_filter 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:481" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:533" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:533: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:481" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:533" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -158382,7 +198001,7 @@ at_status=$? at_failed=false $at_check_filter 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:481" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:533" $at_failed && at_fn_log_failure $at_traceon; } @@ -158390,57 +198009,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:481: bison YYParser.y" -at_fn_check_prepare_trace "java.at:481" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:533: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:533" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:481" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:481: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:481" +$as_echo "$at_srcdir/java.at:533: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:533" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:481" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:533" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:481" >"$at_check_line_file" +$as_echo "java.at:533" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:481" -$as_echo "java.at:481" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:533" +$as_echo "java.at:533" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:481" + && at_fn_check_skip 77 "$at_srcdir/java.at:533" { set +x -$as_echo "$at_srcdir/java.at:481: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:481" +$as_echo "$at_srcdir/java.at:533: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:533" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:481" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:482: grep -c '^final class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^final class YYParser$' YYParser.java" "java.at:482" -( $at_check_trace; grep -c '^final class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:534: grep -c '^/\\*@Deprecated @SupressWarnings(\"unchecked\") @SupressWarnings({\"unchecked\", \"deprecation\"}) @SupressWarnings(value={\"unchecked\", \"deprecation\"})\\*/ public class YYParser\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^/\\*@Deprecated @SupressWarnings(\"unchecked\") @SupressWarnings({\"unchecked\", \"deprecation\"}) @SupressWarnings(value={\"unchecked\", \"deprecation\"})\\*/ public class YYParser$' YYParser.java" "java.at:534" +( $at_check_trace; grep -c '^/\*@Deprecated @SupressWarnings("unchecked") @SupressWarnings({"unchecked", "deprecation"}) @SupressWarnings(value={"unchecked", "deprecation"})\*/ public class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -158448,11 +198067,24 @@ 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:482" +at_fn_check_skip $at_status "$at_srcdir/java.at:534" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_454 +#AT_START_455 +at_fn_group_banner 455 'java.at:543' \ + "Java parser class extends and implements" " " 22 +at_xfail=no +( + $as_echo "455. $at_setup_line: testing $at_desc ..." + $at_traceon + cat >YYParser.y <<'_ATEOF' @@ -158462,9 +198094,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table -%define strictfp +%token END "end" +%define extends {Thread} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -158475,39 +198108,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:484" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:484" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:545" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:484" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:484" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:545" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:545: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:484" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:545" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -158516,16 +198149,16 @@ at_status=$? at_failed=false $at_check_filter 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:484" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:545" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:545: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:484" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:545" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -158534,7 +198167,7 @@ at_status=$? at_failed=false $at_check_filter 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:484" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:545" $at_failed && at_fn_log_failure $at_traceon; } @@ -158542,57 +198175,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:484: bison YYParser.y" -at_fn_check_prepare_trace "java.at:484" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:545: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:545" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:484" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:545" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:484: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:484" +$as_echo "$at_srcdir/java.at:545: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:545" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:484" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:545" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:484" >"$at_check_line_file" +$as_echo "java.at:545" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:484" -$as_echo "java.at:484" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:545" +$as_echo "java.at:545" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:484" + && at_fn_check_skip 77 "$at_srcdir/java.at:545" { set +x -$as_echo "$at_srcdir/java.at:484: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:484" +$as_echo "$at_srcdir/java.at:545: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:545" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:484" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:545" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:485: grep -c '^strictfp class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^strictfp class YYParser$' YYParser.java" "java.at:485" -( $at_check_trace; grep -c '^strictfp class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:546: grep -c '^class YYParser extends Thread\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread$' YYParser.java" "java.at:546" +( $at_check_trace; grep -c '^class YYParser extends Thread$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -158600,13 +198233,12 @@ 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:485" +at_fn_check_skip $at_status "$at_srcdir/java.at:546" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -158614,11 +198246,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table - -%define abstract -%define strictfp +%token END "end" +%define implements {Cloneable} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -158629,39 +198260,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:487" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:548" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:487" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:548" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:487" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:548" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:487" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:548" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:548: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:487" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:548" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -158670,16 +198301,16 @@ at_status=$? at_failed=false $at_check_filter 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:487" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:548" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:548: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:548" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -158688,7 +198319,7 @@ at_status=$? at_failed=false $at_check_filter 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:487" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:548" $at_failed && at_fn_log_failure $at_traceon; } @@ -158696,57 +198327,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:487: bison YYParser.y" -at_fn_check_prepare_trace "java.at:487" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:548: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:548" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:487" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:548" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:487: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:487" +$as_echo "$at_srcdir/java.at:548: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:548" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:487" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:548" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:487" >"$at_check_line_file" +$as_echo "java.at:548" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:487" -$as_echo "java.at:487" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:548" +$as_echo "java.at:548" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:487" + && at_fn_check_skip 77 "$at_srcdir/java.at:548" { set +x -$as_echo "$at_srcdir/java.at:487: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:487" +$as_echo "$at_srcdir/java.at:548: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:548" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:487" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:548" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:490: grep -c '^abstract strictfp class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^abstract strictfp class YYParser$' YYParser.java" "java.at:490" -( $at_check_trace; grep -c '^abstract strictfp class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:549: grep -c '^class YYParser implements Cloneable\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^class YYParser implements Cloneable$' YYParser.java" "java.at:549" +( $at_check_trace; grep -c '^class YYParser implements Cloneable$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -158754,13 +198385,12 @@ 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:490" +at_fn_check_skip $at_status "$at_srcdir/java.at:549" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -158768,11 +198398,12 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define final -%define strictfp +%define extends {Thread} +%define implements {Cloneable} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -158783,39 +198414,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:492" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:553" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:492" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:492" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:553" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:492" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:553" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:553: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:492" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:553" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -158824,16 +198455,16 @@ at_status=$? at_failed=false $at_check_filter 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:492" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:553" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:553: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:492" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:553" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -158842,7 +198473,7 @@ at_status=$? at_failed=false $at_check_filter 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:492" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:553" $at_failed && at_fn_log_failure $at_traceon; } @@ -158850,57 +198481,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:492: bison YYParser.y" -at_fn_check_prepare_trace "java.at:492" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:553: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:553" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:492" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:492: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:492" +$as_echo "$at_srcdir/java.at:553: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:553" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:492" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:553" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:492" >"$at_check_line_file" +$as_echo "java.at:553" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:492" -$as_echo "java.at:492" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:553" +$as_echo "java.at:553" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:492" + && at_fn_check_skip 77 "$at_srcdir/java.at:553" { set +x -$as_echo "$at_srcdir/java.at:492: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:492" +$as_echo "$at_srcdir/java.at:553: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:553" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:492" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:495: grep -c '^final strictfp class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^final strictfp class YYParser$' YYParser.java" "java.at:495" -( $at_check_trace; grep -c '^final strictfp class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:554: 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:554" +( $at_check_trace; grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -158908,11 +198539,24 @@ 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:495" +at_fn_check_skip $at_status "$at_srcdir/java.at:554" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_455 +#AT_START_456 +at_fn_group_banner 456 'java.at:563' \ + "Java %parse-param and %lex-param" " " 22 +at_xfail=no +( + $as_echo "456. $at_setup_line: testing $at_desc ..." + $at_traceon + cat >YYParser.y <<'_ATEOF' @@ -158922,9 +198566,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table -%define public +%token END "end" + %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -158935,39 +198580,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:497" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:565: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:565" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:497" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:565" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:497" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:565: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:565" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:497" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:565" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:565: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:565" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -158976,16 +198621,16 @@ at_status=$? at_failed=false $at_check_filter 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:497" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:565" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:565: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:497" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:565" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -158994,7 +198639,7 @@ at_status=$? at_failed=false $at_check_filter 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:497" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:565" $at_failed && at_fn_log_failure $at_traceon; } @@ -159002,57 +198647,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:497: bison YYParser.y" -at_fn_check_prepare_trace "java.at:497" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:565: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:565" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:497" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:565" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:497: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:497" +$as_echo "$at_srcdir/java.at:565: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:565" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:497" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:565" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:497" >"$at_check_line_file" +$as_echo "java.at:565" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:497" -$as_echo "java.at:497" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:565" +$as_echo "java.at:565" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:497" + && at_fn_check_skip 77 "$at_srcdir/java.at:565" { set +x -$as_echo "$at_srcdir/java.at:497: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:497" +$as_echo "$at_srcdir/java.at:565: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:565" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:497" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:565" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:498: grep -c '^public class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^public class YYParser$' YYParser.java" "java.at:498" -( $at_check_trace; grep -c '^public class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:566: grep -c '^ *public YYParser (Lexer yylexer) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer) *$' YYParser.java" "java.at:566" +( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -159060,13 +198705,12 @@ 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:498" +at_fn_check_skip $at_status "$at_srcdir/java.at:566" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -159074,11 +198718,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table - -%define public -%define abstract +%token END "end" +%parse-param {int parse_param1} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -159089,39 +198732,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:500" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:568: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:568" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:500" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:568" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:500" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:568: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:568" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:500" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:568" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:500" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -159130,16 +198773,16 @@ at_status=$? at_failed=false $at_check_filter 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:500" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:568" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:500" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -159148,7 +198791,7 @@ at_status=$? at_failed=false $at_check_filter 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:500" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:568" $at_failed && at_fn_log_failure $at_traceon; } @@ -159156,57 +198799,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:500: bison YYParser.y" -at_fn_check_prepare_trace "java.at:500" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:568: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:568" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:500" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:568" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:500: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:500" +$as_echo "$at_srcdir/java.at:568: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:568" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:500" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:568" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:500" >"$at_check_line_file" +$as_echo "java.at:568" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:500" -$as_echo "java.at:500" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:568" +$as_echo "java.at:568" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:500" + && at_fn_check_skip 77 "$at_srcdir/java.at:568" { set +x -$as_echo "$at_srcdir/java.at:500: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:500" +$as_echo "$at_srcdir/java.at:568: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:568" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:500" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:568" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:503: grep -c '^public abstract class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^public abstract class YYParser$' YYParser.java" "java.at:503" -( $at_check_trace; grep -c '^public abstract class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:569: 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:569" +( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -159214,10 +198857,39 @@ 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:503" +at_fn_check_skip $at_status "$at_srcdir/java.at:569" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:570: 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:570" +( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:570" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/java.at:571: 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:571" +( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:571" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -159228,11 +198900,12 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define public -%define final +%parse-param {int parse_param1} +%parse-param {long parse_param2} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -159243,39 +198916,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:505" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:575: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:575" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:505" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:505" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:575: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:575" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:505" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:505: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:505" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -159284,16 +198957,16 @@ at_status=$? at_failed=false $at_check_filter 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:505" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:505: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:505" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -159302,7 +198975,7 @@ at_status=$? at_failed=false $at_check_filter 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:505" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } @@ -159310,57 +198983,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:505: bison YYParser.y" -at_fn_check_prepare_trace "java.at:505" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:575: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:575" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:505" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:505: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:505" +$as_echo "$at_srcdir/java.at:575: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:575" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:505" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:505" >"$at_check_line_file" +$as_echo "java.at:575" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:505" -$as_echo "java.at:505" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:575" +$as_echo "java.at:575" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:505" + && at_fn_check_skip 77 "$at_srcdir/java.at:575" { set +x -$as_echo "$at_srcdir/java.at:505: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:505" +$as_echo "$at_srcdir/java.at:575: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:575" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:505" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:508: grep -c '^public final class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^public final class YYParser$' YYParser.java" "java.at:508" -( $at_check_trace; grep -c '^public final class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:576: 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:576" +( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -159368,153 +199041,59 @@ 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:508" -$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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:510" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:510" +at_fn_check_skip $at_status "$at_srcdir/java.at:576" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:510" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:510" -$at_failed && at_fn_log_failure -$at_traceon; } - - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/java.at:510: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:510" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:510" -$at_failed && at_fn_log_failure -$at_traceon; } - - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/java.at:510: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:510" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:510" -$at_failed && at_fn_log_failure -$at_traceon; } - - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/java.at:510: bison YYParser.y" -at_fn_check_prepare_trace "java.at:510" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:577: 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:577" +( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:510" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:510: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:510" -( $at_check_trace; grep '[mb]4_' YYParser.y +$as_echo "$at_srcdir/java.at:578: 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:578" +( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:510" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:578" $at_failed && at_fn_log_failure $at_traceon; } - -$as_echo "java.at:510" >"$at_check_line_file" -(test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:510" -$as_echo "java.at:510" >"$at_check_line_file" -(test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:510" { set +x -$as_echo "$at_srcdir/java.at:510: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:510" -( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +$as_echo "$at_srcdir/java.at:579: 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:579" +( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:510" +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:579" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:513: grep -c '^public strictfp class YYParser\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^public strictfp class YYParser$' YYParser.java" "java.at:513" -( $at_check_trace; grep -c '^public strictfp class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:580: 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:580" +( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -159522,13 +199101,12 @@ 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:513" +at_fn_check_skip $at_status "$at_srcdir/java.at:580" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -159536,12 +199114,31 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define public -%define abstract -%define strictfp + +%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" {}; +start: END {}; %% class Position {} _ATEOF @@ -159552,39 +199149,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:515" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:582: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:582" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:515" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:582" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:515: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:515" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:582: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:582" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:515" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:582" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:515: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:582: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:515" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:582" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -159593,16 +199190,16 @@ at_status=$? at_failed=false $at_check_filter 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:515" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:582" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:515: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:582: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:515" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:582" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -159611,7 +199208,7 @@ at_status=$? at_failed=false $at_check_filter 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:515" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:582" $at_failed && at_fn_log_failure $at_traceon; } @@ -159619,57 +199216,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:515: bison YYParser.y" -at_fn_check_prepare_trace "java.at:515" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:582: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:582" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:515" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:582" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:515: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:515" +$as_echo "$at_srcdir/java.at:582: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:582" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:515" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:582" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:515" >"$at_check_line_file" +$as_echo "java.at:582" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:515" -$as_echo "java.at:515" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:582" +$as_echo "java.at:582" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:515" + && at_fn_check_skip 77 "$at_srcdir/java.at:582" { set +x -$as_echo "$at_srcdir/java.at:515: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:515" +$as_echo "$at_srcdir/java.at:582: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:582" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:515" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:582" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:519: 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:519" -( $at_check_trace; grep -c '^public abstract strictfp class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:583: grep -c '^ *public YYParser () *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *public YYParser () *$' YYParser.java" "java.at:583" +( $at_check_trace; grep -c '^ *public YYParser () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -159677,10 +199274,24 @@ 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:519" +at_fn_check_skip $at_status "$at_srcdir/java.at:583" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:584: grep -c '^ *protected YYParser (Lexer yylexer) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer) *$' YYParser.java" "java.at:584" +( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer) *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:584" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -159691,12 +199302,31 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" +%parse-param {int parse_param1} -%define public -%define final -%define strictfp +%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" {}; +start: END {}; %% class Position {} _ATEOF @@ -159707,39 +199337,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:521" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:587: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:587" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:521" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:587" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:521" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:587: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:587" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:521" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:587" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:521: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:521" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -159748,16 +199378,16 @@ at_status=$? at_failed=false $at_check_filter 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:521" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:587" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:521: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:521" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -159766,7 +199396,7 @@ at_status=$? at_failed=false $at_check_filter 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:521" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:587" $at_failed && at_fn_log_failure $at_traceon; } @@ -159774,57 +199404,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:521: bison YYParser.y" -at_fn_check_prepare_trace "java.at:521" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:587: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:587" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:521" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:587" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:521: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:521" +$as_echo "$at_srcdir/java.at:587: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:587" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:521" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:587" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:521" >"$at_check_line_file" +$as_echo "java.at:587" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:521" -$as_echo "java.at:521" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:587" +$as_echo "java.at:587" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:521" + && at_fn_check_skip 77 "$at_srcdir/java.at:587" { set +x -$as_echo "$at_srcdir/java.at:521: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:521" +$as_echo "$at_srcdir/java.at:587: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:587" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:521" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:587" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:525: 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:525" -( $at_check_trace; grep -c '^public final strictfp class YYParser$' YYParser.java +$as_echo "$at_srcdir/java.at:588: 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:588" +( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -159832,24 +199462,54 @@ 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:525" +at_fn_check_skip $at_status "$at_srcdir/java.at:588" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:589: 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:589" +( $at_check_trace; grep -c '^ *public YYParser (int parse_param1) *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:589" +$at_failed && at_fn_log_failure +$at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:590: 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:590" +( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:590" +$at_failed && at_fn_log_failure +$at_traceon; } - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_316 -#AT_START_317 -at_fn_group_banner 317 'java.at:534' \ - "Java parser class extends and implements" " " 20 -at_xfail=no -( - $as_echo "317. $at_setup_line: testing $at_desc ..." - $at_traceon +{ set +x +$as_echo "$at_srcdir/java.at:591: 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:591" +( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:591" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -159860,9 +199520,33 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table -%define extends "Thread" +%token END "end" + +%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" {}; +start: END {}; %% class Position {} _ATEOF @@ -159873,39 +199557,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:536" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:536" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:536" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:536" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:596" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:536: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:596: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:536" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:596" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -159914,16 +199598,16 @@ at_status=$? at_failed=false $at_check_filter 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:536" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:596" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:536: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:596: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:536" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:596" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -159932,7 +199616,7 @@ at_status=$? at_failed=false $at_check_filter 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:536" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:596" $at_failed && at_fn_log_failure $at_traceon; } @@ -159940,57 +199624,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:536: bison YYParser.y" -at_fn_check_prepare_trace "java.at:536" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:596: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:596" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:536" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:536: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:536" +$as_echo "$at_srcdir/java.at:596: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:596" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:536" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:596" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:536" >"$at_check_line_file" +$as_echo "java.at:596" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:536" -$as_echo "java.at:536" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:596" +$as_echo "java.at:596" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:536" + && at_fn_check_skip 77 "$at_srcdir/java.at:596" { set +x -$as_echo "$at_srcdir/java.at:536: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:536" +$as_echo "$at_srcdir/java.at:596: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:596" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:536" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:537: grep -c '^class YYParser extends Thread\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread$' YYParser.java" "java.at:537" -( $at_check_trace; grep -c '^class YYParser extends Thread$' YYParser.java +$as_echo "$at_srcdir/java.at:597: 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:597" +( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -159998,165 +199682,87 @@ 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:537" -$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 - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:539" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:539" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/java.at:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:539" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:539" +at_fn_check_skip $at_status "$at_srcdir/java.at:597" $at_failed && at_fn_log_failure $at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/java.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' "java.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" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:539" -$at_failed && at_fn_log_failure -$at_traceon; } - - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort +{ set +x +$as_echo "$at_srcdir/java.at:598: 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:598" +( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:539" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:598" $at_failed && at_fn_log_failure $at_traceon; } - rm -rf xml-tests expout - at_restore_special_files -fi { set +x -$as_echo "$at_srcdir/java.at:539: bison YYParser.y" -at_fn_check_prepare_trace "java.at:539" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:599: 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:599" +( $at_check_trace; grep -c '^ *public YYParser (int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:539" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:599" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:539: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:539" -( $at_check_trace; grep '[mb]4_' YYParser.y +$as_echo "$at_srcdir/java.at:600: 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:600" +( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:539" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } - -$as_echo "java.at:539" >"$at_check_line_file" -(test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:539" -$as_echo "java.at:539" >"$at_check_line_file" -(test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:539" { set +x -$as_echo "$at_srcdir/java.at:539: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:539" -( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +$as_echo "$at_srcdir/java.at:601: 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:601" +( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:539" +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "2 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/java.at:601" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:540: grep -c '^class YYParser implements Cloneable\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^class YYParser implements Cloneable$' YYParser.java" "java.at:540" -( $at_check_trace; grep -c '^class YYParser implements Cloneable$' YYParser.java +$as_echo "$at_srcdir/java.at:602: 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:602" +( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 +echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/java.at:540" +at_fn_check_skip $at_status "$at_srcdir/java.at:602" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -160164,11 +199770,31 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" +%lex-param {char lex_param1} + +%code lexer +{ + Object yylval; + public Object getLVal() { return yylval; } -%define extends "Thread" -%define implements "Cloneable" + 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" {}; +start: END {}; %% class Position {} _ATEOF @@ -160179,39 +199805,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:542: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:542" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:605: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:605" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:542" +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:542: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:542" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:605: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:605" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:542" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:605" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:542: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:605: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:542" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:605" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -160220,16 +199846,16 @@ at_status=$? at_failed=false $at_check_filter 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:542" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:605" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:542: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:605: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:542" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:605" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -160238,7 +199864,7 @@ at_status=$? at_failed=false $at_check_filter 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:542" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:605" $at_failed && at_fn_log_failure $at_traceon; } @@ -160246,57 +199872,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:542: bison YYParser.y" -at_fn_check_prepare_trace "java.at:542" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:605: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:605" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:542" +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:542: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:542" +$as_echo "$at_srcdir/java.at:605: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:605" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:542" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:605" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:542" >"$at_check_line_file" +$as_echo "java.at:605" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:542" -$as_echo "java.at:542" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:605" +$as_echo "java.at:605" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:542" + && at_fn_check_skip 77 "$at_srcdir/java.at:605" { set +x -$as_echo "$at_srcdir/java.at:542: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:542" +$as_echo "$at_srcdir/java.at:605: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:605" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:542" +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:545: 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:545" -( $at_check_trace; grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java +$as_echo "$at_srcdir/java.at:606: 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:606" +( $at_check_trace; grep -c '^ *public YYParser (char lex_param1) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -160304,24 +199930,24 @@ 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:545" +at_fn_check_skip $at_status "$at_srcdir/java.at:606" $at_failed && at_fn_log_failure $at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_317 -#AT_START_318 -at_fn_group_banner 318 'java.at:554' \ - "Java %parse-param and %lex-param" " " 20 -at_xfail=no -( - $as_echo "318. $at_setup_line: testing $at_desc ..." - $at_traceon +{ set +x +$as_echo "$at_srcdir/java.at:607: grep -c '^.* = new YYLexer *(lex_param1);\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java" "java.at:607" +( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:607" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -160332,9 +199958,33 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + +%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" {}; +start: END {}; %% class Position {} _ATEOF @@ -160345,39 +199995,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:556" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:612" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:556" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:556: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:556" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:612" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:556" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:612" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:556: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:556" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -160386,16 +200036,16 @@ at_status=$? at_failed=false $at_check_filter 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:556" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:612" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:556: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:556" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -160404,7 +200054,7 @@ at_status=$? at_failed=false $at_check_filter 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:556" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:612" $at_failed && at_fn_log_failure $at_traceon; } @@ -160412,57 +200062,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:556: bison YYParser.y" -at_fn_check_prepare_trace "java.at:556" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:612: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:612" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:556" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:556: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:556" +$as_echo "$at_srcdir/java.at:612: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:612" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:556" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:612" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:556" >"$at_check_line_file" +$as_echo "java.at:612" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:556" -$as_echo "java.at:556" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:612" +$as_echo "java.at:612" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:556" + && at_fn_check_skip 77 "$at_srcdir/java.at:612" { set +x -$as_echo "$at_srcdir/java.at:556: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:556" +$as_echo "$at_srcdir/java.at:612: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:612" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:556" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:557: grep -c '^ *public YYParser (Lexer yylexer) {\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer) {$' YYParser.java" "java.at:557" -( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer) {$' YYParser.java +$as_echo "$at_srcdir/java.at:613: 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:613" +( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -160470,10 +200120,24 @@ 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:557" +at_fn_check_skip $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 '^.* = 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:614" +( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:614" +$at_failed && at_fn_log_failure +$at_traceon; } @@ -160484,9 +200148,35 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + %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" {}; +start: END {}; %% class Position {} _ATEOF @@ -160497,39 +200187,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:559" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:621: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:621" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:559" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:559" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:621: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:621" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:559" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:621" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:559: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:559" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -160538,16 +200228,16 @@ at_status=$? at_failed=false $at_check_filter 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:559" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:621" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:559: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:559" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -160556,7 +200246,7 @@ at_status=$? at_failed=false $at_check_filter 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:559" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:621" $at_failed && at_fn_log_failure $at_traceon; } @@ -160564,56 +200254,56 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:559: bison YYParser.y" -at_fn_check_prepare_trace "java.at:559" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:621: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:621" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:559" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:559: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:559" +$as_echo "$at_srcdir/java.at:621: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:621" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:559" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:621" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:559" >"$at_check_line_file" +$as_echo "java.at:621" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:559" -$as_echo "java.at:559" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:621" +$as_echo "java.at:621" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:559" + && at_fn_check_skip 77 "$at_srcdir/java.at:621" { set +x -$as_echo "$at_srcdir/java.at:559: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:559" +$as_echo "$at_srcdir/java.at:621: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:621" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:559" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:621" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:560: 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:560" +$as_echo "$at_srcdir/java.at:622: 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:622" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -160622,15 +200312,29 @@ 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:560" +at_fn_check_skip $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 '^ *protected final long parse_param2;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:623" +( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:623" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:561: 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:561" -( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java +$as_echo "$at_srcdir/java.at:624: 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:624" +( $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" 5>&- at_status=$? at_failed=false $at_check_filter @@ -160638,15 +200342,29 @@ 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:561" +at_fn_check_skip $at_status "$at_srcdir/java.at:624" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:625: 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:625" +( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:625" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:562: 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:562" -( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java +$as_echo "$at_srcdir/java.at:626: 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:626" +( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -160654,10 +200372,76 @@ 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_fn_check_skip $at_status "$at_srcdir/java.at:626" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:627: 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:627" +( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:627" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/java.at:628: 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:628" +( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:628" +$at_failed && at_fn_log_failure +$at_traceon; } + + + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_456 +#AT_START_457 +at_fn_group_banner 457 'java.at:637' \ + "Java throws specifications" " " 22 +at_xfail=no +( + $as_echo "457. $at_setup_line: testing $at_desc ..." + $at_traceon + + +# %define throws - 0 1 2 +# %define lex-throws - 0 1 2 +# %code lexer 0 1 + + + + + + + + + + + + + + + + + + @@ -160668,11 +200452,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + + + -%parse-param {int parse_param1} -%parse-param {long parse_param2} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -160683,39 +200469,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:564: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:564" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:564: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:564" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -160724,16 +200510,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:564: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:564" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -160742,7 +200528,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -160750,89 +200536,57 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $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" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:564" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:564" -$as_echo "java.at:564" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:564" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { 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" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:567: 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:567" -( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:567" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/java.at:568: 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:568" -( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:568" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:569: 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:569" -( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -160840,15 +200594,14 @@ 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:569" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:570: 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:570" -( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -160856,15 +200609,14 @@ 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_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:571: 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:571" -( $at_check_trace; grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -160872,13 +200624,11 @@ 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:571" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -160886,30 +200636,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" - -%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; - } +%define throws {} -} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -160920,39 +200653,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:573: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:573" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:573" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:573: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:573" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:573" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:573: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:573" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -160961,16 +200694,16 @@ at_status=$? at_failed=false $at_check_filter 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:573" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:573: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:573" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -160979,7 +200712,7 @@ at_status=$? at_failed=false $at_check_filter 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:573" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -160987,57 +200720,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:573: bison YYParser.y" -at_fn_check_prepare_trace "java.at:573" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:573" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:573: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:573" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:573" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:573" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:573" -$as_echo "java.at:573" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:573" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:573: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:573" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:573" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:574: grep -c '^ *public YYParser () {\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *public YYParser () {$' YYParser.java" "java.at:574" -( $at_check_trace; grep -c '^ *public YYParser () {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161045,15 +200778,14 @@ 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:574" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:575: grep -c '^ *protected YYParser (Lexer yylexer) {\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer) {$' YYParser.java" "java.at:575" -( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161061,11 +200793,24 @@ 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:575" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - +{ set +x +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:717" +$at_failed && at_fn_log_failure +$at_traceon; } cat >YYParser.y <<'_ATEOF' @@ -161075,30 +200820,13 @@ cat >YYParser.y <<'_ATEOF' %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; - } +%token END "end" +%define throws {ClassNotFoundException} -} +%initial-action {if (true) throw new ClassNotFoundException();} %% -start: "end" {}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -161109,39 +200837,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:577: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:577" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:577" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:577: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:577" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:577" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:577: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:577" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -161150,16 +200878,16 @@ at_status=$? at_failed=false $at_check_filter 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:577" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:577: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:577" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -161168,7 +200896,7 @@ at_status=$? at_failed=false $at_check_filter 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:577" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -161176,57 +200904,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:577: bison YYParser.y" -at_fn_check_prepare_trace "java.at:577" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:577" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:577: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:577" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:577" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:577" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:577" -$as_echo "java.at:577" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:577" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:577: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:577" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:577" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:579: 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:579" -( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161234,15 +200962,14 @@ 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:579" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:580: 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:580" -( $at_check_trace; grep -c '^ *public YYParser (int parse_param1) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161250,15 +200977,14 @@ 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:580" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:581: 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:581" -( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161266,29 +200992,11 @@ 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:581" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/java.at:582: 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:582" -( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:582" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -161296,32 +201004,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%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; - } - +%define throws {ClassNotFoundException, InstantiationException} -} +%initial-action {if (true) throw new InstantiationException();} %% -start: "end" {}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -161332,39 +201021,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:584: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:584" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:584: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:584" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -161373,16 +201062,16 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:584: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:584" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -161391,7 +201080,7 @@ at_status=$? at_failed=false $at_check_filter 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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -161399,73 +201088,57 @@ $at_traceon; } at_restore_special_files 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 +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $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" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:584" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:584" -$as_echo "java.at:584" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:584" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { 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" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:588: 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:588" -( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:588" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:589: 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:589" -( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161473,15 +201146,14 @@ 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:589" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:590: 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:590" -( $at_check_trace; grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161489,15 +201161,14 @@ 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:590" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:591: 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:591" -( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161505,45 +201176,11 @@ 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:591" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/java.at:592: 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:592" -( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:592" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/java.at:593: 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:593" -( $at_check_trace; grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:593" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -161551,30 +201188,13 @@ cat >YYParser.y <<'_ATEOF' %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; } +%token END "end" - public void yyerror (Location loc, String s) - { - System.err.println (loc + ": " + s); - } - public int yylex () - { - return EOF; - } +%define lex_throws {} - YYLexer (char lex_param1) {} -} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -161585,39 +201205,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:595" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:595" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:595" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:595" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:595: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:595" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -161626,16 +201246,16 @@ at_status=$? at_failed=false $at_check_filter 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:595" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:595: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:595" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -161644,7 +201264,7 @@ at_status=$? at_failed=false $at_check_filter 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:595" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -161652,57 +201272,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:595: bison YYParser.y" -at_fn_check_prepare_trace "java.at:595" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:595" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:595: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:595" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:595" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:595" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:595" -$as_echo "java.at:595" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:595" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:595: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:595" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:595" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:597: 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:597" -( $at_check_trace; grep -c '^ *public YYParser (char lex_param1) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161710,15 +201330,14 @@ 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:597" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:598: grep -c '^.* = new YYLexer *(lex_param1);\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java" "java.at:598" -( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161726,11 +201345,24 @@ 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:598" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - +{ set +x +$as_echo "$at_srcdir/java.at:717: grep -c '^ *public boolean parse () *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:717" +$at_failed && at_fn_log_failure +$at_traceon; } cat >YYParser.y <<'_ATEOF' @@ -161740,32 +201372,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%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; - } +%define throws {} +%define lex_throws {} - YYLexer (char lex_param1, short lex_param2) {} -} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -161776,39 +201389,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:600" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:600" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:600: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:600" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:600" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:600: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:600" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -161817,16 +201430,16 @@ at_status=$? at_failed=false $at_check_filter 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:600" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:600: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:600" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -161835,7 +201448,7 @@ at_status=$? at_failed=false $at_check_filter 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:600" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -161843,57 +201456,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:600: bison YYParser.y" -at_fn_check_prepare_trace "java.at:600" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:600" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:600: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:600" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:600" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:600" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:600" -$as_echo "java.at:600" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:600" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:600: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:600" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:600" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:604: 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:604" -( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161901,15 +201514,14 @@ 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_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:605: 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:605" -( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -161917,11 +201529,24 @@ 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_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - +{ set +x +$as_echo "$at_srcdir/java.at:717: grep -c '^ *public boolean parse () *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:717" +$at_failed && at_fn_log_failure +$at_traceon; } cat >YYParser.y <<'_ATEOF' @@ -161931,34 +201556,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%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) {} -} +%define throws {ClassNotFoundException} +%define lex_throws {} +%initial-action {if (true) throw new ClassNotFoundException();} %% -start: "end" {}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -161969,39 +201573,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:607" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:607" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:607: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:607" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -162010,16 +201614,16 @@ at_status=$? at_failed=false $at_check_filter 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:607" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:607: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:607" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -162028,7 +201632,7 @@ at_status=$? at_failed=false $at_check_filter 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:607" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -162036,89 +201640,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:607: bison YYParser.y" -at_fn_check_prepare_trace "java.at:607" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:607" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:607: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:607" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:607" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:607" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:607" -$as_echo "java.at:607" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:607" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:607: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:607" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:607" -$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" 5>&- -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_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $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" 5>&- -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 (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:615" -( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162126,15 +201698,14 @@ 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_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:616: 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:616" -( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162142,15 +201713,14 @@ 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_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:617: 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:617" -( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162158,82 +201728,11 @@ 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:617" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/java.at:618: 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:618" -( $at_check_trace; grep -c '^[ ]*this.parse_param1 = parse_param1;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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; } - - -{ set +x -$as_echo "$at_srcdir/java.at:619: 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:619" -( $at_check_trace; grep -c '^[ ]*this.parse_param2 = parse_param2;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:619" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_318 -#AT_START_319 -at_fn_group_banner 319 'java.at:628' \ - "Java throws specifications" " " 20 -at_xfail=no -( - $as_echo "319. $at_setup_line: testing $at_desc ..." - $at_traceon - - -# %define throws - 0 1 2 -# %define lex-throws - 0 1 2 -# %code lexer 0 1 - - - - - - - - - - - - - - - - - - - - - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -162241,12 +201740,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" - - - +%define throws {ClassNotFoundException, InstantiationException} +%define lex_throws {} +%initial-action {if (true) throw new InstantiationException();} %% -start: "end" {}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -162257,39 +201757,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -162298,16 +201798,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -162316,7 +201816,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -162324,57 +201824,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162382,15 +201882,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162398,15 +201897,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162414,12 +201912,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -162427,12 +201924,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "" +%define lex_throws {InterruptedException} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -162443,39 +201941,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -162484,16 +201982,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -162502,7 +202000,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -162510,57 +202008,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162568,14 +202066,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -162584,15 +202081,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162600,12 +202096,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -162613,12 +202108,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException" +%define throws {} +%define lex_throws {InterruptedException} -%initial-action {if (true) throw new ClassNotFoundException();} %% -start: "end" {throw new ClassNotFoundException();}; +start: END {}; %% class Position {} _ATEOF @@ -162629,39 +202125,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -162670,16 +202166,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -162688,7 +202184,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -162696,57 +202192,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162754,15 +202250,29 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:717" +$at_failed && at_fn_log_failure +$at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162770,15 +202280,153 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } +cat >YYParser.y <<'_ATEOF' + +%language "Java" +%locations +%debug +%error-verbose +%token-table +%token END "end" + +%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 + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations 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:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:717" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:717" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/java.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' "java.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" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:717" +$at_failed && at_fn_log_failure +$at_traceon; } + + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/java.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 | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:717" +$at_failed && at_fn_log_failure +$at_traceon; } + + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_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:717" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; grep '[mb]4_' YYParser.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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:717" +$at_failed && at_fn_log_failure +$at_traceon; } + + +$as_echo "java.at:717" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +{ set +x +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" +( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_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:717" +$at_failed && at_fn_log_failure +$at_traceon; } + + +{ set +x +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162786,10 +202434,39 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } +{ set +x +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:717" +$at_failed && at_fn_log_failure +$at_traceon; } + +{ set +x +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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_skip $at_status "$at_srcdir/java.at:717" +$at_failed && at_fn_log_failure +$at_traceon; } cat >YYParser.y <<'_ATEOF' @@ -162799,12 +202476,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException, InstantiationException" - +%define throws {ClassNotFoundException, InstantiationException} +%define lex_throws {InterruptedException} %initial-action {if (true) throw new InstantiationException();} %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -162815,39 +202493,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -162856,16 +202534,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -162874,7 +202552,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -162882,57 +202560,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162940,14 +202618,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -162956,15 +202633,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -162972,12 +202648,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -162985,12 +202660,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define lex_throws "" +%define lex_throws {InterruptedException, IllegalAccessException} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -163001,39 +202677,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -163042,16 +202718,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -163060,7 +202736,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -163068,57 +202744,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163126,14 +202802,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -163142,15 +202817,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163158,12 +202832,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -163171,12 +202844,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "" -%define lex_throws "" +%define throws {} +%define lex_throws {InterruptedException, IllegalAccessException} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -163187,39 +202861,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -163228,16 +202902,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -163246,7 +202920,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -163254,57 +202928,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163312,14 +202986,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -163328,15 +203001,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163344,12 +203016,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -163357,12 +203028,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException" -%define lex_throws "" +%define throws {ClassNotFoundException} +%define lex_throws {InterruptedException, IllegalAccessException} %initial-action {if (true) throw new ClassNotFoundException();} %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -163373,39 +203045,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -163414,16 +203086,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -163432,7 +203104,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -163440,57 +203112,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163498,14 +203170,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -163514,15 +203185,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163530,12 +203200,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -163543,12 +203212,13 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException, InstantiationException" -%define lex_throws "" +%define throws {ClassNotFoundException, InstantiationException} +%define lex_throws {InterruptedException, IllegalAccessException} %initial-action {if (true) throw new InstantiationException();} %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -163559,39 +203229,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -163600,16 +203270,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -163618,7 +203288,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -163626,57 +203296,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163684,14 +203354,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -163700,15 +203369,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163716,12 +203384,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -163729,12 +203396,34 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + + + + +%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(); + } -%define lex_throws "InterruptedException" +} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -163745,39 +203434,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -163786,16 +203475,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -163804,7 +203493,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -163812,57 +203501,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163870,14 +203559,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -163886,15 +203574,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -163902,12 +203589,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -163915,12 +203601,34 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + +%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(); + } -%define throws "" -%define lex_throws "InterruptedException" +} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -163931,39 +203639,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -163972,16 +203680,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -163990,7 +203698,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -163998,57 +203706,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164056,14 +203764,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -164072,15 +203779,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164088,12 +203794,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -164101,12 +203806,34 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + +%define throws {ClassNotFoundException} -%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 java.io.IOException + { + throw new java.io.IOException(); + } + + +} %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -164117,39 +203844,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -164158,16 +203885,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -164176,7 +203903,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -164184,57 +203911,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164242,14 +203969,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -164258,15 +203984,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164274,12 +203999,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -164287,12 +204011,34 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + +%define throws {ClassNotFoundException, InstantiationException} -%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 java.io.IOException + { + throw new java.io.IOException(); + } + + +} %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -164303,39 +204049,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -164344,16 +204090,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -164362,7 +204108,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -164370,57 +204116,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164428,14 +204174,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -164444,15 +204189,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164460,12 +204204,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -164473,12 +204216,34 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + +%define lex_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 () + { + return EOF; + } + + +} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -164489,39 +204254,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -164530,16 +204295,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -164548,7 +204313,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -164556,57 +204321,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164614,14 +204379,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -164630,15 +204394,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *public boolean parse () *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164646,12 +204409,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -164659,12 +204421,34 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" + +%define throws {} +%define lex_throws {} + -%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 () + { + return EOF; + } + +} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -164675,39 +204459,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -164716,16 +204500,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -164734,7 +204518,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -164742,57 +204526,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164800,14 +204584,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -164816,15 +204599,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *public boolean parse () *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164832,12 +204614,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -164845,12 +204626,34 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException" -%define lex_throws "InterruptedException, IllegalAccessException" +%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();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -164861,39 +204664,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -164902,16 +204705,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -164920,7 +204723,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -164928,57 +204731,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -164986,14 +204789,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -165002,15 +204804,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165018,12 +204819,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -165031,12 +204831,34 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException, InstantiationException" -%define lex_throws "InterruptedException, IllegalAccessException" +%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();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -165047,39 +204869,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -165088,16 +204910,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -165106,7 +204928,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -165114,57 +204936,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165172,14 +204994,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -165188,15 +205009,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165204,12 +205024,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -165217,9 +205036,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" - +%define lex_throws {InterruptedException} %code lexer @@ -165235,15 +205055,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () throws java.io.IOException + public int yylex () throws InterruptedException { - throw new java.io.IOException(); + throw new InterruptedException(); } } %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -165254,39 +205074,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -165295,16 +205115,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -165313,7 +205133,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -165321,57 +205141,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165379,14 +205199,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -165395,15 +205214,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165411,12 +205229,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -165424,9 +205241,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "" - +%define throws {} +%define lex_throws {InterruptedException} %code lexer @@ -165442,15 +205260,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () throws java.io.IOException + public int yylex () throws InterruptedException { - throw new java.io.IOException(); + throw new InterruptedException(); } } %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -165461,39 +205279,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -165502,16 +205320,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -165520,7 +205338,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -165528,57 +205346,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165586,14 +205404,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -165602,15 +205419,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165618,12 +205434,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -165631,9 +205446,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException" - +%define throws {ClassNotFoundException} +%define lex_throws {InterruptedException} %initial-action {if (true) throw new ClassNotFoundException();} %code lexer @@ -165649,15 +205465,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () throws java.io.IOException + public int yylex () throws InterruptedException { - throw new java.io.IOException(); + throw new InterruptedException(); } } %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -165668,39 +205484,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -165709,16 +205525,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -165727,7 +205543,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -165735,57 +205551,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165793,14 +205609,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -165809,15 +205624,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -165825,12 +205639,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -165838,9 +205651,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException, InstantiationException" - +%define throws {ClassNotFoundException, InstantiationException} +%define lex_throws {InterruptedException} %initial-action {if (true) throw new InstantiationException();} %code lexer @@ -165856,15 +205670,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () throws java.io.IOException + public int yylex () throws InterruptedException { - throw new java.io.IOException(); + throw new InterruptedException(); } } %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -165875,39 +205689,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -165916,16 +205730,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -165934,7 +205748,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -165942,57 +205756,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166000,14 +205814,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -166016,15 +205829,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166032,12 +205844,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -166045,9 +205856,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define lex_throws "" +%define lex_throws {InterruptedException, IllegalAccessException} %code lexer @@ -166063,15 +205875,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () + public int yylex () throws InterruptedException, IllegalAccessException { - return EOF; + throw new IllegalAccessException(); } } %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -166082,39 +205894,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -166123,16 +205935,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -166141,7 +205953,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -166149,57 +205961,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166207,14 +206019,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -166223,15 +206034,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166239,12 +206049,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -166252,9 +206061,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "" -%define lex_throws "" +%define throws {} +%define lex_throws {InterruptedException, IllegalAccessException} %code lexer @@ -166270,15 +206080,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () + public int yylex () throws InterruptedException, IllegalAccessException { - return EOF; + throw new IllegalAccessException(); } } %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -166289,39 +206099,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -166330,16 +206140,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -166348,7 +206158,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -166356,57 +206166,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166414,14 +206224,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" +at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -166430,15 +206239,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *public boolean parse () *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166446,12 +206254,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -166459,9 +206266,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException" -%define lex_throws "" +%define throws {ClassNotFoundException} +%define lex_throws {InterruptedException, IllegalAccessException} %initial-action {if (true) throw new ClassNotFoundException();} %code lexer @@ -166477,15 +206285,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () + public int yylex () throws InterruptedException, IllegalAccessException { - return EOF; + throw new IllegalAccessException(); } } %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -166496,39 +206304,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -166537,16 +206345,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -166555,7 +206363,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -166563,57 +206371,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166621,14 +206429,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -166637,15 +206444,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166653,12 +206459,11 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - cat >YYParser.y <<'_ATEOF' %language "Java" @@ -166666,9 +206471,10 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException, InstantiationException" -%define lex_throws "" +%define throws {ClassNotFoundException, InstantiationException} +%define lex_throws {InterruptedException, IllegalAccessException} %initial-action {if (true) throw new InstantiationException();} %code lexer @@ -166684,15 +206490,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () + public int yylex () throws InterruptedException, IllegalAccessException { - return EOF; + throw new IllegalAccessException(); } } %% -start: "end" {throw new ClassNotFoundException();}; +start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF @@ -166703,39 +206509,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:717: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:717" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 @@ -166744,16 +206550,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.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 | sort @@ -166762,7 +206568,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } @@ -166770,57 +206576,57 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:717: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:717" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:717: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:717" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" +$as_echo "java.at:717" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:717" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:717: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:717" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166828,14 +206634,13 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" +$as_echo "$at_srcdir/java.at:717: 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:717" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -166844,15 +206649,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/java.at:717: 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:717" +( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -166860,12 +206664,29 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/java.at:717" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_457 +#AT_START_458 +at_fn_group_banner 458 'java.at:726' \ + "Java constructor init and init_throws" " " 22 +at_xfail=no +( + $as_echo "458. $at_setup_line: testing $at_desc ..." + $at_traceon + + + + + cat >YYParser.y <<'_ATEOF' %language "Java" @@ -166873,33 +206694,14 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" - -%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(); - } - - -} +%define extends {Thread} +%code init { super("Test Thread"); if (true) throw new InterruptedException(); } +%define init_throws {InterruptedException} +%lex-param {int lex_param} %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -166910,39 +206712,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:735: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:735" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:735" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:735: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:735" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:735" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:735: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:735" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -166951,16 +206753,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:735" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:735: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:735" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -166969,7 +206771,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:735" $at_failed && at_fn_log_failure $at_traceon; } @@ -166977,97 +206779,63 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:735: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:735" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:735" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:735: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:735" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:735" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:735" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:735" +$as_echo "java.at:735" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:735" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:735: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:735" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:735" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:736: grep 'super(\"Test Thread\"); if (true) throw new InterruptedException();' YYParser.java" +at_fn_check_prepare_trace "java.at:736" +( $at_check_trace; grep 'super("Test Thread"); if (true) throw new InterruptedException();' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:688" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:688" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:736" $at_failed && at_fn_log_failure $at_traceon; } @@ -167080,10 +206848,11 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "" -%define lex_throws "InterruptedException" - +%define extends {Thread} +%code init { super("Test Thread"); if (true) throw new InterruptedException(); } +%define init_throws {InterruptedException} %code lexer { @@ -167098,15 +206867,15 @@ cat >YYParser.y <<'_ATEOF' System.err.println (loc + ": " + s); } - public int yylex () throws InterruptedException + public int yylex () { - throw new InterruptedException(); + return EOF; } } %% -start: "end" {}; +start: END {}; %% class Position {} _ATEOF @@ -167117,39 +206886,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:741: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:741" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:741" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:741: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:741" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:741" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:741: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:741" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -167158,16 +206927,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:741" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:741: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:741" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -167176,7 +206945,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:741" $at_failed && at_fn_log_failure $at_traceon; } @@ -167184,99 +206953,81 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:741: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:741" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:741" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:741: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:741" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:741" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:741" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:741" +$as_echo "java.at:741" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:741" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:741: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:741" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:741" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:742: grep 'super(\"Test Thread\"); if (true) throw new InterruptedException();' YYParser.java" +at_fn_check_prepare_trace "java.at:742" +( $at_check_trace; grep 'super("Test Thread"); if (true) throw new InterruptedException();' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:742" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:688" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:688" -$at_failed && at_fn_log_failure -$at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_458 +#AT_START_459 +at_fn_group_banner 459 'java.at:753' \ + "Java value, position, and location types" " " 22 +at_xfail=no +( + $as_echo "459. $at_setup_line: testing $at_desc ..." + $at_traceon @@ -167287,35 +207038,17 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%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(); - } - - -} +%define api.value.type {java.awt.Color} +%type start; +%define api.location.type {MyLoc} +%define api.position.type {MyPos} +%code { class MyPos {} } %% -start: "end" {throw new ClassNotFoundException();}; +start: END {$$ = $1;}; %% -class Position {} +class MyPos {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then @@ -167324,39 +207057,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:760: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:760" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:760" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:760: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:760" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:760" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:760: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:760" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -167365,16 +207098,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:760" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:760: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:760" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -167383,7 +207116,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:760" $at_failed && at_fn_log_failure $at_traceon; } @@ -167391,97 +207124,89 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:760: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:760" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:760" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:760: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:760" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:760" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:760" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:760" +$as_echo "java.at:760" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:760" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:760: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:760" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:760" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:761: grep 'java.awt.Color' YYParser.java" +at_fn_check_prepare_trace "java.at:761" +( $at_check_trace; grep 'java.awt.Color' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:761" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:762: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" +at_fn_check_prepare_notrace 'a shell pipeline' "java.at:762" +( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:762" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/java.at:763: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" +at_fn_check_prepare_notrace 'a shell pipeline' "java.at:763" +( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +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; } @@ -167494,35 +207219,38 @@ cat >YYParser.y <<'_ATEOF' %debug %error-verbose %token-table +%token END "end" -%define throws "ClassNotFoundException, InstantiationException" -%define lex_throws "InterruptedException" -%initial-action {if (true) throw new InstantiationException();} +%define api.value.type {java.awt.Color} +%type start; +%define api.location.type {MyLoc} +%define api.position.type {MyPos} +%code { class MyPos {} } %code lexer { - Object yylval; - public Object getLVal() { return yylval; } + java.awt.Color yylval; + public java.awt.Color getLVal() { return yylval; } - public Position getStartPos() { return null; } - public Position getEndPos() { return null; } + public MyPos getStartPos() { return null; } + public MyPos getEndPos() { return null; } - public void yyerror (Location loc, String s) + public void yyerror (MyLoc loc, String s) { System.err.println (loc + ": " + s); } - public int yylex () throws InterruptedException + public int yylex () { - throw new InterruptedException(); + return EOF; } } %% -start: "end" {throw new ClassNotFoundException();}; +start: END {$$ = $1;}; %% -class Position {} +class MyPos {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then @@ -167531,39 +207259,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:772" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:772: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:772" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:772" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:772: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:772" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -167572,16 +207300,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:772" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:772: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:772" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -167590,7 +207318,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:772" $at_failed && at_fn_log_failure $at_traceon; } @@ -167598,138 +207326,156 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:772: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:772" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" +$as_echo "$at_srcdir/java.at:772: grep '[mb]4_' YYParser.y" +at_fn_check_prepare_trace "java.at:772" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:772" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:772" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:772" +$as_echo "java.at:772" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:772" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:772: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:772" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:773: grep 'java.awt.Color' YYParser.java" +at_fn_check_prepare_trace "java.at:773" +( $at_check_trace; grep 'java.awt.Color' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:773" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/java.at:774: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" +at_fn_check_prepare_notrace 'a shell pipeline' "java.at:774" +( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:774" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/java.at:775: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" +at_fn_check_prepare_notrace 'a shell pipeline' "java.at:775" +( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stdout:; cat "$at_stdout" +at_fn_check_status 1 $at_status "$at_srcdir/java.at:775" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_459 +#AT_START_460 +at_fn_group_banner 460 'java.at:784' \ + "Java syntax error handling without error token" " " 22 +at_xfail=no +( + $as_echo "460. $at_setup_line: testing $at_desc ..." + $at_traceon -cat >YYParser.y <<'_ATEOF' +cat >YYParser.y <<'_ATEOF' %language "Java" -%locations -%debug -%error-verbose -%token-table - -%define lex_throws "InterruptedException, IllegalAccessException" +%lex-param { String s } +%code imports { + import java.io.IOException; +} -%code lexer -{ - Object yylval; - public Object getLVal() { return yylval; } +%code lexer { + String Input; + int Position; - public Position getStartPos() { return null; } - public Position getEndPos() { return null; } + public YYLexer (String s) + { + Input = s; + Position = 0; + } - public void yyerror (Location loc, String s) + public void yyerror (String s) { - System.err.println (loc + ": " + s); + System.err.println (s); } - public int yylex () throws InterruptedException, IllegalAccessException + public Object getLVal () { - throw new IllegalAccessException(); + return null; } + public int yylex () throws IOException + { + if (Position >= Input.length ()) + return EOF; + else + return Input.charAt (Position++); + } +} +%code { + public static void main (String args []) throws IOException + { + YYParser p = new YYParser (args [0]); + p.parse (); + } } %% -start: "end" {}; -%% -class Position {} +input: + 'a' 'a' +; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then @@ -167738,39 +207484,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/java.at:835: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:835" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:835" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/java.at:835: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:835" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:835" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:835: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:835" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -167779,16 +207525,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:835" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/java.at:835: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:835" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -167797,7 +207543,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:835" $at_failed && at_fn_log_failure $at_traceon; } @@ -167805,179 +207551,226 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/java.at:835: bison -fno-caret YYParser.y" +at_fn_check_prepare_trace "java.at:835" +( $at_check_trace; bison -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:835" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; grep '[mb]4_' YYParser.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:688" -$at_failed && at_fn_log_failure -$at_traceon; } - -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "java.at:836" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/java.at:836" +$as_echo "java.at:836" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/java.at:836" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" +$as_echo "$at_srcdir/java.at:836: \$SHELL ../../../javacomp.sh YYParser.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:836" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/java.at:836" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java +$as_echo "$at_srcdir/java.at:837: \$SHELL ../../../javaexec.sh YYParser aa" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser aa" "java.at:837" +( $at_check_trace; $SHELL ../../../javaexec.sh YYParser aa ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:837" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java +$as_echo "$at_srcdir/java.at:839: \$SHELL ../../../javaexec.sh YYParser ab" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ab" "java.at:839" +( $at_check_trace; $SHELL ../../../javaexec.sh YYParser ab ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 +echo >>"$at_stderr"; $as_echo "syntax error " | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:839" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java +$as_echo "$at_srcdir/java.at:841: \$SHELL ../../../javaexec.sh YYParser ba" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ba" "java.at:841" +( $at_check_trace; $SHELL ../../../javaexec.sh YYParser ba ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; $as_echo "1 +echo >>"$at_stderr"; $as_echo "syntax error " | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/java.at:688" + $at_diff - "$at_stderr" || at_failed=: +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/java.at:841" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_460 +#AT_START_461 +at_fn_group_banner 461 'javapush.at:168' \ + "Trivial Push Parser with api.push-pull verification" "" 23 +at_xfail=no +( + $as_echo "461. $at_setup_line: testing $at_desc ..." + $at_traceon + -cat >YYParser.y <<'_ATEOF' +cat >input.y <<'_ATEOF' %language "Java" -%locations -%debug + + +%define parser_class_name {YYParser} %error-verbose -%token-table -%define throws "" -%define lex_throws "InterruptedException, IllegalAccessException" +%code imports { +import java.io.*; +import java.util.*; +} +%% -%code lexer -{ - Object yylval; - public Object getLVal() { return yylval; } +start: 'a' 'b' 'c' ; - public Position getStartPos() { return null; } - public Position getEndPos() { return null; } +%% - public void yyerror (Location loc, String s) + + public class Main { - System.err.println (loc + ": " + s); + + + static class YYerror implements YYParser.Lexer + { + public Object getLVal() {return null;} + public int yylex () throws java.io.IOException { return 0; } + public void yyerror (String msg) { System.err.println(msg); } } - public int yylex () throws InterruptedException, IllegalAccessException + static YYParser parser = null; + static YYerror yyerror = null; + static int teststate = -1; + + static void setup() + throws IOException { - throw new IllegalAccessException(); + yyerror = new YYerror(); + parser = new YYParser(yyerror); + parser.setDebugLevel(1); + teststate = -1; + } + + static String[] teststatename + = new String[]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYPUSH_MORE"}; + + static void check(int teststate, int expected, String msg) + { + System.err.println("teststate="+teststatename[teststate] + +"; expected="+teststatename[expected]); + if (teststate == expected) + return; + System.err.println("unexpected state: "+msg); + System.exit(1); } + static public void main (String[] argv) + throws IOException + { + setup(); + + teststate = parser.push_parse('a', null); + check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)"); + + setup(); + + teststate = parser.push_parse('a', null); + check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)"); + teststate = parser.push_parse('b', null); + check(teststate,YYParser.YYPUSH_MORE,"push_parse('b', null)"); + teststate = parser.push_parse('c', null); + check(teststate,YYParser.YYPUSH_MORE,"push_parse('c', null)"); + teststate = parser.push_parse('\0', null); + check(teststate,YYParser.YYACCEPT,"push_parse('\\0', null)"); + + /* Reuse the parser instance and cause a failure */ + teststate = parser.push_parse('b', null); + check(teststate,YYParser.YYABORT,"push_parse('b', null)"); + + System.exit(0); + } + } -%% -start: "end" {}; -%% -class Position {} + _ATEOF + +# Verify that the proper procedure(s) are generated for each case. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/javapush.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dapi.push-pull=pull -o Main.java input.y" +at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:177" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dapi.push-pull=pull -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:177" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/javapush.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.java input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.java input.y" "javapush.at:177" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:177" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.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 @@ -167986,16 +207779,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:177" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.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 | sort @@ -168004,7 +207797,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:177" $at_failed && at_fn_log_failure $at_traceon; } @@ -168012,73 +207805,142 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/javapush.at:177: bison -fno-caret -Dapi.push-pull=pull -o Main.java input.y" +at_fn_check_prepare_trace "javapush.at:177" +( $at_check_trace; bison -fno-caret -Dapi.push-pull=pull -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:177" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; grep '[mb]4_' YYParser.y +$as_echo "$at_srcdir/javapush.at:180: grep -c '^.*public boolean parse ().*\$' Main.java" +at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:180" +( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/javapush.at:180" $at_failed && at_fn_log_failure $at_traceon; } - -$as_echo "java.at:688" >"$at_check_line_file" -(test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" -(test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" +# If BISON_USE_PUSH_FOR_PULL is set, then we have one occurrence of +# this function, otherwise it should not be there. { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" -( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +$as_echo "$at_srcdir/javapush.at:185: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java" +at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:185" +( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +echo >>"$at_stdout"; $as_echo "${BISON_USE_PUSH_FOR_PULL-0} +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/javapush.at:185" +$at_failed && at_fn_log_failure +$at_traceon; } + + +if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then + at_save_special_files + mkdir xml-tests + # Don't combine these Bison invocations since we want to be sure that + # --report=all isn't required to get the full XML file. + { set +x +$as_echo "$at_srcdir/javapush.at:187: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dapi.push-pull=both -o Main.java input.y" +at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:187" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dapi.push-pull=both -o Main.java input.y +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:187" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/javapush.at:187: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.java input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.java input.y" "javapush.at:187" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:187" +$at_failed && at_fn_log_failure +$at_traceon; } + + cp xml-tests/test.output expout + { set +x +$as_echo "$at_srcdir/javapush.at:187: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ + xml-tests/test.xml" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:187" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ + xml-tests/test.xml +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:187" $at_failed && at_fn_log_failure $at_traceon; } + sort xml-tests/test.dot > expout + { set +x +$as_echo "$at_srcdir/javapush.at:187: \$XSLTPROC \\ + \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ + xml-tests/test.xml | sort" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:187" +( $at_check_trace; $XSLTPROC \ + `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ + xml-tests/test.xml | sort +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +at_fn_diff_devnull "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:187" +$at_failed && at_fn_log_failure +$at_traceon; } + rm -rf xml-tests expout + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java +$as_echo "$at_srcdir/javapush.at:187: bison -fno-caret -Dapi.push-pull=both -o Main.java input.y" +at_fn_check_prepare_trace "javapush.at:187" +( $at_check_trace; bison -fno-caret -Dapi.push-pull=both -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:187" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" -at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java +$as_echo "$at_srcdir/javapush.at:190: grep -c '^.*public boolean parse ().*\$' Main.java" +at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:190" +( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -168086,15 +207948,14 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/javapush.at:190" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java +$as_echo "$at_srcdir/javapush.at:193: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java" +at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:193" +( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -168102,89 +207963,50 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/javapush.at:193" $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 at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/javapush.at:195: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dapi.push-pull=push -o Main.java input.y" +at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:195" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:195" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/javapush.at:195: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" "javapush.at:195" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:195" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.at:195: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:195" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -168193,16 +208015,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:195" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.at:195: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:195" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -168211,7 +208033,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:195" $at_failed && at_fn_log_failure $at_traceon; } @@ -168219,57 +208041,38 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/javapush.at:195: bison -fno-caret -Dapi.push-pull=push -o Main.java input.y" +at_fn_check_prepare_trace "javapush.at:195" +( $at_check_trace; bison -fno-caret -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:195" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; grep '[mb]4_' YYParser.y +$as_echo "$at_srcdir/javapush.at:198: grep -c '^.*public boolean parse ().*\$' Main.java" +at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:198" +( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" -$at_failed && at_fn_log_failure -$at_traceon; } - - -$as_echo "java.at:688" >"$at_check_line_file" -(test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" -(test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -{ set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" -( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:688" +echo >>"$at_stdout"; $as_echo "0 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/javapush.at:198" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java +$as_echo "$at_srcdir/javapush.at:201: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java" +at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:201" +( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -168277,121 +208080,180 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/javapush.at:201" $at_failed && at_fn_log_failure $at_traceon; } + +$as_echo "javapush.at:203" >"$at_check_line_file" +(test -z "$CONF_JAVAC") \ + && at_fn_check_skip 77 "$at_srcdir/javapush.at:203" +$as_echo "javapush.at:203" >"$at_check_line_file" +(test -z "$CONF_JAVA") \ + && at_fn_check_skip 77 "$at_srcdir/javapush.at:203" { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/javapush.at:203: \$SHELL ../../../javacomp.sh Main.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Main.java" "javapush.at:203" +( $at_check_trace; $SHELL ../../../javacomp.sh Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stderr:; cat "$at_stderr" +echo stdout:; cat "$at_stdout" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:203" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java +$as_echo "$at_srcdir/javapush.at:204: \$SHELL ../../../javaexec.sh Main" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Main" "javapush.at:204" +( $at_check_trace; $SHELL ../../../javaexec.sh Main ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stderr captured; cp "$at_stderr" stderr +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:204" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_461 +#AT_START_462 +at_fn_group_banner 462 'javapush.at:213' \ + "Trivial Push Parser with %initial-action" " " 23 +at_xfail=no +( + $as_echo "462. $at_setup_line: testing $at_desc ..." + $at_traceon -cat >YYParser.y <<'_ATEOF' +cat >input.y <<'_ATEOF' %language "Java" -%locations -%debug +%initial-action { +System.err.println("Initial action invoked"); +} + + +%define parser_class_name {YYParser} %error-verbose -%token-table -%define throws "ClassNotFoundException, InstantiationException" -%define lex_throws "InterruptedException, IllegalAccessException" -%initial-action {if (true) throw new InstantiationException();} +%code imports { +import java.io.*; +import java.util.*; +} -%code lexer -{ - Object yylval; - public Object getLVal() { return yylval; } +%% - public Position getStartPos() { return null; } - public Position getEndPos() { return null; } +start: 'a' 'b' 'c' ; - public void yyerror (Location loc, String s) +%% + + + public class Main { - System.err.println (loc + ": " + s); + + + static class YYerror implements YYParser.Lexer + { + public Object getLVal() {return null;} + public int yylex () throws java.io.IOException { return 0; } + public void yyerror (String msg) { System.err.println(msg); } } - public int yylex () throws InterruptedException, IllegalAccessException + static YYParser parser = null; + static YYerror yyerror = null; + static int teststate = -1; + + static void setup() + throws IOException { - throw new IllegalAccessException(); + yyerror = new YYerror(); + parser = new YYParser(yyerror); + parser.setDebugLevel(1); + teststate = -1; } + static String[] teststatename + = new String[]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYPUSH_MORE"}; + + static void check(int teststate, int expected, String msg) + { + System.err.println("teststate="+teststatename[teststate] + +"; expected="+teststatename[expected]); + if (teststate == expected) + return; + System.err.println("unexpected state: "+msg); + System.exit(1); + } + + + static public void main (String[] argv) + throws IOException + { + setup(); + + teststate = parser.push_parse('a', null); + check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)"); + teststate = parser.push_parse('b', null); + check(teststate,YYParser.YYPUSH_MORE,"push_parse('b', null)"); + teststate = parser.push_parse('c', null); + check(teststate,YYParser.YYPUSH_MORE,"push_parse('c', null)"); + teststate = parser.push_parse('\0', null); + check(teststate,YYParser.YYACCEPT,"push_parse('\\0', null)"); + + System.exit(0); + } } -%% -start: "end" {throw new ClassNotFoundException();}; -%% -class Position {} + _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/javapush.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dapi.push-pull=push -o Main.java input.y" +at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:222" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:222" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:688" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/javapush.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" "javapush.at:222" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:222" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.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' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.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 @@ -168400,16 +208262,16 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:222" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:688: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:688" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.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 | sort @@ -168418,7 +208280,7 @@ at_status=$? at_failed=false $at_check_filter 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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:222" $at_failed && at_fn_log_failure $at_traceon; } @@ -168426,89 +208288,72 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:688: bison YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/javapush.at:222: bison -fno-caret -Dapi.push-pull=push -o Main.java input.y" +at_fn_check_prepare_trace "javapush.at:222" +( $at_check_trace; bison -fno-caret -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:222" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:688: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:688" -( $at_check_trace; grep '[mb]4_' YYParser.y +$as_echo "$at_srcdir/javapush.at:224: grep -c '^System.err.println(\"Initial action invoked\");\$' Main.java" +at_fn_check_prepare_dynamic "grep -c '^System.err.println(\"Initial action invoked\");$' Main.java" "javapush.at:224" +( $at_check_trace; grep -c '^System.err.println("Initial action invoked");$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/javapush.at:224" $at_failed && at_fn_log_failure $at_traceon; } -$as_echo "java.at:688" >"$at_check_line_file" +$as_echo "javapush.at:225" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" -$as_echo "java.at:688" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/javapush.at:225" +$as_echo "javapush.at:225" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:688" + && at_fn_check_skip 77 "$at_srcdir/javapush.at:225" { set +x -$as_echo "$at_srcdir/java.at:688: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:688" -( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +$as_echo "$at_srcdir/javapush.at:225: \$SHELL ../../../javacomp.sh Main.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Main.java" "javapush.at:225" +( $at_check_trace; $SHELL ../../../javacomp.sh Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:688" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:688" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:225" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/javapush.at:226: \$SHELL ../../../javaexec.sh Main" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Main" "javapush.at:226" +( $at_check_trace; $SHELL ../../../javaexec.sh Main ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:688" +echo stderr captured; cp "$at_stderr" stderr +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:226" $at_failed && at_fn_log_failure $at_traceon; } - +# Verify that initial action is called exactly once. { set +x -$as_echo "$at_srcdir/java.at:688: 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:688" -( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java +$as_echo "$at_srcdir/javapush.at:231: grep -c '^Initial action invoked\$' stderr" +at_fn_check_prepare_dynamic "grep -c '^Initial action invoked$' stderr" "javapush.at:231" +( $at_check_trace; grep -c '^Initial action invoked$' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -168516,86 +208361,406 @@ 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:688" +at_fn_check_skip $at_status "$at_srcdir/javapush.at:231" $at_failed && at_fn_log_failure $at_traceon; } - - - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_319 -#AT_START_320 -at_fn_group_banner 320 'java.at:717' \ - "Java stype, position_class and location_class" " " 20 +#AT_STOP_462 +#AT_START_463 +at_fn_group_banner 463 'javapush.at:321' \ + "Calc parser with api.push-pull both" " " 23 at_xfail=no ( - $as_echo "320. $at_setup_line: testing $at_desc ..." + $as_echo "463. $at_setup_line: testing $at_desc ..." $at_traceon -cat >YYParser.y <<'_ATEOF' +# Define the calculator input. +# Warning: if you changes the input file +# then the locations test file position numbers +# may be incorrect and you will have +# to modify that file as well. + +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 + + +# Compose pieces to build the actual .y file. +cat >Calc.y <<'_ATEOF' +/* Infix notation calculator--calc */ %language "Java" -%locations -%debug -%error-verbose -%token-table +%name-prefix "Calc" +%define parser_class_name {Calc} -%define stype "java.awt.Color" -%type start; -%define api.location.type "MyLoc" -%define api.position.type "MyPos" -%code { class MyPos {} } -%% -start: "end" {$$ = $1;}; +%code { +static class UserLexer implements Calc.Lexer +{ + StreamTokenizer st; + StringReader rdr; + + public UserLexer(StringReader reader) + { + rdr = reader; + st = new StreamTokenizer(rdr); + st.resetSyntax(); + st.eolIsSignificant(true); + st.whitespaceChars(9, 9); + st.whitespaceChars(32, 32); + st.wordChars(48, 57); + } + + Integer yylval; + + public Object getLVal() { return yylval; } + + public void yyerror(String msg) { System.err.println(msg); } + + public int yylex () throws IOException + { + switch (st.nextToken()) { + case StreamTokenizer.TT_EOF: return EOF; + case StreamTokenizer.TT_EOL: return (int) '\n'; + case StreamTokenizer.TT_WORD: + yylval = new Integer (st.sval); + return NUM; + default: return st.ttype; + } + } +} + +} + +%code { +public static void main (String[] argv) + throws IOException +{ + StringReader reader = getinput(argv[0]); + UserLexer lexer = new UserLexer(reader); + Calc calc = new Calc(lexer); + calc.setDebugLevel(1); + calc.parse(); +}//main + +} + + +%code imports { + import java.io.*; +} + +%code { + static StringReader + getinput(String filename) throws IOException + { + // Yes, there are better alternatives to StringBuffer. But we + // don't really care about performances here, while portability + // to older Java matters. + StringBuffer buf = new StringBuffer(); + FileReader file = new FileReader(filename); + int c; + while (0 < (c = file.read())) + buf.append((char)c); + file.close(); + return new StringReader(buf.toString()); + } +} + +/* Bison Declarations */ +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%left NEG /* negation--unary minus */ +%right '^' /* exponentiation */ + +/* Grammar follows */ %% -class MyPos {} +input: + line +| input line +; + +line: + '\n' +| exp '\n' + {System.out.println("total = "+$1);} +| 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;} +; + + +_ATEOF + + +# This data was captured from running a pull parser. +cat >expout <<'_ATEOF' +Stack now 0 +Stack now 0 2 +Stack now 0 9 +Stack now 0 9 19 +Stack now 0 9 19 2 +Stack now 0 9 19 28 +Stack now 0 9 19 28 20 +Stack now 0 9 19 28 20 2 +Stack now 0 9 19 28 20 29 +Stack now 0 9 19 28 +Stack now 0 9 +Stack now 0 9 17 +Stack now 0 9 17 2 +Stack now 0 9 17 26 +Stack now 0 9 +Stack now 0 9 23 +Stack now 0 8 +Stack now 0 7 +Stack now 0 7 2 +Stack now 0 7 9 +Stack now 0 7 9 19 +Stack now 0 7 9 19 2 +Stack now 0 7 9 19 28 +Stack now 0 7 9 19 28 20 +Stack now 0 7 9 19 28 20 3 +Stack now 0 7 9 19 28 20 3 2 +Stack now 0 7 9 19 28 20 3 12 +Stack now 0 7 9 19 28 20 29 +Stack now 0 7 9 19 28 +Stack now 0 7 9 +Stack now 0 7 9 17 +Stack now 0 7 9 17 3 +Stack now 0 7 9 17 3 2 +Stack now 0 7 9 17 3 12 +Stack now 0 7 9 17 26 +Stack now 0 7 9 +Stack now 0 7 9 23 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 4 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 3 +Stack now 0 7 3 2 +Stack now 0 7 3 12 +Stack now 0 7 3 12 22 +Stack now 0 7 3 12 22 2 +Stack now 0 7 3 12 22 31 +Stack now 0 7 3 12 +Stack now 0 7 9 +Stack now 0 7 9 17 +Stack now 0 7 9 17 3 +Stack now 0 7 9 17 3 2 +Stack now 0 7 9 17 3 12 +Stack now 0 7 9 17 26 +Stack now 0 7 9 +Stack now 0 7 9 23 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 5 +Stack now 0 7 5 3 +Stack now 0 7 5 3 2 +Stack now 0 7 5 3 12 +Stack now 0 7 5 14 +Stack now 0 7 5 14 25 +Stack now 0 7 9 +Stack now 0 7 9 22 +Stack now 0 7 9 22 2 +Stack now 0 7 9 22 31 +Stack now 0 7 9 +Stack now 0 7 9 17 +Stack now 0 7 9 17 2 +Stack now 0 7 9 17 26 +Stack now 0 7 9 +Stack now 0 7 9 23 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 4 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 3 +Stack now 0 7 3 3 +Stack now 0 7 3 3 3 +Stack now 0 7 3 3 3 2 +Stack now 0 7 3 3 3 12 +Stack now 0 7 3 3 12 +Stack now 0 7 3 12 +Stack now 0 7 9 +Stack now 0 7 9 17 +Stack now 0 7 9 17 3 +Stack now 0 7 9 17 3 2 +Stack now 0 7 9 17 3 12 +Stack now 0 7 9 17 26 +Stack now 0 7 9 +Stack now 0 7 9 23 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 4 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 2 +Stack now 0 7 9 +Stack now 0 7 9 18 +Stack now 0 7 9 18 2 +Stack now 0 7 9 18 27 +Stack now 0 7 9 +Stack now 0 7 9 18 +Stack now 0 7 9 18 2 +Stack now 0 7 9 18 27 +Stack now 0 7 9 +Stack now 0 7 9 17 +Stack now 0 7 9 17 3 +Stack now 0 7 9 17 3 2 +Stack now 0 7 9 17 3 12 +Stack now 0 7 9 17 26 +Stack now 0 7 9 +Stack now 0 7 9 23 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 2 +Stack now 0 7 9 +Stack now 0 7 9 18 +Stack now 0 7 9 18 5 +Stack now 0 7 9 18 5 2 +Stack now 0 7 9 18 5 14 +Stack now 0 7 9 18 5 14 18 +Stack now 0 7 9 18 5 14 18 2 +Stack now 0 7 9 18 5 14 18 27 +Stack now 0 7 9 18 5 14 +Stack now 0 7 9 18 5 14 25 +Stack now 0 7 9 18 27 +Stack now 0 7 9 +Stack now 0 7 9 17 +Stack now 0 7 9 17 2 +Stack now 0 7 9 17 26 +Stack now 0 7 9 +Stack now 0 7 9 23 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 4 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 2 +Stack now 0 7 9 +Stack now 0 7 9 22 +Stack now 0 7 9 22 2 +Stack now 0 7 9 22 31 +Stack now 0 7 9 22 31 22 +Stack now 0 7 9 22 31 22 2 +Stack now 0 7 9 22 31 22 31 +Stack now 0 7 9 22 31 +Stack now 0 7 9 +Stack now 0 7 9 17 +Stack now 0 7 9 17 2 +Stack now 0 7 9 17 26 +Stack now 0 7 9 +Stack now 0 7 9 23 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 5 +Stack now 0 7 5 2 +Stack now 0 7 5 14 +Stack now 0 7 5 14 22 +Stack now 0 7 5 14 22 2 +Stack now 0 7 5 14 22 31 +Stack now 0 7 5 14 +Stack now 0 7 5 14 25 +Stack now 0 7 9 +Stack now 0 7 9 22 +Stack now 0 7 9 22 2 +Stack now 0 7 9 22 31 +Stack now 0 7 9 +Stack now 0 7 9 17 +Stack now 0 7 9 17 2 +Stack now 0 7 9 17 26 +Stack now 0 7 9 +Stack now 0 7 9 23 +Stack now 0 7 16 +Stack now 0 7 +Stack now 0 7 15 _ATEOF + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:719" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/javapush.at:589: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dapi.push-pull=both -o Calc.java Calc.y" +at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:589" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:589" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:719: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:719" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/javapush.at:589: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" "javapush.at:589" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:589" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:719: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.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:719" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.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 @@ -168604,16 +208769,16 @@ at_status=$? at_failed=false $at_check_filter 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:719" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:589" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:719: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:719" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.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 | sort @@ -168622,7 +208787,7 @@ at_status=$? at_failed=false $at_check_filter 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:719" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:589" $at_failed && at_fn_log_failure $at_traceon; } @@ -168630,173 +208795,471 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:719: bison YYParser.y" -at_fn_check_prepare_trace "java.at:719" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/javapush.at:589: bison -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y" +at_fn_check_prepare_trace "javapush.at:589" +( $at_check_trace; bison -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:589" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/java.at:719: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:719" -( $at_check_trace; grep '[mb]4_' YYParser.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:719" -$at_failed && at_fn_log_failure -$at_traceon; } -$as_echo "java.at:719" >"$at_check_line_file" +$as_echo "javapush.at:591" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:719" -$as_echo "java.at:719" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/javapush.at:591" +$as_echo "javapush.at:591" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:719" + && at_fn_check_skip 77 "$at_srcdir/javapush.at:591" { set +x -$as_echo "$at_srcdir/java.at:719: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:719" -( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +$as_echo "$at_srcdir/javapush.at:591: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "javapush.at:591" +( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:719" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:591" $at_failed && at_fn_log_failure $at_traceon; } - +# Verify that this is a push parser. { set +x -$as_echo "$at_srcdir/java.at:725: grep 'java.awt.Color' YYParser.java" -at_fn_check_prepare_trace "java.at:725" -( $at_check_trace; grep 'java.awt.Color' YYParser.java +$as_echo "$at_srcdir/javapush.at:594: grep -c '^.*public void push_parse_initialize().*\$' Calc.java" +at_fn_check_prepare_dynamic "grep -c '^.*public void push_parse_initialize().*$' Calc.java" "javapush.at:594" +( $at_check_trace; grep -c '^.*public void push_parse_initialize().*$' Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:725" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/javapush.at:594" $at_failed && at_fn_log_failure $at_traceon; } +# Capture stderr output for comparison purposes. { set +x -$as_echo "$at_srcdir/java.at:726: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" -at_fn_check_prepare_notrace 'a shell pipeline' "java.at:726" -( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position' +$as_echo "$at_srcdir/javapush.at:596: \$SHELL ../../../javaexec.sh Calc input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc input" "javapush.at:596" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:726" +echo stderr captured; cp "$at_stderr" stderr + +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:596" $at_failed && at_fn_log_failure $at_traceon; } +# Extract the "Stack Now" lines from the error output, +# send them to stdout (via the sed command) and compare to expout. +# NOTE: because the target is "expout", this macro automatically +# compares the output of the sed command with the contents of +# the file "expout" (defined above). { set +x -$as_echo "$at_srcdir/java.at:727: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" -at_fn_check_prepare_notrace 'a shell pipeline' "java.at:727" -( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location' +$as_echo "$at_srcdir/javapush.at:603: sed -e '/^Stack now.*\$/p' -e d ./stderr" +at_fn_check_prepare_dynamic "sed -e '/^Stack now.*$/p' -e d ./stderr" "javapush.at:603" +( $at_check_trace; sed -e '/^Stack now.*$/p' -e d ./stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:727" + +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/javapush.at:603" $at_failed && at_fn_log_failure $at_traceon; } + set +x + $at_times_p && times >"$at_times_file" +) 5>&1 2>&1 7>&- | eval $at_tee_pipe +read at_status <"$at_status_file" +#AT_STOP_463 +#AT_START_464 +at_fn_group_banner 464 'javapush.at:617' \ + "Calc parser with %locations %code lexer and api.push-pull both" "" 23 +at_xfail=no +( + $as_echo "464. $at_setup_line: testing $at_desc ..." + $at_traceon + -cat >YYParser.y <<'_ATEOF' +cat >Calc.y <<'_ATEOF' +/* Infix notation calculator--calc. */ %language "Java" +%name-prefix "Calc" +%define parser_class_name {Calc} +%lex-param { Reader rdr } %locations -%debug -%error-verbose -%token-table -%define stype "java.awt.Color" -%type start; -%define api.location.type "MyLoc" -%define api.position.type "MyPos" -%code { class MyPos {} } +%code imports { + import java.io.*; +} -%code lexer -{ - java.awt.Color yylval; - public java.awt.Color getLVal() { return yylval; } +%code lexer { + StreamTokenizer st; + Integer yylval; - public MyPos getStartPos() { return null; } - public MyPos getEndPos() { return null; } + public YYLexer(Reader rdr) + { + st = new StreamTokenizer(rdr); + st.resetSyntax(); + st.eolIsSignificant(true); + st.whitespaceChars(9, 9); + st.whitespaceChars(32, 32); + st.wordChars(48, 57); + } - public void yyerror (MyLoc loc, String s) + Position yypos = new Position (1, 0); + + public Position getStartPos() { return yypos; } + + public Position getEndPos() { return yypos; } + + public Object getLVal() { return yylval; } + + public void yyerror(Location loc, String msg) { - System.err.println (loc + ": " + s); + System.err.println(loc+":"+msg); } - public int yylex () + public int yylex () throws IOException { - return EOF; + yypos = new Position (yypos.lineno (),yypos.token () + 1); + switch (st.nextToken()) { + case StreamTokenizer.TT_EOF: + return EOF; + case StreamTokenizer.TT_EOL: + yypos = new Position (yypos.lineno () + 1, 0); + return (int) '\n'; + case StreamTokenizer.TT_WORD: + yylval = new Integer (st.sval); + return NUM; + default: + return st.ttype; + } } +} + +%code { +class Position { + public int line; + public int token; + public Position () { line = 0; token = 0; } + public Position (int l, int t) { line = l; token = t; } + + public boolean equals (Position l) + { + return l.line == line && l.token == token; + } + + public String toString () + { + return Integer.toString(line) + "." + Integer.toString(token); + } + + public int lineno () { return line; } + + public int token () { return token; } +}//Class Position } + +%code { +public static void main (String[] argv) + throws IOException +{ + StringReader reader = getinput(argv[0]); + Calc calc = new Calc(reader); + calc.setDebugLevel(1); + calc.parse(); +} +} + + +%code imports { + import java.io.*; +} + +%code { + static StringReader + getinput(String filename) throws IOException + { + // Yes, there are better alternatives to StringBuffer. But we + // don't really care about performances here, while portability + // to older Java matters. + StringBuffer buf = new StringBuffer(); + FileReader file = new FileReader(filename); + int c; + while (0 < (c = file.read())) + buf.append((char)c); + file.close(); + return new StringReader(buf.toString()); + } +} + +/* Bison Declarations */ +%token NUM "number" +%type exp + +%nonassoc '=' /* comparison */ +%left '-' '+' +%left '*' '/' +%left NEG /* negation--unary minus */ +%right '^' /* exponentiation */ + +/* Grammar follows */ %% -start: "end" {$$ = $1;}; -%% -class MyPos {} +input: + line +| input line +; + +line: + '\n' +| exp '\n' + {System.out.println("total = "+$1);} +| 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;} +; + + +_ATEOF + + +# Define the expected calculator output. +# This should match the output from a pull parser. +cat >output <<'_ATEOF' +total = 7 +total = -5 +total = -1 +total = 1 +total = -1 +total = -4 +total = 2 +total = 256 +total = 64 +_ATEOF + + +cat >locations <<'_ATEOF' +Next token is token "number" (1.1: 1) +Next token is token '+' (1.2: 1) +Next token is token "number" (1.3: 2) +Next token is token '*' (1.4: 2) +Next token is token "number" (1.5: 3) +Next token is token '=' (1.6: 3) +Next token is token '=' (1.6: 3) +Next token is token '=' (1.6: 3) +Next token is token "number" (1.7: 7) +Next token is token '\n' (2.0: 7) +Next token is token '\n' (2.0: 7) +Next token is token "number" (2.1: 1) +Next token is token '+' (2.2: 1) +Next token is token "number" (2.3: 2) +Next token is token '*' (2.4: 2) +Next token is token '-' (2.5: 2) +Next token is token "number" (2.6: 3) +Next token is token '=' (2.7: 3) +Next token is token '=' (2.7: 3) +Next token is token '=' (2.7: 3) +Next token is token '=' (2.7: 3) +Next token is token '-' (2.8: 3) +Next token is token "number" (2.9: 5) +Next token is token '\n' (3.0: 5) +Next token is token '\n' (3.0: 5) +Next token is token '\n' (3.0: 5) +Next token is token '\n' (4.0: 5) +Next token is token '-' (4.1: 5) +Next token is token "number" (4.2: 1) +Next token is token '^' (4.3: 1) +Next token is token "number" (4.4: 2) +Next token is token '=' (4.5: 2) +Next token is token '=' (4.5: 2) +Next token is token '=' (4.5: 2) +Next token is token '-' (4.6: 2) +Next token is token "number" (4.7: 1) +Next token is token '\n' (5.0: 1) +Next token is token '\n' (5.0: 1) +Next token is token '\n' (5.0: 1) +Next token is token '(' (5.1: 1) +Next token is token '-' (5.2: 1) +Next token is token "number" (5.3: 1) +Next token is token ')' (5.4: 1) +Next token is token ')' (5.4: 1) +Next token is token '^' (5.5: 1) +Next token is token "number" (5.6: 2) +Next token is token '=' (5.7: 2) +Next token is token '=' (5.7: 2) +Next token is token "number" (5.8: 1) +Next token is token '\n' (6.0: 1) +Next token is token '\n' (6.0: 1) +Next token is token '\n' (7.0: 1) +Next token is token '-' (7.1: 1) +Next token is token '-' (7.2: 1) +Next token is token '-' (7.3: 1) +Next token is token "number" (7.4: 1) +Next token is token '=' (7.5: 1) +Next token is token '=' (7.5: 1) +Next token is token '=' (7.5: 1) +Next token is token '=' (7.5: 1) +Next token is token '-' (7.6: 1) +Next token is token "number" (7.7: 1) +Next token is token '\n' (8.0: 1) +Next token is token '\n' (8.0: 1) +Next token is token '\n' (8.0: 1) +Next token is token '\n' (9.0: 1) +Next token is token "number" (9.1: 1) +Next token is token '-' (9.2: 1) +Next token is token "number" (9.3: 2) +Next token is token '-' (9.4: 2) +Next token is token '-' (9.4: 2) +Next token is token "number" (9.5: 3) +Next token is token '=' (9.6: 3) +Next token is token '=' (9.6: 3) +Next token is token '-' (9.7: 3) +Next token is token "number" (9.8: 4) +Next token is token '\n' (10.0: 4) +Next token is token '\n' (10.0: 4) +Next token is token '\n' (10.0: 4) +Next token is token "number" (10.1: 1) +Next token is token '-' (10.2: 1) +Next token is token '(' (10.3: 1) +Next token is token "number" (10.4: 2) +Next token is token '-' (10.5: 2) +Next token is token "number" (10.6: 3) +Next token is token ')' (10.7: 3) +Next token is token ')' (10.7: 3) +Next token is token '=' (10.8: 3) +Next token is token '=' (10.8: 3) +Next token is token "number" (10.9: 2) +Next token is token '\n' (11.0: 2) +Next token is token '\n' (11.0: 2) +Next token is token '\n' (12.0: 2) +Next token is token "number" (12.1: 2) +Next token is token '^' (12.2: 2) +Next token is token "number" (12.3: 2) +Next token is token '^' (12.4: 2) +Next token is token "number" (12.5: 3) +Next token is token '=' (12.6: 3) +Next token is token '=' (12.6: 3) +Next token is token '=' (12.6: 3) +Next token is token "number" (12.7: 256) +Next token is token '\n' (13.0: 256) +Next token is token '\n' (13.0: 256) +Next token is token '(' (13.1: 256) +Next token is token "number" (13.2: 2) +Next token is token '^' (13.3: 2) +Next token is token "number" (13.4: 2) +Next token is token ')' (13.5: 2) +Next token is token ')' (13.5: 2) +Next token is token '^' (13.6: 2) +Next token is token "number" (13.7: 3) +Next token is token '=' (13.8: 3) +Next token is token '=' (13.8: 3) +Next token is token "number" (13.9: 64) +Next token is token '\n' (14.0: 64) +Next token is token '\n' (14.0: 64) +_ATEOF + + +# Define the calculator input. +# Warning: if you changes the input file +# then the locations test file position numbers +# may be incorrect and you will have +# to modify that file as well. + +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 + if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:729: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:729" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y +$as_echo "$at_srcdir/javapush.at:869: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot -Dapi.push-pull=both -o Calc.java Calc.y" +at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:869" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:729" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:869" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:729: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:729" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +$as_echo "$at_srcdir/javapush.at:869: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" "javapush.at:869" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:729" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:869" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/java.at:729: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.at:869: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:729" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:869" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -168805,16 +209268,16 @@ at_status=$? at_failed=false $at_check_filter 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:729" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:869" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/java.at:729: \$XSLTPROC \\ +$as_echo "$at_srcdir/javapush.at:869: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:729" +at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:869" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -168823,7 +209286,7 @@ at_status=$? at_failed=false $at_check_filter 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:729" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:869" $at_failed && at_fn_log_failure $at_traceon; } @@ -168831,319 +209294,134 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/java.at:729: bison YYParser.y" -at_fn_check_prepare_trace "java.at:729" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/javapush.at:869: bison -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y" +at_fn_check_prepare_trace "javapush.at:869" +( $at_check_trace; bison -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:729" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:869" $at_failed && at_fn_log_failure $at_traceon; } -{ set +x -$as_echo "$at_srcdir/java.at:729: grep '[mb]4_' YYParser.y" -at_fn_check_prepare_trace "java.at:729" -( $at_check_trace; grep '[mb]4_' YYParser.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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:729" -$at_failed && at_fn_log_failure -$at_traceon; } - -$as_echo "java.at:729" >"$at_check_line_file" +$as_echo "javapush.at:870" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:729" -$as_echo "java.at:729" >"$at_check_line_file" + && at_fn_check_skip 77 "$at_srcdir/javapush.at:870" +$as_echo "javapush.at:870" >"$at_check_line_file" (test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:729" + && at_fn_check_skip 77 "$at_srcdir/javapush.at:870" { set +x -$as_echo "$at_srcdir/java.at:729: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:729" -( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java +$as_echo "$at_srcdir/javapush.at:870: \$SHELL ../../../javacomp.sh Calc.java" +at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "javapush.at:870" +( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:729" +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:870" $at_failed && at_fn_log_failure $at_traceon; } - +# Verify that this is a push parser { set +x -$as_echo "$at_srcdir/java.at:737: grep 'java.awt.Color' YYParser.java" -at_fn_check_prepare_trace "java.at:737" -( $at_check_trace; grep 'java.awt.Color' YYParser.java +$as_echo "$at_srcdir/javapush.at:873: grep -c '^.*public void push_parse_initialize().*\$' Calc.java" +at_fn_check_prepare_dynamic "grep -c '^.*public void push_parse_initialize().*$' Calc.java" "javapush.at:873" +( $at_check_trace; grep -c '^.*public void push_parse_initialize().*$' Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:737" +echo >>"$at_stdout"; $as_echo "1 +" | \ + $at_diff - "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/javapush.at:873" $at_failed && at_fn_log_failure $at_traceon; } +# Capture the stdout and stderr output for comparison purposes. { set +x -$as_echo "$at_srcdir/java.at:738: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" -at_fn_check_prepare_notrace 'a shell pipeline' "java.at:738" -( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position' +$as_echo "$at_srcdir/javapush.at:875: \$SHELL ../../../javaexec.sh Calc input" +at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc input" "javapush.at:875" +( $at_check_trace; $SHELL ../../../javaexec.sh Calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:738" +echo stderr captured; cp "$at_stderr" stderr +echo stdout captured; cp "$at_stdout" stdout +at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:875" $at_failed && at_fn_log_failure $at_traceon; } +# 1. Check that the token locations are correct { set +x -$as_echo "$at_srcdir/java.at:739: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" -at_fn_check_prepare_notrace 'a shell pipeline' "java.at:739" -( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location' +$as_echo "$at_srcdir/javapush.at:877: cp -f ./locations ./expout" +at_fn_check_prepare_trace "javapush.at:877" +( $at_check_trace; cp -f ./locations ./expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:739" -$at_failed && at_fn_log_failure -$at_traceon; } - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_320 -#AT_START_321 -at_fn_group_banner 321 'java.at:748' \ - "Java syntax error handling without error token" " " 20 -at_xfail=no -( - $as_echo "321. $at_setup_line: testing $at_desc ..." - $at_traceon - -cat >YYParser.y <<'_ATEOF' -%language "Java" - -%lex-param { String s } - -%code imports { - import java.io.IOException; -} - -%code lexer { - String Input; - int Position; - - public YYLexer (String s) - { - Input = s; - Position = 0; - } - public void yyerror (String s) - { - System.err.println (s); - } - - public Object getLVal () - { - return null; - } - - public int yylex () throws IOException - { - if (Position >= Input.length ()) - return EOF; - else - return Input.charAt (Position++); - } -} - -%code { - public static void main (String args []) throws IOException - { - YYParser p = new YYParser (args [0]); - p.parse (); - } -} -%% -input: - 'a' 'a' -; -_ATEOF - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:799: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:799" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot YYParser.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:799" +at_fn_check_skip $at_status "$at_srcdir/javapush.at:877" $at_failed && at_fn_log_failure $at_traceon; } - { set +x -$as_echo "$at_srcdir/java.at:799: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y" "java.at:799" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml YYParser.y +{ set +x +$as_echo "$at_srcdir/javapush.at:878: sed -e '/^Next token.*\$/p' -e d ./stderr" +at_fn_check_prepare_dynamic "sed -e '/^Next token.*$/p' -e d ./stderr" "javapush.at:878" +( $at_check_trace; sed -e '/^Next token.*$/p' -e d ./stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:799" -$at_failed && at_fn_log_failure -$at_traceon; } - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/java.at:799: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:799" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:799" +at_fn_check_skip $at_status "$at_srcdir/javapush.at:878" $at_failed && at_fn_log_failure $at_traceon; } - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/java.at:799: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:799" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:799" -$at_failed && at_fn_log_failure -$at_traceon; } - - rm -rf xml-tests expout - at_restore_special_files -fi +# 2. Check that the calculator output matches that of a pull parser { set +x -$as_echo "$at_srcdir/java.at:799: bison YYParser.y" -at_fn_check_prepare_trace "java.at:799" -( $at_check_trace; bison YYParser.y +$as_echo "$at_srcdir/javapush.at:880: rm -f ./expout; cp -f ./output ./expout" +at_fn_check_prepare_trace "javapush.at:880" +( $at_check_trace; rm -f ./expout; cp -f ./output ./expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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:799" -$at_failed && at_fn_log_failure -$at_traceon; } - -$as_echo "java.at:800" >"$at_check_line_file" -(test -z "$CONF_JAVAC") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:800" -$as_echo "java.at:800" >"$at_check_line_file" -(test -z "$CONF_JAVA") \ - && at_fn_check_skip 77 "$at_srcdir/java.at:800" -{ set +x -$as_echo "$at_srcdir/java.at:800: \$SHELL ../../../javacomp.sh YYParser.java" -at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:800" -( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:800" +at_fn_check_skip $at_status "$at_srcdir/javapush.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/java.at:801: \$SHELL ../../../javaexec.sh YYParser aa" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser aa" "java.at:801" -( $at_check_trace; $SHELL ../../../javaexec.sh YYParser aa +$as_echo "$at_srcdir/javapush.at:881: cat ./stdout" +at_fn_check_prepare_trace "javapush.at:881" +( $at_check_trace; cat ./stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -at_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:801" -$at_failed && at_fn_log_failure -$at_traceon; } -{ set +x -$as_echo "$at_srcdir/java.at:802: \$SHELL ../../../javaexec.sh YYParser ab" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ab" "java.at:802" -( $at_check_trace; $SHELL ../../../javaexec.sh YYParser ab -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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/java.at:802" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/java.at:804: \$SHELL ../../../javaexec.sh YYParser ba" -at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ba" "java.at:804" -( $at_check_trace; $SHELL ../../../javaexec.sh YYParser ba -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -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/java.at:804" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_skip $at_status "$at_srcdir/javapush.at:881" $at_failed && at_fn_log_failure $at_traceon; } - set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_321 -#AT_START_322 -at_fn_group_banner 322 'cxx-type.at:394' \ - "GLR: Resolve ambiguity, impure, no locations" " " 21 +#AT_STOP_464 +#AT_START_465 +at_fn_group_banner 465 'cxx-type.at:394' \ + "GLR: Resolve ambiguity, impure, no locations" " " 24 at_xfail=no ( - $as_echo "322. $at_setup_line: testing $at_desc ..." + $as_echo "465. $at_setup_line: testing $at_desc ..." $at_traceon @@ -169194,7 +209472,9 @@ cat >types.y <<'_ATEOF' #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); } @@ -169221,19 +209501,19 @@ prog : stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -169254,16 +209534,17 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -169326,7 +209607,7 @@ int yylex (void) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } return tok; } @@ -169451,39 +209732,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:395" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:396: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:396" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:395" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:396" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:395" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:396: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:396" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:395" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:396" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/cxx-type.at:395: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:396: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:395" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:396" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -169492,16 +209773,16 @@ at_status=$? at_failed=false $at_check_filter 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:395" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:396" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/cxx-type.at:395: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:396: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:395" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:396" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -169510,7 +209791,7 @@ at_status=$? at_failed=false $at_check_filter 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:395" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:396" $at_failed && at_fn_log_failure $at_traceon; } @@ -169518,50 +209799,50 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:395: bison -o types.c types.y" -at_fn_check_prepare_trace "cxx-type.at:395" -( $at_check_trace; bison -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:396: bison -fno-caret -o types.c types.y" +at_fn_check_prepare_trace "cxx-type.at:396" +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:395" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:396" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:395: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:395" +$as_echo "$at_srcdir/cxx-type.at:396: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:396" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:395" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:396" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:395: \$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:395" +$as_echo "$at_srcdir/cxx-type.at:396: \$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:396" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:395" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:396" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:397: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:397" +$as_echo "$at_srcdir/cxx-type.at:398: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:398" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -169578,13 +209859,13 @@ echo >>"$at_stdout"; $as_echo "+(z,q) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:397" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:398" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:397" +$as_echo "$at_srcdir/cxx-type.at:398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:398" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -169593,7 +209874,7 @@ 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/cxx-type.at:397" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:398" $at_failed && at_fn_log_failure $at_traceon; } @@ -169602,13 +209883,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_322 -#AT_START_323 -at_fn_group_banner 323 'cxx-type.at:401' \ - "GLR: Resolve ambiguity, impure, locations" " " 21 +#AT_STOP_465 +#AT_START_466 +at_fn_group_banner 466 'cxx-type.at:401' \ + "GLR: Resolve ambiguity, impure, locations" " " 24 at_xfail=no ( - $as_echo "323. $at_setup_line: testing $at_desc ..." + $as_echo "466. $at_setup_line: testing $at_desc ..." $at_traceon @@ -169659,7 +209940,16 @@ cat >types.y <<'_ATEOF' #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror ( const char *msg); + #include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); static int yylex (void); } @@ -169689,19 +209979,19 @@ prog : stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -169722,18 +210012,48 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (yylloc)); + LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -169798,7 +210118,7 @@ int yylex (void) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } yylloc.last_column = colNum-1; return tok; @@ -169924,11 +210244,11 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \\ - --graph=xml-tests/test.dot -o types.c types.y" +$as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:402" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -169939,9 +210259,9 @@ $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:402" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:402" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -169991,9 +210311,9 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:402: bison -o types.c types.y" +$as_echo "$at_srcdir/cxx-type.at:402: bison -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:402" -( $at_check_trace; bison -o types.c types.y +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter @@ -170033,8 +210353,8 @@ $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:403: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:403" +$as_echo "$at_srcdir/cxx-type.at:404: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:404" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -170051,13 +210371,13 @@ echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q) 19.0-19.5: +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:403" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:404" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:403" +$as_echo "$at_srcdir/cxx-type.at:404: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:404" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -170066,7 +210386,7 @@ echo >>"$at_stderr"; $as_echo "17.5: 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/cxx-type.at:403" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:404" $at_failed && at_fn_log_failure $at_traceon; } @@ -170075,13 +210395,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_323 -#AT_START_324 -at_fn_group_banner 324 'cxx-type.at:407' \ - "GLR: Resolve ambiguity, pure, no locations" " " 21 +#AT_STOP_466 +#AT_START_467 +at_fn_group_banner 467 'cxx-type.at:407' \ + "GLR: Resolve ambiguity, pure, no locations" " " 24 at_xfail=no ( - $as_echo "324. $at_setup_line: testing $at_desc ..." + $as_echo "467. $at_setup_line: testing $at_desc ..." $at_traceon @@ -170132,7 +210452,9 @@ cat >types.y <<'_ATEOF' #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); } @@ -170159,19 +210481,19 @@ prog : stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -170192,16 +210514,17 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -170264,7 +210587,7 @@ int yylex (YYSTYPE *lvalp) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } return tok; } @@ -170389,39 +210712,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:408" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:409: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:409" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:408" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:409" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:408" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:409: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:409" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:408" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:409" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/cxx-type.at:408: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:409: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:408" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:409" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -170430,16 +210753,16 @@ at_status=$? at_failed=false $at_check_filter 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:408" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:409" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/cxx-type.at:408: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:409: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:408" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:409" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -170448,7 +210771,7 @@ at_status=$? at_failed=false $at_check_filter 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:408" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:409" $at_failed && at_fn_log_failure $at_traceon; } @@ -170456,50 +210779,50 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:408: bison -o types.c types.y" -at_fn_check_prepare_trace "cxx-type.at:408" -( $at_check_trace; bison -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:409: bison -fno-caret -o types.c types.y" +at_fn_check_prepare_trace "cxx-type.at:409" +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:408" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:409" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:408: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:408" +$as_echo "$at_srcdir/cxx-type.at:409: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:409" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:408" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:409" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:408: \$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:408" +$as_echo "$at_srcdir/cxx-type.at:409: \$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:409" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:408" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:409" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:410: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:410" +$as_echo "$at_srcdir/cxx-type.at:411: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:411" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -170516,13 +210839,13 @@ echo >>"$at_stdout"; $as_echo "+(z,q) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:410" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:411" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:410: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:410" +$as_echo "$at_srcdir/cxx-type.at:411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:411" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -170531,7 +210854,7 @@ 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/cxx-type.at:410" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:411" $at_failed && at_fn_log_failure $at_traceon; } @@ -170540,13 +210863,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_324 -#AT_START_325 -at_fn_group_banner 325 'cxx-type.at:414' \ - "GLR: Resolve ambiguity, pure, locations" " " 21 +#AT_STOP_467 +#AT_START_468 +at_fn_group_banner 468 'cxx-type.at:414' \ + "GLR: Resolve ambiguity, pure, locations" " " 24 at_xfail=no ( - $as_echo "325. $at_setup_line: testing $at_desc ..." + $as_echo "468. $at_setup_line: testing $at_desc ..." $at_traceon @@ -170597,7 +210920,16 @@ cat >types.y <<'_ATEOF' #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror (YYLTYPE const * const llocp, const char *msg); + #include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } @@ -170627,19 +210959,19 @@ prog : stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -170660,18 +210992,48 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror (YYLTYPE const * const llocp, const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { - YY_LOCATION_PRINT (stderr, (*llocp)); + LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -170736,7 +211098,7 @@ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } yylloc.last_column = colNum-1; return tok; @@ -170862,39 +211224,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:415" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:416: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:416" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:415" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:416" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:415" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:416: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:416" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:415" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:416" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/cxx-type.at:415: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:416: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:415" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:416" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -170903,16 +211265,16 @@ at_status=$? at_failed=false $at_check_filter 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:415" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:416" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/cxx-type.at:415: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:416: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:415" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:416" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -170921,7 +211283,7 @@ at_status=$? at_failed=false $at_check_filter 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:415" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:416" $at_failed && at_fn_log_failure $at_traceon; } @@ -170929,50 +211291,50 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:415: bison -o types.c types.y" -at_fn_check_prepare_trace "cxx-type.at:415" -( $at_check_trace; bison -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:416: bison -fno-caret -o types.c types.y" +at_fn_check_prepare_trace "cxx-type.at:416" +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:415" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:416" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:415: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:415" +$as_echo "$at_srcdir/cxx-type.at:416: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:416" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:415" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:416" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:415: \$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:415" +$as_echo "$at_srcdir/cxx-type.at:416: \$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:416" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:415" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:416" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:417: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:417" +$as_echo "$at_srcdir/cxx-type.at:418: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:418" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -170989,13 +211351,13 @@ echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q) 19.0-19.5: +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:417" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:418" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:417: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:417" +$as_echo "$at_srcdir/cxx-type.at:418: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:418" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -171004,7 +211366,7 @@ echo >>"$at_stderr"; $as_echo "17.5: 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/cxx-type.at:417" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:418" $at_failed && at_fn_log_failure $at_traceon; } @@ -171013,13 +211375,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_325 -#AT_START_326 -at_fn_group_banner 326 'cxx-type.at:421' \ - "GLR: Merge conflicting parses, impure, no locations" "" 21 +#AT_STOP_468 +#AT_START_469 +at_fn_group_banner 469 'cxx-type.at:421' \ + "GLR: Merge conflicting parses, impure, no locations" "" 24 at_xfail=no ( - $as_echo "326. $at_setup_line: testing $at_desc ..." + $as_echo "469. $at_setup_line: testing $at_desc ..." $at_traceon @@ -171070,7 +211432,9 @@ cat >types.y <<'_ATEOF' static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); } @@ -171097,19 +211461,19 @@ prog : stmt : expr ';' %merge { $$ = $1; } | decl %merge - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -171130,16 +211494,17 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -171202,7 +211567,7 @@ int yylex (void) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } return tok; } @@ -171292,7 +211657,7 @@ node_to_string (Node *node) static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { - return new_nterm ("(%s,%s)", x0, x1, YY_NULL); + return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF @@ -171332,39 +211697,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:422: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:422" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:423: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:423" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:422" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:423" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:422: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:422" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:423: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:423" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:422" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:423" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/cxx-type.at:422: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:423: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:422" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:423" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -171373,16 +211738,16 @@ at_status=$? at_failed=false $at_check_filter 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:422" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:423" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/cxx-type.at:422: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:423: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:422" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:423" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -171391,7 +211756,7 @@ at_status=$? at_failed=false $at_check_filter 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:422" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:423" $at_failed && at_fn_log_failure $at_traceon; } @@ -171399,50 +211764,50 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:422: bison -o types.c types.y" -at_fn_check_prepare_trace "cxx-type.at:422" -( $at_check_trace; bison -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:423: bison -fno-caret -o types.c types.y" +at_fn_check_prepare_trace "cxx-type.at:423" +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:422" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:423" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:422: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:422" +$as_echo "$at_srcdir/cxx-type.at:423: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:423" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:422" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:423" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:422: \$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:422" +$as_echo "$at_srcdir/cxx-type.at:423: \$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:423" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:422" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:423" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:424: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:424" +$as_echo "$at_srcdir/cxx-type.at:425: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:425" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -171459,13 +211824,13 @@ echo >>"$at_stdout"; $as_echo "+(z,q) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:424" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:425" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:424: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:424" +$as_echo "$at_srcdir/cxx-type.at:425: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:425" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -171474,7 +211839,7 @@ 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/cxx-type.at:424" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:425" $at_failed && at_fn_log_failure $at_traceon; } @@ -171483,13 +211848,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_326 -#AT_START_327 -at_fn_group_banner 327 'cxx-type.at:428' \ - "GLR: Merge conflicting parses, impure, locations" "" 21 +#AT_STOP_469 +#AT_START_470 +at_fn_group_banner 470 'cxx-type.at:428' \ + "GLR: Merge conflicting parses, impure, locations" "" 24 at_xfail=no ( - $as_echo "327. $at_setup_line: testing $at_desc ..." + $as_echo "470. $at_setup_line: testing $at_desc ..." $at_traceon @@ -171540,7 +211905,16 @@ cat >types.y <<'_ATEOF' static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror ( const char *msg); + #include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (const char *msg); static int yylex (void); } @@ -171570,19 +211944,19 @@ prog : stmt : expr ';' %merge { $$ = $1; } | decl %merge - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -171603,18 +211977,48 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { - YY_LOCATION_PRINT (stderr, (yylloc)); + LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -171679,7 +212083,7 @@ int yylex (void) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } yylloc.last_column = colNum-1; return tok; @@ -171770,7 +212174,7 @@ node_to_string (Node *node) static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { - return new_nterm ("(%s,%s)", x0, x1, YY_NULL); + return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF @@ -171810,39 +212214,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:429: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:429" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:430" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:429" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:429: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:429" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:430: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:430" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:429" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:430" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/cxx-type.at:429: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:430: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:429" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:430" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -171851,16 +212255,16 @@ at_status=$? at_failed=false $at_check_filter 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:429" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:430" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/cxx-type.at:429: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:430: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:429" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:430" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -171869,7 +212273,7 @@ at_status=$? at_failed=false $at_check_filter 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:429" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:430" $at_failed && at_fn_log_failure $at_traceon; } @@ -171877,50 +212281,50 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:429: bison -o types.c types.y" -at_fn_check_prepare_trace "cxx-type.at:429" -( $at_check_trace; bison -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:430: bison -fno-caret -o types.c types.y" +at_fn_check_prepare_trace "cxx-type.at:430" +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:429" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:429: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:429" +$as_echo "$at_srcdir/cxx-type.at:430: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:430" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:429" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:429: \$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:429" +$as_echo "$at_srcdir/cxx-type.at:430: \$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:430" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:429" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:431: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:431" +$as_echo "$at_srcdir/cxx-type.at:432: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:432" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -171937,13 +212341,13 @@ echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q) 19.0-19.5: +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:431" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:432" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:431" +$as_echo "$at_srcdir/cxx-type.at:432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:432" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -171952,7 +212356,7 @@ echo >>"$at_stderr"; $as_echo "17.5: 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/cxx-type.at:431" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:432" $at_failed && at_fn_log_failure $at_traceon; } @@ -171961,13 +212365,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_327 -#AT_START_328 -at_fn_group_banner 328 'cxx-type.at:435' \ - "GLR: Merge conflicting parses, pure, no locations" "" 21 +#AT_STOP_470 +#AT_START_471 +at_fn_group_banner 471 'cxx-type.at:435' \ + "GLR: Merge conflicting parses, pure, no locations" "" 24 at_xfail=no ( - $as_echo "328. $at_setup_line: testing $at_desc ..." + $as_echo "471. $at_setup_line: testing $at_desc ..." $at_traceon @@ -172018,7 +212422,9 @@ cat >types.y <<'_ATEOF' static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); } @@ -172045,19 +212451,19 @@ prog : stmt : expr ';' %merge { $$ = $1; } | decl %merge - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -172078,16 +212484,17 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -172150,7 +212557,7 @@ int yylex (YYSTYPE *lvalp) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } return tok; } @@ -172240,7 +212647,7 @@ node_to_string (Node *node) static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { - return new_nterm ("(%s,%s)", x0, x1, YY_NULL); + return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF @@ -172280,39 +212687,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:436: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:436" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:437: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:437" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:436" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:437" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:436: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:436" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:437: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:437" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:436" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:437" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/cxx-type.at:436: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:437: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:436" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:437" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -172321,16 +212728,16 @@ at_status=$? at_failed=false $at_check_filter 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:436" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:437" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/cxx-type.at:436: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:437: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:436" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:437" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -172339,7 +212746,7 @@ at_status=$? at_failed=false $at_check_filter 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:436" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:437" $at_failed && at_fn_log_failure $at_traceon; } @@ -172347,50 +212754,50 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:436: bison -o types.c types.y" -at_fn_check_prepare_trace "cxx-type.at:436" -( $at_check_trace; bison -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:437: bison -fno-caret -o types.c types.y" +at_fn_check_prepare_trace "cxx-type.at:437" +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:436" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:437" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:436: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:436" +$as_echo "$at_srcdir/cxx-type.at:437: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:437" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:436" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:437" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:436: \$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:436" +$as_echo "$at_srcdir/cxx-type.at:437: \$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:437" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:436" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:437" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:438: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:438" +$as_echo "$at_srcdir/cxx-type.at:439: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:439" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -172407,13 +212814,13 @@ echo >>"$at_stdout"; $as_echo "+(z,q) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:438" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:439" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:438: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:438" +$as_echo "$at_srcdir/cxx-type.at:439: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:439" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -172422,7 +212829,7 @@ 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/cxx-type.at:438" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:439" $at_failed && at_fn_log_failure $at_traceon; } @@ -172431,13 +212838,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_328 -#AT_START_329 -at_fn_group_banner 329 'cxx-type.at:441' \ - "GLR: Merge conflicting parses, pure, locations" " " 21 +#AT_STOP_471 +#AT_START_472 +at_fn_group_banner 472 'cxx-type.at:441' \ + "GLR: Merge conflicting parses, pure, locations" " " 24 at_xfail=no ( - $as_echo "329. $at_setup_line: testing $at_desc ..." + $as_echo "472. $at_setup_line: testing $at_desc ..." $at_traceon @@ -172488,7 +212895,16 @@ cat >types.y <<'_ATEOF' static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror (YYLTYPE const * const llocp, const char *msg); + #include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } @@ -172518,19 +212934,19 @@ prog : stmt : expr ';' %merge { $$ = $1; } | decl %merge - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -172551,18 +212967,48 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror (YYLTYPE const * const llocp, const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { - YY_LOCATION_PRINT (stderr, (*llocp)); + LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -172627,7 +213073,7 @@ int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } yylloc.last_column = colNum-1; return tok; @@ -172718,7 +213164,7 @@ node_to_string (Node *node) static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { - return new_nterm ("(%s,%s)", x0, x1, YY_NULL); + return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF @@ -172758,39 +213204,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:442" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:443: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:443" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:442" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:443" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:442" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:443: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:443" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:442" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:443" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/cxx-type.at:442: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:443: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:442" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:443" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -172799,16 +213245,16 @@ at_status=$? at_failed=false $at_check_filter 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:442" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:443" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/cxx-type.at:442: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:443: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:442" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:443" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -172817,7 +213263,7 @@ at_status=$? at_failed=false $at_check_filter 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:442" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:443" $at_failed && at_fn_log_failure $at_traceon; } @@ -172825,50 +213271,50 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:442: bison -o types.c types.y" -at_fn_check_prepare_trace "cxx-type.at:442" -( $at_check_trace; bison -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:443: bison -fno-caret -o types.c types.y" +at_fn_check_prepare_trace "cxx-type.at:443" +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:442" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:443" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:442: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:442" +$as_echo "$at_srcdir/cxx-type.at:443: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:443" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:442" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:443" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:442: \$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:442" +$as_echo "$at_srcdir/cxx-type.at:443: \$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:443" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:442" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:443" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:444: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:444" +$as_echo "$at_srcdir/cxx-type.at:445: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:445" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -172885,13 +213331,13 @@ echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q) 19.0-19.5: +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:444" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:445" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:444: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:444" +$as_echo "$at_srcdir/cxx-type.at:445: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:445" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -172900,7 +213346,7 @@ echo >>"$at_stderr"; $as_echo "17.5: 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/cxx-type.at:444" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:445" $at_failed && at_fn_log_failure $at_traceon; } @@ -172909,13 +213355,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_329 -#AT_START_330 -at_fn_group_banner 330 'cxx-type.at:448' \ - "GLR: Verbose messages, resolve ambiguity, impure, no locations" "" 21 +#AT_STOP_472 +#AT_START_473 +at_fn_group_banner 473 'cxx-type.at:448' \ + "GLR: Verbose messages, resolve ambiguity, impure, no locations" "" 24 at_xfail=no ( - $as_echo "330. $at_setup_line: testing $at_desc ..." + $as_echo "473. $at_setup_line: testing $at_desc ..." $at_traceon @@ -172966,7 +213412,9 @@ cat >types.y <<'_ATEOF' static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1); #define YYINITDEPTH 10 #define YYSTACKEXPANDABLE 1 - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); } @@ -172993,19 +213441,19 @@ prog : stmt : expr ';' %merge { $$ = $1; } | decl %merge - | error ';' { $$ = new_nterm ("", YY_NULL, YY_NULL, YY_NULL); } + | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' - { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULL); } - | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULL); } - | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } + | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } + | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' - { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULL); } + { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | TYPENAME declarator '=' expr ';' { $$ = new_nterm ("(%s,%s,%s)", $1, $2, $4); } @@ -173026,16 +213474,17 @@ declarator : ID int main (int argc, char **argv) { - assert (argc == 2); + assert (argc == 2); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -173098,7 +213547,7 @@ int yylex (void) { colNum += 1; tok = c; - yylval = YY_NULL; + yylval = YY_NULLPTR; } return tok; } @@ -173188,7 +213637,7 @@ node_to_string (Node *node) static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { - return new_nterm ("(%s,%s)", x0, x1, YY_NULL); + return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF @@ -173228,39 +213677,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:449" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:450" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:449" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:450" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:449" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:450" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:449" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:450" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/cxx-type.at:449: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:450: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:449" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:450" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -173269,16 +213718,16 @@ at_status=$? at_failed=false $at_check_filter 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:449" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:450" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/cxx-type.at:449: \$XSLTPROC \\ +$as_echo "$at_srcdir/cxx-type.at:450: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:449" +at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:450" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -173287,7 +213736,7 @@ at_status=$? at_failed=false $at_check_filter 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:449" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:450" $at_failed && at_fn_log_failure $at_traceon; } @@ -173295,50 +213744,50 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/cxx-type.at:449: bison -o types.c types.y" -at_fn_check_prepare_trace "cxx-type.at:449" -( $at_check_trace; bison -o types.c types.y +$as_echo "$at_srcdir/cxx-type.at:450: bison -fno-caret -o types.c types.y" +at_fn_check_prepare_trace "cxx-type.at:450" +( $at_check_trace; bison -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- 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:449" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:450" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:449: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:449" +$as_echo "$at_srcdir/cxx-type.at:450: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:450" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:449" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:450" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:449: \$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:449" +$as_echo "$at_srcdir/cxx-type.at:450: \$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:450" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:449" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:450" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:451: \$PREPARSER ./types test-input" -at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:451" +$as_echo "$at_srcdir/cxx-type.at:452: \$PREPARSER ./types test-input" +at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:452" ( $at_check_trace; $PREPARSER ./types test-input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -173355,13 +213804,13 @@ echo >>"$at_stdout"; $as_echo "+(z,q) +(z,q) " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:451" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:452" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/cxx-type.at:451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "cxx-type.at:451" +$as_echo "$at_srcdir/cxx-type.at:452: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "cxx-type.at:452" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -173370,7 +213819,7 @@ echo >>"$at_stderr"; $as_echo "syntax error, unexpected ID, expecting '=' or '+' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:451" +at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:452" $at_failed && at_fn_log_failure $at_traceon; } @@ -173379,13 +213828,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_330 -#AT_START_331 -at_fn_group_banner 331 'glr-regression.at:25' \ - "Badly Collapsed GLR States" " " 22 +#AT_STOP_473 +#AT_START_474 +at_fn_group_banner 474 'glr-regression.at:25' \ + "Badly Collapsed GLR States" " " 25 at_xfail=no ( - $as_echo "331. $at_setup_line: testing $at_desc ..." + $as_echo "474. $at_setup_line: testing $at_desc ..." $at_traceon @@ -173409,7 +213858,9 @@ cat >glr-regr1.y <<'_ATEOF' #define YYSTYPE int static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1); -static void yyerror ( const char *msg); +#include + +static void yyerror (const char *msg); static int yylex (void); %} @@ -173440,20 +213891,21 @@ static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1) return 0; } -const char *input = YY_NULL; +const char *input = YY_NULLPTR; int main (int argc, const char* argv[]) { - assert (argc == 2); + assert (argc == 2); (void) argc; input = argv[1]; return yyparse (); } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -173474,39 +213926,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:90" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y +$as_echo "$at_srcdir/glr-regression.at:92: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:92" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:90" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y" "glr-regression.at:90" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y +$as_echo "$at_srcdir/glr-regression.at:92: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y" "glr-regression.at:92" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:90" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:90: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:92: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:90" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:92" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -173515,16 +213967,16 @@ at_status=$? at_failed=false $at_check_filter 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:90" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:90: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:92: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:90" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:92" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -173533,7 +213985,7 @@ at_status=$? at_failed=false $at_check_filter 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:90" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } @@ -173541,21 +213993,114 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:90: bison -o glr-regr1.c glr-regr1.y" -at_fn_check_prepare_trace "glr-regression.at:90" -( $at_check_trace; bison -o glr-regr1.c glr-regr1.y +$as_echo "$at_srcdir/glr-regression.at:92: bison -fno-caret -o glr-regr1.c glr-regr1.y" +at_fn_check_prepare_trace "glr-regression.at:92" +( $at_check_trace; bison -fno-caret -o glr-regr1.c glr-regr1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr1.y: conflicts: 1 shift/reduce +echo >>"$at_stderr"; $as_echo "glr-regr1.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] " | \ $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:90" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:92: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Werror" "glr-regression.at:92" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:92" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr1.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:92: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:92" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:92" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:92: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=error" "glr-regression.at:92" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:92" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:92: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Wnone -Werror" "glr-regression.at:92" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:92" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:92: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=none -Werror" "glr-regression.at:92" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:92" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x $as_echo "$at_srcdir/glr-regression.at:93: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:93" @@ -173583,8 +214128,8 @@ $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:94: \$PREPARSER ./glr-regr1 BPBPB" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr1 BPBPB" "glr-regression.at:94" +$as_echo "$at_srcdir/glr-regression.at:104: \$PREPARSER ./glr-regr1 BPBPB" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr1 BPBPB" "glr-regression.at:104" ( $at_check_trace; $PREPARSER ./glr-regr1 BPBPB ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -173601,20 +214146,20 @@ E -> E 'P' E " | \ $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:94" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:104" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:94: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:94" +$as_echo "$at_srcdir/glr-regression.at:104: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:104" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:94" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:104" $at_failed && at_fn_log_failure $at_traceon; } @@ -173624,13 +214169,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_331 -#AT_START_332 -at_fn_group_banner 332 'glr-regression.at:112' \ - "Improper handling of embedded actions and dollar(-N) in GLR parsers" "" 22 +#AT_STOP_474 +#AT_START_475 +at_fn_group_banner 475 'glr-regression.at:112' \ + "Improper handling of embedded actions and dollar(-N) in GLR parsers" "" 25 at_xfail=no ( - $as_echo "332. $at_setup_line: testing $at_desc ..." + $as_echo "475. $at_setup_line: testing $at_desc ..." $at_traceon @@ -173655,7 +214200,9 @@ cat >glr-regr2a.y <<'_ATEOF' #include #include #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); %} @@ -173696,10 +214243,11 @@ var_printer: 'v' { printf ("Variable: '%s'\n", $-1); } %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -173752,39 +214300,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:210" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y +$as_echo "$at_srcdir/glr-regression.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:212" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:210" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:212" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y" "glr-regression.at:210" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y +$as_echo "$at_srcdir/glr-regression.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y" "glr-regression.at:212" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:210" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:212" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:210: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:212: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:210" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:212" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -173793,16 +214341,16 @@ at_status=$? at_failed=false $at_check_filter 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:210" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:212" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:210: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:212: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:210" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:212" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -173811,7 +214359,7 @@ at_status=$? at_failed=false $at_check_filter 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:210" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:212" $at_failed && at_fn_log_failure $at_traceon; } @@ -173819,21 +214367,114 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:210: bison -o glr-regr2a.c glr-regr2a.y" -at_fn_check_prepare_trace "glr-regression.at:210" -( $at_check_trace; bison -o glr-regr2a.c glr-regr2a.y +$as_echo "$at_srcdir/glr-regression.at:212: bison -fno-caret -o glr-regr2a.c glr-regr2a.y" +at_fn_check_prepare_trace "glr-regression.at:212" +( $at_check_trace; bison -fno-caret -o glr-regr2a.c glr-regr2a.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr2a.y: conflicts: 2 shift/reduce +echo >>"$at_stderr"; $as_echo "glr-regr2a.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] " | \ $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:210" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:212" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Werror" "glr-regression.at:212" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:212" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr2a.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:212: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:212" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:212" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=error" "glr-regression.at:212" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:212" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Wnone -Werror" "glr-regression.at:212" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:212" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=none -Werror" "glr-regression.at:212" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:212" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x $as_echo "$at_srcdir/glr-regression.at:213: \$BISON_C_WORKS" at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:213" @@ -173866,8 +214507,8 @@ s VARIABLE_1 t v x q _ATEOF { set +x -$as_echo "$at_srcdir/glr-regression.at:218: \$PREPARSER ./glr-regr2a input1.txt" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input1.txt" "glr-regression.at:218" +$as_echo "$at_srcdir/glr-regression.at:220: \$PREPARSER ./glr-regr2a input1.txt" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input1.txt" "glr-regression.at:220" ( $at_check_trace; $PREPARSER ./glr-regr2a input1.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -173876,20 +214517,20 @@ echo stderr:; tee stderr <"$at_stderr" 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:218" +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:218: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:218" +$as_echo "$at_srcdir/glr-regression.at:220: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:220" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:218" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:220" $at_failed && at_fn_log_failure $at_traceon; } @@ -173900,8 +214541,8 @@ s VARIABLE_1 , ANOTHER_VARIABLE_2 t e _ATEOF { set +x -$as_echo "$at_srcdir/glr-regression.at:225: \$PREPARSER ./glr-regr2a input2.txt" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input2.txt" "glr-regression.at:225" +$as_echo "$at_srcdir/glr-regression.at:228: \$PREPARSER ./glr-regr2a input2.txt" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input2.txt" "glr-regression.at:228" ( $at_check_trace; $PREPARSER ./glr-regr2a input2.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -173910,20 +214551,20 @@ echo stderr:; tee stderr <"$at_stderr" 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:225" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:225: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:225" +$as_echo "$at_srcdir/glr-regression.at:228: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:228" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:225" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:228" $at_failed && at_fn_log_failure $at_traceon; } @@ -173934,8 +214575,8 @@ s VARIABLE_3 t v x _ATEOF { set +x -$as_echo "$at_srcdir/glr-regression.at:233: \$PREPARSER ./glr-regr2a input3.txt" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input3.txt" "glr-regression.at:233" +$as_echo "$at_srcdir/glr-regression.at:235: \$PREPARSER ./glr-regr2a input3.txt" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input3.txt" "glr-regression.at:235" ( $at_check_trace; $PREPARSER ./glr-regr2a input3.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -173944,20 +214585,20 @@ echo stderr:; tee stderr <"$at_stderr" 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:233" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:235" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:233: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:233" +$as_echo "$at_srcdir/glr-regression.at:235: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:235" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:233" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:235" $at_failed && at_fn_log_failure $at_traceon; } @@ -173968,13 +214609,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_332 -#AT_START_333 -at_fn_group_banner 333 'glr-regression.at:244' \ - "Improper merging of GLR delayed action sets" " " 22 +#AT_STOP_475 +#AT_START_476 +at_fn_group_banner 476 'glr-regression.at:244' \ + "Improper merging of GLR delayed action sets" " " 25 at_xfail=no ( - $as_echo "333. $at_setup_line: testing $at_desc ..." + $as_echo "476. $at_setup_line: testing $at_desc ..." $at_traceon @@ -173998,7 +214639,9 @@ cat >glr-regr3.y <<'_ATEOF' #include static int MergeRule (int x0, int x1); -static void yyerror ( const char *msg); +#include + +static void yyerror (const char *msg); static int yylex (void); #define RULE(x) (1 << (x)) @@ -174045,15 +214688,16 @@ MergeRule (int x0, int x1) { return x0 | x1; } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } -FILE *input = YY_NULL; +FILE *input = YY_NULLPTR; int P[] = { P1, P2 }; int O[] = { O1, O2 }; @@ -174075,7 +214719,7 @@ int yylex (void) } int -main(int argc, char* argv[]) +main (int argc, char* argv[]) { int res; input = stdin; @@ -174097,39 +214741,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:343" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y +$as_echo "$at_srcdir/glr-regression.at:346: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:346" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:343" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y" "glr-regression.at:343" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y +$as_echo "$at_srcdir/glr-regression.at:346: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y" "glr-regression.at:346" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:343" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:343: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:346: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:343" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:346" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -174138,16 +214782,16 @@ at_status=$? at_failed=false $at_check_filter 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:343" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:343: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:346: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:343" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:346" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -174156,7 +214800,7 @@ at_status=$? at_failed=false $at_check_filter 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:343" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346" $at_failed && at_fn_log_failure $at_traceon; } @@ -174164,44 +214808,139 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:343: bison -o glr-regr3.c glr-regr3.y" -at_fn_check_prepare_trace "glr-regression.at:343" -( $at_check_trace; bison -o glr-regr3.c glr-regr3.y +$as_echo "$at_srcdir/glr-regression.at:346: bison -fno-caret -o glr-regr3.c glr-regr3.y" +at_fn_check_prepare_trace "glr-regression.at:346" +( $at_check_trace; bison -fno-caret -o glr-regr3.c glr-regr3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr3.y: conflicts: 1 shift/reduce, 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] +glr-regr3.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:343" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:346" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:346: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Werror" "glr-regression.at:346" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:346" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] +glr-regr3.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:346: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:346" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:346" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:346: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=error" "glr-regression.at:346" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:346" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:346: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Wnone -Werror" "glr-regression.at:346" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:346" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:346: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=none -Werror" "glr-regression.at:346" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:346" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:346: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:346" +$as_echo "$at_srcdir/glr-regression.at:347: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:347" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:346" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:347" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:346: \$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:346" +$as_echo "$at_srcdir/glr-regression.at:347: \$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:347" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:346" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:347" $at_failed && at_fn_log_failure $at_traceon; } @@ -174211,8 +214950,8 @@ p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2 _ATEOF { set +x -$as_echo "$at_srcdir/glr-regression.at:351: \$PREPARSER ./glr-regr3 input.txt" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr3 input.txt" "glr-regression.at:351" +$as_echo "$at_srcdir/glr-regression.at:355: \$PREPARSER ./glr-regr3 input.txt" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr3 input.txt" "glr-regression.at:355" ( $at_check_trace; $PREPARSER ./glr-regr3 input.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -174221,20 +214960,20 @@ echo stderr:; tee stderr <"$at_stderr" 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:351" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:355" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:351" +$as_echo "$at_srcdir/glr-regression.at:355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:355" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:351" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:355" $at_failed && at_fn_log_failure $at_traceon; } @@ -174244,13 +214983,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_333 -#AT_START_334 -at_fn_group_banner 334 'glr-regression.at:364' \ - "Duplicate representation of merged trees" " " 22 +#AT_STOP_476 +#AT_START_477 +at_fn_group_banner 477 'glr-regression.at:365' \ + "Duplicate representation of merged trees" " " 25 at_xfail=no ( - $as_echo "334. $at_setup_line: testing $at_desc ..." + $as_echo "477. $at_setup_line: testing $at_desc ..." $at_traceon @@ -174275,7 +215014,9 @@ cat >glr-regr4.y <<'_ATEOF' #include static char *merge (YYSTYPE, YYSTYPE); static char *make_value (char const *, char const *); - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); static char *ptrs[100]; static char **ptrs_next = ptrs; @@ -174300,10 +215041,11 @@ A2: 'a' { $$ = make_value ("A2", "'a'"); } ; B: 'a' { $$ = make_value ("B", "'a'"); } ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -174360,39 +215102,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:438" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y +$as_echo "$at_srcdir/glr-regression.at:441: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:441" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:438" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:438: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y" "glr-regression.at:438" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y +$as_echo "$at_srcdir/glr-regression.at:441: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y" "glr-regression.at:441" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:438" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:438: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:441: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:438" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:441" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -174401,16 +215143,16 @@ at_status=$? at_failed=false $at_check_filter 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:438" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:438: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:441: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:438" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:441" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -174419,7 +215161,7 @@ at_status=$? at_failed=false $at_check_filter 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:438" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441" $at_failed && at_fn_log_failure $at_traceon; } @@ -174427,51 +215169,144 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:438: bison -o glr-regr4.c glr-regr4.y" -at_fn_check_prepare_trace "glr-regression.at:438" -( $at_check_trace; bison -o glr-regr4.c glr-regr4.y +$as_echo "$at_srcdir/glr-regression.at:441: bison -fno-caret -o glr-regr4.c glr-regr4.y" +at_fn_check_prepare_trace "glr-regression.at:441" +( $at_check_trace; bison -fno-caret -o glr-regr4.c glr-regr4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr4.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr4.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:438" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:441" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:441: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Werror" "glr-regression.at:441" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:441" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr4.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:441: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:441" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:441" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:441: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=error" "glr-regression.at:441" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:441" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:441: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Wnone -Werror" "glr-regression.at:441" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:441" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:441: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=none -Werror" "glr-regression.at:441" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:441" $at_failed && at_fn_log_failure $at_traceon; } + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:441: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:441" +$as_echo "$at_srcdir/glr-regression.at:442: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:442" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:441" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:442" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:441: \$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:441" +$as_echo "$at_srcdir/glr-regression.at:442: \$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:442" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:441" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:442" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:443: \$PREPARSER ./glr-regr4" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr4" "glr-regression.at:443" +$as_echo "$at_srcdir/glr-regression.at:446: \$PREPARSER ./glr-regr4" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr4" "glr-regression.at:446" ( $at_check_trace; $PREPARSER ./glr-regr4 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -174480,20 +215315,20 @@ echo stderr:; tee stderr <"$at_stderr" 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:443" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:446" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:443: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:443" +$as_echo "$at_srcdir/glr-regression.at:446: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:446" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:443" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:446" $at_failed && at_fn_log_failure $at_traceon; } @@ -174503,13 +215338,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_334 -#AT_START_335 -at_fn_group_banner 335 'glr-regression.at:455' \ - "User destructor for unresolved GLR semantic value" "" 22 +#AT_STOP_477 +#AT_START_478 +at_fn_group_banner 478 'glr-regression.at:456' \ + "User destructor for unresolved GLR semantic value" "" 25 at_xfail=no ( - $as_echo "335. $at_setup_line: testing $at_desc ..." + $as_echo "478. $at_setup_line: testing $at_desc ..." $at_traceon @@ -174527,7 +215362,9 @@ cat >glr-regr5.y <<'_ATEOF' %{ #include #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); enum { MAGIC_VALUE = -1057808125 }; /* originally chosen at random */ %} @@ -174552,10 +215389,11 @@ start: ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -174572,10 +215410,14 @@ int yylex (void) ; return res; } +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) { - return yyparse () != 1; + (void) argc; + (void) argv; + return yyparse (); } _ATEOF @@ -174588,39 +215430,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:498" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y +$as_echo "$at_srcdir/glr-regression.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:497" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:498" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:498: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y" "glr-regression.at:498" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y +$as_echo "$at_srcdir/glr-regression.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y" "glr-regression.at:497" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:498" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:498: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:497: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:498" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:497" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -174629,16 +215471,16 @@ at_status=$? at_failed=false $at_check_filter 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:498" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:498: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:497: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:498" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:497" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -174647,7 +215489,7 @@ at_status=$? at_failed=false $at_check_filter 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:498" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:497" $at_failed && at_fn_log_failure $at_traceon; } @@ -174655,64 +215497,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:498: bison -o glr-regr5.c glr-regr5.y" -at_fn_check_prepare_trace "glr-regression.at:498" -( $at_check_trace; bison -o glr-regr5.c glr-regr5.y +$as_echo "$at_srcdir/glr-regression.at:497: bison -fno-caret -o glr-regr5.c glr-regr5.y" +at_fn_check_prepare_trace "glr-regression.at:497" +( $at_check_trace; bison -fno-caret -o glr-regr5.c glr-regr5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr5.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr5.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:498" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:497" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Werror" "glr-regression.at:497" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:497" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr5.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:497: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:497" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:497" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=error" "glr-regression.at:497" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:497" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Wnone -Werror" "glr-regression.at:497" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:497" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:497: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=none -Werror" "glr-regression.at:497" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:497" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:501: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:501" +$as_echo "$at_srcdir/glr-regression.at:498: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:498" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:501" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:501: \$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:501" +$as_echo "$at_srcdir/glr-regression.at:498: \$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:498" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:501" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:503: \$PREPARSER ./glr-regr5" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr5" "glr-regression.at:503" +$as_echo "$at_srcdir/glr-regression.at:502: \$PREPARSER ./glr-regr5" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr5" "glr-regression.at:502" ( $at_check_trace; $PREPARSER ./glr-regr5 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:503" +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:502" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:503: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:503" +$as_echo "$at_srcdir/glr-regression.at:502: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:502" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -174721,7 +215656,7 @@ 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:503" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:502" $at_failed && at_fn_log_failure $at_traceon; } @@ -174731,13 +215666,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_335 -#AT_START_336 -at_fn_group_banner 336 'glr-regression.at:515' \ - "User destructor after an error during a split parse" "" 22 +#AT_STOP_478 +#AT_START_479 +at_fn_group_banner 479 'glr-regression.at:512' \ + "User destructor after an error during a split parse" "" 25 at_xfail=no ( - $as_echo "336. $at_setup_line: testing $at_desc ..." + $as_echo "479. $at_setup_line: testing $at_desc ..." $at_traceon @@ -174755,7 +215690,9 @@ cat >glr-regr6.y <<'_ATEOF' %{ #include #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); %} @@ -174772,10 +215709,11 @@ cat >glr-regr6.y <<'_ATEOF' start: 'a' | 'a' ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -174792,10 +215730,14 @@ int yylex (void) ; return res; } +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) { - return yyparse () != 1; + (void) argc; + (void) argv; + return yyparse (); } _ATEOF @@ -174808,39 +215750,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:550" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y +$as_echo "$at_srcdir/glr-regression.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:550" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:545" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:550: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y" "glr-regression.at:550" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y +$as_echo "$at_srcdir/glr-regression.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y" "glr-regression.at:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:550" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:545" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:550: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:545: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:550" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:545" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -174849,16 +215791,16 @@ at_status=$? at_failed=false $at_check_filter 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:550" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:545" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:550: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:545: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:550" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:545" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -174867,7 +215809,7 @@ at_status=$? at_failed=false $at_check_filter 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:550" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:545" $at_failed && at_fn_log_failure $at_traceon; } @@ -174875,51 +215817,144 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:550: bison -o glr-regr6.c glr-regr6.y" -at_fn_check_prepare_trace "glr-regression.at:550" -( $at_check_trace; bison -o glr-regr6.c glr-regr6.y +$as_echo "$at_srcdir/glr-regression.at:545: bison -fno-caret -o glr-regr6.c glr-regr6.y" +at_fn_check_prepare_trace "glr-regression.at:545" +( $at_check_trace; bison -fno-caret -o glr-regr6.c glr-regr6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr6.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr6.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:550" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:545" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Werror" "glr-regression.at:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:545" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr6.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:545: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:545" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:545" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=error" "glr-regression.at:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:545" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Wnone -Werror" "glr-regression.at:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:545" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=none -Werror" "glr-regression.at:545" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:545" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:553: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:553" +$as_echo "$at_srcdir/glr-regression.at:546: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:546" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:553" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:546" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:553: \$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:553" +$as_echo "$at_srcdir/glr-regression.at:546: \$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:546" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:553" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:546" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:555: \$PREPARSER ./glr-regr6" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr6" "glr-regression.at:555" +$as_echo "$at_srcdir/glr-regression.at:552: \$PREPARSER ./glr-regr6" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr6" "glr-regression.at:552" ( $at_check_trace; $PREPARSER ./glr-regr6 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -174928,13 +215963,13 @@ echo stderr:; tee stderr <"$at_stderr" 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:555" +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:555: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:555" +$as_echo "$at_srcdir/glr-regression.at:552: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:552" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -174943,7 +215978,7 @@ 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:555" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:552" $at_failed && at_fn_log_failure $at_traceon; } @@ -174953,13 +215988,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_336 -#AT_START_337 -at_fn_group_banner 337 'glr-regression.at:569' \ - "Duplicated user destructor for lookahead" " " 22 +#AT_STOP_479 +#AT_START_480 +at_fn_group_banner 480 'glr-regression.at:562' \ + "Duplicated user destructor for lookahead" " " 25 at_xfail=no ( - $as_echo "337. $at_setup_line: testing $at_desc ..." + $as_echo "480. $at_setup_line: testing $at_desc ..." $at_traceon @@ -174977,7 +216012,9 @@ cat >glr-regr7.y <<'_ATEOF' %{ #include #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); #define YYSTACKEXPANDABLE 0 typedef struct count_node { @@ -175023,10 +216060,11 @@ yylex (void) return 'a'; } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -175053,39 +216091,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:639" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y +$as_echo "$at_srcdir/glr-regression.at:634: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:634" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:639" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:634" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y" "glr-regression.at:639" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y +$as_echo "$at_srcdir/glr-regression.at:634: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y" "glr-regression.at:634" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:639" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:634" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:639: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:634: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:639" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:634" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -175094,16 +216132,16 @@ at_status=$? at_failed=false $at_check_filter 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:639" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:634" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:639: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:634: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:639" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:634" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -175112,7 +216150,7 @@ at_status=$? at_failed=false $at_check_filter 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:639" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:634" $at_failed && at_fn_log_failure $at_traceon; } @@ -175120,64 +216158,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:639: bison -o glr-regr7.c glr-regr7.y" -at_fn_check_prepare_trace "glr-regression.at:639" -( $at_check_trace; bison -o glr-regr7.c glr-regr7.y +$as_echo "$at_srcdir/glr-regression.at:634: bison -fno-caret -o glr-regr7.c glr-regr7.y" +at_fn_check_prepare_trace "glr-regression.at:634" +( $at_check_trace; bison -fno-caret -o glr-regr7.c glr-regr7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr7.y: conflicts: 2 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr7.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] " | \ $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:639" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:634" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:634: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Werror" "glr-regression.at:634" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:634" $at_failed && at_fn_log_failure $at_traceon; } + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr7.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:634: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:634" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:634" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:634: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=error" "glr-regression.at:634" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:634" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:634: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Wnone -Werror" "glr-regression.at:634" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:634" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:634: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=none -Werror" "glr-regression.at:634" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:634" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:642: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:642" +$as_echo "$at_srcdir/glr-regression.at:635: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:635" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:635" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:642: \$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:642" +$as_echo "$at_srcdir/glr-regression.at:635: \$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:635" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:642" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:635" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:644: \$PREPARSER ./glr-regr7" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr7" "glr-regression.at:644" +$as_echo "$at_srcdir/glr-regression.at:639: \$PREPARSER ./glr-regr7" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr7" "glr-regression.at:639" ( $at_check_trace; $PREPARSER ./glr-regr7 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 2 $at_status "$at_srcdir/glr-regression.at:644" +at_fn_check_status 2 $at_status "$at_srcdir/glr-regression.at:639" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:644" +$as_echo "$at_srcdir/glr-regression.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:639" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -175186,7 +216317,7 @@ 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:644" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:639" $at_failed && at_fn_log_failure $at_traceon; } @@ -175196,13 +216327,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_337 -#AT_START_338 -at_fn_group_banner 338 'glr-regression.at:658' \ - "Incorrectly initialized location for empty right-hand side in GLR" "" 22 +#AT_STOP_480 +#AT_START_481 +at_fn_group_banner 481 'glr-regression.at:651' \ + "Incorrectly initialized location for empty right-hand side in GLR" "" 25 at_xfail=no ( - $as_echo "338. $at_setup_line: testing $at_desc ..." + $as_echo "481. $at_setup_line: testing $at_desc ..." $at_traceon @@ -175220,7 +216351,9 @@ cat >glr-regr8.y <<'_ATEOF' %{ #include #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); %} @@ -175233,32 +216366,33 @@ cat >glr-regr8.y <<'_ATEOF' %% -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); } - ; +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 - ; +InterfaceDeclaration : OptConstantWord %dprec 1 + | OptSignalWord %dprec 2 + ; -OptConstantWord : /* empty */ - | T_CONSTANT - ; +OptConstantWord : /* empty */ + | T_CONSTANT + ; -OptSignalWord : /* empty */ - { printf("empty: %d/%d\n", @$.first_column, @$.last_column); } - | T_SIGNAL - ; +OptSignalWord : /* empty */ + { printf("empty: %d/%d\n", @$.first_column, @$.last_column); } + | T_SIGNAL + ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -175284,11 +216418,14 @@ int yylex (void) } } +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) { - yyparse(); - return 0; + (void) argc; + (void) argv; + return yyparse (); } _ATEOF @@ -175301,39 +216438,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:733: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:733" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y +$as_echo "$at_srcdir/glr-regression.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:723" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:733" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:723" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:733: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y" "glr-regression.at:733" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y +$as_echo "$at_srcdir/glr-regression.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y" "glr-regression.at:723" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:733" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:723" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:733: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:723: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:733" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:723" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -175342,16 +216479,16 @@ at_status=$? at_failed=false $at_check_filter 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:733" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:723" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:733: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:723: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:733" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:723" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -175360,7 +216497,7 @@ at_status=$? at_failed=false $at_check_filter 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:733" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:723" $at_failed && at_fn_log_failure $at_traceon; } @@ -175368,51 +216505,144 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:733: bison -o glr-regr8.c glr-regr8.y" -at_fn_check_prepare_trace "glr-regression.at:733" -( $at_check_trace; bison -o glr-regr8.c glr-regr8.y +$as_echo "$at_srcdir/glr-regression.at:723: bison -fno-caret -o glr-regr8.c glr-regr8.y" +at_fn_check_prepare_trace "glr-regression.at:723" +( $at_check_trace; bison -fno-caret -o glr-regr8.c glr-regr8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr8.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr8.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:733" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Werror" "glr-regression.at:723" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr8.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:723: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:723" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:723" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=error" "glr-regression.at:723" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Wnone -Werror" "glr-regression.at:723" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=none -Werror" "glr-regression.at:723" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:723" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:736: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:736" +$as_echo "$at_srcdir/glr-regression.at:724: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:724" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:736" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:724" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:736: \$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:736" +$as_echo "$at_srcdir/glr-regression.at:724: \$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:724" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:736" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:724" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:738: \$PREPARSER ./glr-regr8" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr8" "glr-regression.at:738" +$as_echo "$at_srcdir/glr-regression.at:730: \$PREPARSER ./glr-regr8" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr8" "glr-regression.at:730" ( $at_check_trace; $PREPARSER ./glr-regr8 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -175422,20 +216652,20 @@ 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:738" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:730" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:738: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:738" +$as_echo "$at_srcdir/glr-regression.at:730: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:730" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:738" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:730" $at_failed && at_fn_log_failure $at_traceon; } @@ -175445,13 +216675,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_338 -#AT_START_339 -at_fn_group_banner 339 'glr-regression.at:752' \ - "No users destructors if stack 0 deleted" " " 22 +#AT_STOP_481 +#AT_START_482 +at_fn_group_banner 482 'glr-regression.at:740' \ + "No users destructors if stack 0 deleted" " " 25 at_xfail=no ( - $as_echo "339. $at_setup_line: testing $at_desc ..." + $as_echo "482. $at_setup_line: testing $at_desc ..." $at_traceon @@ -175469,7 +216699,9 @@ cat >glr-regr9.y <<'_ATEOF' %{ # include # include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); # define YYSTACKEXPANDABLE 0 static int tokens = 0; @@ -175506,10 +216738,11 @@ yylex (void) return 'a'; } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -175536,39 +216769,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:813: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:813" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y +$as_echo "$at_srcdir/glr-regression.at:803: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:803" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:813" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:803" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:813: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y" "glr-regression.at:813" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y +$as_echo "$at_srcdir/glr-regression.at:803: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y" "glr-regression.at:803" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:813" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:803" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:813: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:803: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:813" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:803" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -175577,16 +216810,16 @@ at_status=$? at_failed=false $at_check_filter 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:813" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:803" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:813: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:803: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:813" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:803" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -175595,7 +216828,7 @@ at_status=$? at_failed=false $at_check_filter 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:813" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:803" $at_failed && at_fn_log_failure $at_traceon; } @@ -175603,64 +216836,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:813: bison -o glr-regr9.c glr-regr9.y" -at_fn_check_prepare_trace "glr-regression.at:813" -( $at_check_trace; bison -o glr-regr9.c glr-regr9.y +$as_echo "$at_srcdir/glr-regression.at:803: bison -fno-caret -o glr-regr9.c glr-regr9.y" +at_fn_check_prepare_trace "glr-regression.at:803" +( $at_check_trace; bison -fno-caret -o glr-regr9.c glr-regr9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr9.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr9.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:813" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:803" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:803: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Werror" "glr-regression.at:803" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:803" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr9.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:803: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:803" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:803" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:803: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=error" "glr-regression.at:803" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:803" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:803: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Wnone -Werror" "glr-regression.at:803" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:803" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:803: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=none -Werror" "glr-regression.at:803" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:803" +$at_failed && at_fn_log_failure +$at_traceon; } + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:816: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:816" +$as_echo "$at_srcdir/glr-regression.at:804: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:804" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:816" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:816: \$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:816" +$as_echo "$at_srcdir/glr-regression.at:804: \$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:804" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:816" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:818: \$PREPARSER ./glr-regr9" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr9" "glr-regression.at:818" +$as_echo "$at_srcdir/glr-regression.at:808: \$PREPARSER ./glr-regr9" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr9" "glr-regression.at:808" ( $at_check_trace; $PREPARSER ./glr-regr9 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:818" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:808" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:818" +$as_echo "$at_srcdir/glr-regression.at:808: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:808" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -175669,7 +216995,7 @@ 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:818" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:808" $at_failed && at_fn_log_failure $at_traceon; } @@ -175679,13 +217005,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_339 -#AT_START_340 -at_fn_group_banner 340 'glr-regression.at:829' \ - "Corrupted semantic options if user action cuts parse" "" 22 +#AT_STOP_482 +#AT_START_483 +at_fn_group_banner 483 'glr-regression.at:817' \ + "Corrupted semantic options if user action cuts parse" "" 25 at_xfail=no ( - $as_echo "340. $at_setup_line: testing $at_desc ..." + $as_echo "483. $at_setup_line: testing $at_desc ..." $at_traceon @@ -175703,7 +217029,9 @@ cat >glr-regr10.y <<'_ATEOF' %{ # include # include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); #define GARBAGE_SIZE 50 static char garbage[GARBAGE_SIZE]; @@ -175721,10 +217049,11 @@ start: ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -175761,39 +217090,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:869: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:869" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y +$as_echo "$at_srcdir/glr-regression.at:859: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:859" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:869" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:859" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:869: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y" "glr-regression.at:869" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y +$as_echo "$at_srcdir/glr-regression.at:859: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y" "glr-regression.at:859" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:869" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:859" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:869: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:859: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:869" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:859" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -175802,16 +217131,16 @@ at_status=$? at_failed=false $at_check_filter 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:869" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:859" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:869: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:859: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:869" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:859" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -175820,7 +217149,7 @@ at_status=$? at_failed=false $at_check_filter 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:869" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:859" $at_failed && at_fn_log_failure $at_traceon; } @@ -175828,71 +217157,164 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:869: bison -o glr-regr10.c glr-regr10.y" -at_fn_check_prepare_trace "glr-regression.at:869" -( $at_check_trace; bison -o glr-regr10.c glr-regr10.y +$as_echo "$at_srcdir/glr-regression.at:859: bison -fno-caret -o glr-regr10.c glr-regr10.y" +at_fn_check_prepare_trace "glr-regression.at:859" +( $at_check_trace; bison -fno-caret -o glr-regr10.c glr-regr10.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr10.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr10.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:869" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:859" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:859: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Werror" "glr-regression.at:859" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:859" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr10.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:859: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:859" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:859" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:859: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=error" "glr-regression.at:859" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:859" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:859: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Wnone -Werror" "glr-regression.at:859" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:859" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:859: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=none -Werror" "glr-regression.at:859" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:859" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:872: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:872" +$as_echo "$at_srcdir/glr-regression.at:860: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:860" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:872" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:860" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:872: \$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:872" +$as_echo "$at_srcdir/glr-regression.at:860: \$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:860" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:872" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:860" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:874: \$PREPARSER ./glr-regr10" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr10" "glr-regression.at:874" +$as_echo "$at_srcdir/glr-regression.at:862: \$PREPARSER ./glr-regr10" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr10" "glr-regression.at:862" ( $at_check_trace; $PREPARSER ./glr-regr10 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:874" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:862" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:874: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:874" +$as_echo "$at_srcdir/glr-regression.at:862: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:862" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:874" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:862" $at_failed && at_fn_log_failure $at_traceon; } @@ -175902,13 +217324,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_340 -#AT_START_341 -at_fn_group_banner 341 'glr-regression.at:883' \ - "Undesirable destructors if user action cuts parse" "" 22 +#AT_STOP_483 +#AT_START_484 +at_fn_group_banner 484 'glr-regression.at:871' \ + "Undesirable destructors if user action cuts parse" "" 25 at_xfail=no ( - $as_echo "341. $at_setup_line: testing $at_desc ..." + $as_echo "484. $at_setup_line: testing $at_desc ..." $at_traceon @@ -175925,7 +217347,9 @@ cat >glr-regr11.y <<'_ATEOF' %{ # include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); static int destructors = 0; # define USE(val) @@ -175945,10 +217369,11 @@ start: %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -175988,39 +217413,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:927: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:927" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y +$as_echo "$at_srcdir/glr-regression.at:917: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:917" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:927" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:917" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:927: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y" "glr-regression.at:927" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y +$as_echo "$at_srcdir/glr-regression.at:917: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y" "glr-regression.at:917" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:927" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:917" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:927: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:917: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:927" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:917" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -176029,16 +217454,16 @@ at_status=$? at_failed=false $at_check_filter 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:927" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:917" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:927: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:917: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:927" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:917" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -176047,7 +217472,7 @@ at_status=$? at_failed=false $at_check_filter 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:927" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:917" $at_failed && at_fn_log_failure $at_traceon; } @@ -176055,71 +217480,164 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:927: bison -o glr-regr11.c glr-regr11.y" -at_fn_check_prepare_trace "glr-regression.at:927" -( $at_check_trace; bison -o glr-regr11.c glr-regr11.y +$as_echo "$at_srcdir/glr-regression.at:917: bison -fno-caret -o glr-regr11.c glr-regr11.y" +at_fn_check_prepare_trace "glr-regression.at:917" +( $at_check_trace; bison -fno-caret -o glr-regr11.c glr-regr11.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr11.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr11.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:927" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:917" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:917: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Werror" "glr-regression.at:917" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:917" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr11.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:917: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:917" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:917" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:917: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=error" "glr-regression.at:917" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:917" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:917: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Wnone -Werror" "glr-regression.at:917" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:917" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:917: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=none -Werror" "glr-regression.at:917" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:917" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:930: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:930" +$as_echo "$at_srcdir/glr-regression.at:918: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:918" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:930" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:918" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:930: \$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:930" +$as_echo "$at_srcdir/glr-regression.at:918: \$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:918" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:930" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:918" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:932: \$PREPARSER ./glr-regr11" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr11" "glr-regression.at:932" +$as_echo "$at_srcdir/glr-regression.at:920: \$PREPARSER ./glr-regr11" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr11" "glr-regression.at:920" ( $at_check_trace; $PREPARSER ./glr-regr11 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:932" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:920" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:932: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:932" +$as_echo "$at_srcdir/glr-regression.at:920: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:920" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:932" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:920" $at_failed && at_fn_log_failure $at_traceon; } @@ -176129,13 +217647,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_341 -#AT_START_342 -at_fn_group_banner 342 'glr-regression.at:941' \ - "Leaked semantic values if user action cuts parse" "" 22 +#AT_STOP_484 +#AT_START_485 +at_fn_group_banner 485 'glr-regression.at:929' \ + "Leaked semantic values if user action cuts parse" "" 25 at_xfail=no ( - $as_echo "342. $at_setup_line: testing $at_desc ..." + $as_echo "485. $at_setup_line: testing $at_desc ..." $at_traceon @@ -176162,7 +217680,9 @@ cat >glr-regr12.y <<'_ATEOF' # include # include static int merge (YYSTYPE, YYSTYPE); - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); static int parent_rhs_before_value = 0; static int merged_value = 0; @@ -176223,10 +217743,11 @@ merge (YYSTYPE s1, YYSTYPE s2) return dummy; } -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -176251,17 +217772,17 @@ main (void) int exit_status = yyparse (); if (parent_rhs_before_value) { - fprintf (stderr, "`parent_rhs_before' destructor not called.\n"); + fprintf (stderr, "'parent_rhs_before' destructor not called.\n"); exit_status = 1; } if (merged_value) { - fprintf (stderr, "`merged' destructor not called.\n"); + fprintf (stderr, "'merged' destructor not called.\n"); exit_status = 1; } if (parent_rhs_after_value) { - fprintf (stderr, "`PARENT_RHS_AFTER' destructor not called.\n"); + fprintf (stderr, "'PARENT_RHS_AFTER' destructor not called.\n"); exit_status = 1; } return exit_status; @@ -176277,39 +217798,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1048: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1048" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y +$as_echo "$at_srcdir/glr-regression.at:1039: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1039" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:1048" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1039" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1048: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y" "glr-regression.at:1048" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y +$as_echo "$at_srcdir/glr-regression.at:1039: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y" "glr-regression.at:1039" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1048" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1039" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1048: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1039: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1048" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1039" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -176318,16 +217839,16 @@ at_status=$? at_failed=false $at_check_filter 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:1048" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1039" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1048: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1039: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1048" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1039" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -176336,7 +217857,7 @@ at_status=$? at_failed=false $at_check_filter 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:1048" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1039" $at_failed && at_fn_log_failure $at_traceon; } @@ -176344,71 +217865,166 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1048: bison -o glr-regr12.c glr-regr12.y" -at_fn_check_prepare_trace "glr-regression.at:1048" -( $at_check_trace; bison -o glr-regr12.c glr-regr12.y +$as_echo "$at_srcdir/glr-regression.at:1039: bison -fno-caret -o glr-regr12.c glr-regr12.y" +at_fn_check_prepare_trace "glr-regression.at:1039" +( $at_check_trace; bison -fno-caret -o glr-regr12.c glr-regr12.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr12.y: conflicts: 1 shift/reduce, 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr12.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] +glr-regr12.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:1048" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1039" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1039: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Werror" "glr-regression.at:1039" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1039" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr12.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] +glr-regr12.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1039: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1039" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:1039" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1039: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=error" "glr-regression.at:1039" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1039" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1039: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Wnone -Werror" "glr-regression.at:1039" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1039" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:1039: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=none -Werror" "glr-regression.at:1039" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1039" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1051: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1051" +$as_echo "$at_srcdir/glr-regression.at:1040: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1040" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1051" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1040" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1051: \$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:1051" +$as_echo "$at_srcdir/glr-regression.at:1040: \$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:1040" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1051" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1040" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1053: \$PREPARSER ./glr-regr12" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr12" "glr-regression.at:1053" +$as_echo "$at_srcdir/glr-regression.at:1042: \$PREPARSER ./glr-regr12" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr12" "glr-regression.at:1042" ( $at_check_trace; $PREPARSER ./glr-regr12 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1053" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1042" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:1053" +$as_echo "$at_srcdir/glr-regression.at:1042: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:1042" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1053" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1042" $at_failed && at_fn_log_failure $at_traceon; } @@ -176418,13 +218034,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_342 -#AT_START_343 -at_fn_group_banner 343 'glr-regression.at:1064' \ - "Incorrect lookahead during deterministic GLR" " " 22 +#AT_STOP_485 +#AT_START_486 +at_fn_group_banner 486 'glr-regression.at:1053' \ + "Incorrect lookahead during deterministic GLR" " " 25 at_xfail=no ( - $as_echo "343. $at_setup_line: testing $at_desc ..." + $as_echo "486. $at_setup_line: testing $at_desc ..." $at_traceon @@ -176449,7 +218065,9 @@ cat >glr-regr13.y <<'_ATEOF' %{ #include #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); static void print_lookahead (char const *); #define USE(value) @@ -176501,10 +218119,11 @@ change_lookahead: %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -176534,10 +218153,10 @@ print_lookahead (char const *reduction) { printf ("'%c', yylval='", yychar); if (yylval.value > ' ') - printf ("%c", yylval.value); + printf ("%c", yylval.value); printf ("', yylloc=(%d,%d),(%d,%d)", - yylloc.first_line, yylloc.first_column, - yylloc.last_line, yylloc.last_column); + yylloc.first_line, yylloc.first_column, + yylloc.last_line, yylloc.last_column); } printf ("\n"); } @@ -176560,39 +218179,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1165" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y +$as_echo "$at_srcdir/glr-regression.at:1154: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1154" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:1165" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y" "glr-regression.at:1165" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y +$as_echo "$at_srcdir/glr-regression.at:1154: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y" "glr-regression.at:1154" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1165" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1165: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1154: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1165" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1154" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -176601,16 +218220,16 @@ at_status=$? at_failed=false $at_check_filter 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:1165" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1165: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1154: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1165" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1154" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -176619,7 +218238,7 @@ at_status=$? at_failed=false $at_check_filter 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:1165" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154" $at_failed && at_fn_log_failure $at_traceon; } @@ -176627,42 +218246,42 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1165: bison -o glr-regr13.c glr-regr13.y" -at_fn_check_prepare_trace "glr-regression.at:1165" -( $at_check_trace; bison -o glr-regr13.c glr-regr13.y +$as_echo "$at_srcdir/glr-regression.at:1154: bison -fno-caret -o glr-regr13.c glr-regr13.y" +at_fn_check_prepare_trace "glr-regression.at:1154" +( $at_check_trace; bison -fno-caret -o glr-regr13.c glr-regr13.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1165" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1166: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1166" +$as_echo "$at_srcdir/glr-regression.at:1155: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1155" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1166" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1155" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1166: \$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:1166" +$as_echo "$at_srcdir/glr-regression.at:1155: \$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:1155" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1166" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1155" $at_failed && at_fn_log_failure $at_traceon; } @@ -176710,13 +218329,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_343 -#AT_START_344 -at_fn_group_banner 344 'glr-regression.at:1188' \ - "Incorrect lookahead during nondeterministic GLR" "" 22 +#AT_STOP_486 +#AT_START_487 +at_fn_group_banner 487 'glr-regression.at:1177' \ + "Incorrect lookahead during nondeterministic GLR" "" 25 at_xfail=no ( - $as_echo "344. $at_setup_line: testing $at_desc ..." + $as_echo "487. $at_setup_line: testing $at_desc ..." $at_traceon @@ -176756,7 +218375,9 @@ cat >glr-regr14.y <<'_ATEOF' #include #include #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); static void print_lookahead (char const *); static char merge (union YYSTYPE, union YYSTYPE); @@ -176785,7 +218406,7 @@ merge: | 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"); + " defstate_shift"); } ; @@ -176832,7 +218453,7 @@ alt1: USE ($1); if (yychar != 'd' && yychar != YYEOF) { - fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); + fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; @@ -176841,7 +218462,7 @@ alt2: USE ($1); if (yychar != 'd' && yychar != YYEOF) { - fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); + fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; @@ -176850,7 +218471,7 @@ alt3: USE ($1); if (yychar != 'd' && yychar != YYEOF) { - fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); + fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; @@ -176858,18 +218479,19 @@ no_look: { if (yychar != YYEMPTY) { - fprintf (stderr, - "Found lookahead where shouldn't during stack explosion.\n"); + fprintf (stderr, + "Found lookahead where shouldn't during stack explosion.\n"); } } ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -176897,10 +218519,10 @@ print_lookahead (char const *reduction) { printf ("'%c', yylval='", yychar); if (yylval.value > ' ') - printf ("%c", yylval.value); + printf ("%c", yylval.value); printf ("', yylloc=(%d,%d),(%d,%d)", - yylloc.first_line, yylloc.first_column, - yylloc.last_line, yylloc.last_column); + yylloc.first_line, yylloc.first_column, + yylloc.last_line, yylloc.last_column); } printf ("\n"); } @@ -176930,39 +218552,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1378: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1378" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y +$as_echo "$at_srcdir/glr-regression.at:1369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1369" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:1378" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1369" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1378: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y" "glr-regression.at:1378" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y +$as_echo "$at_srcdir/glr-regression.at:1369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y" "glr-regression.at:1369" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1378" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1369" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1378: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1378" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -176971,16 +218593,16 @@ at_status=$? at_failed=false $at_check_filter 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:1378" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1369" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1378: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1369: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1378" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1369" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -176989,7 +218611,7 @@ at_status=$? at_failed=false $at_check_filter 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:1378" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1369" $at_failed && at_fn_log_failure $at_traceon; } @@ -176997,51 +218619,144 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1378: bison -o glr-regr14.c glr-regr14.y" -at_fn_check_prepare_trace "glr-regression.at:1378" -( $at_check_trace; bison -o glr-regr14.c glr-regr14.y +$as_echo "$at_srcdir/glr-regression.at:1369: bison -fno-caret -o glr-regr14.c glr-regr14.y" +at_fn_check_prepare_trace "glr-regression.at:1369" +( $at_check_trace; bison -fno-caret -o glr-regr14.c glr-regr14.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr14.y: conflicts: 3 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr14.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr] " | \ $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:1378" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1369" $at_failed && at_fn_log_failure $at_traceon; } +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Werror" "glr-regression.at:1369" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1369" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr14.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1369: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1369" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:1369" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=error" "glr-regression.at:1369" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1369" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Wnone -Werror" "glr-regression.at:1369" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1369" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:1369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=none -Werror" "glr-regression.at:1369" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1369" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1381: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1381" +$as_echo "$at_srcdir/glr-regression.at:1370: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1370" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1381" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1370" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1381: \$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:1381" +$as_echo "$at_srcdir/glr-regression.at:1370: \$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:1370" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1381" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1370" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1383: \$PREPARSER ./glr-regr14" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr14" "glr-regression.at:1383" +$as_echo "$at_srcdir/glr-regression.at:1385: \$PREPARSER ./glr-regr14" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr14" "glr-regression.at:1385" ( $at_check_trace; $PREPARSER ./glr-regr14 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -177061,20 +218776,20 @@ 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:1383" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1385" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1383: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:1383" +$as_echo "$at_srcdir/glr-regression.at:1385: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:1385" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1383" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1385" $at_failed && at_fn_log_failure $at_traceon; } @@ -177084,13 +218799,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_344 -#AT_START_345 -at_fn_group_banner 345 'glr-regression.at:1405' \ - "Leaked semantic values when reporting ambiguity" "" 22 +#AT_STOP_487 +#AT_START_488 +at_fn_group_banner 488 'glr-regression.at:1394' \ + "Leaked semantic values when reporting ambiguity" "" 25 at_xfail=no ( - $as_echo "345. $at_setup_line: testing $at_desc ..." + $as_echo "488. $at_setup_line: testing $at_desc ..." $at_traceon @@ -177110,7 +218825,9 @@ cat >glr-regr15.y <<'_ATEOF' %{ # include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); static int parent_rhs_before_value = 0; # define USE(val) @@ -177149,10 +218866,11 @@ ambiguity1: ; ambiguity2: ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -177176,7 +218894,7 @@ main (void) int exit_status = yyparse () != 1; if (parent_rhs_before_value) { - fprintf (stderr, "`parent_rhs_before' destructor not called.\n"); + fprintf (stderr, "'parent_rhs_before' destructor not called.\n"); exit_status = 1; } return exit_status; @@ -177192,39 +218910,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1471: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1471" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y +$as_echo "$at_srcdir/glr-regression.at:1462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1462" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:1471" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1462" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1471: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y" "glr-regression.at:1471" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y +$as_echo "$at_srcdir/glr-regression.at:1462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y" "glr-regression.at:1462" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1471" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1462" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1471: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1462: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1471" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1462" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -177233,16 +218951,16 @@ at_status=$? at_failed=false $at_check_filter 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:1471" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1462" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1471: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1462: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1471" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1462" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -177251,7 +218969,7 @@ at_status=$? at_failed=false $at_check_filter 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:1471" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1462" $at_failed && at_fn_log_failure $at_traceon; } @@ -177259,64 +218977,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1471: bison -o glr-regr15.c glr-regr15.y" -at_fn_check_prepare_trace "glr-regression.at:1471" -( $at_check_trace; bison -o glr-regr15.c glr-regr15.y +$as_echo "$at_srcdir/glr-regression.at:1462: bison -fno-caret -o glr-regr15.c glr-regr15.y" +at_fn_check_prepare_trace "glr-regression.at:1462" +( $at_check_trace; bison -fno-caret -o glr-regr15.c glr-regr15.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr15.y: conflicts: 2 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr15.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] " | \ $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:1471" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1462" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Werror" "glr-regression.at:1462" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1462" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr15.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1462: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1462" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:1462" $at_failed && at_fn_log_failure $at_traceon; } + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=error" "glr-regression.at:1462" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1462" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Wnone -Werror" "glr-regression.at:1462" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1462" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:1462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=none -Werror" "glr-regression.at:1462" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1462" +$at_failed && at_fn_log_failure +$at_traceon; } + + + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1474: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1474" +$as_echo "$at_srcdir/glr-regression.at:1463: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1463" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1474" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1463" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1474: \$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:1474" +$as_echo "$at_srcdir/glr-regression.at:1463: \$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:1463" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1474" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1463" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1476: \$PREPARSER ./glr-regr15" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr15" "glr-regression.at:1476" +$as_echo "$at_srcdir/glr-regression.at:1467: \$PREPARSER ./glr-regr15" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr15" "glr-regression.at:1467" ( $at_check_trace; $PREPARSER ./glr-regr15 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1476" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1467" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1476: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:1476" +$as_echo "$at_srcdir/glr-regression.at:1467: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:1467" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -177325,7 +219136,7 @@ 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:1476" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1467" $at_failed && at_fn_log_failure $at_traceon; } @@ -177335,13 +219146,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_345 -#AT_START_346 -at_fn_group_banner 346 'glr-regression.at:1487' \ - "Leaked lookahead after nondeterministic parse syntax error" "" 22 +#AT_STOP_488 +#AT_START_489 +at_fn_group_banner 489 'glr-regression.at:1476' \ + "Leaked lookahead after nondeterministic parse syntax error" "" 25 at_xfail=no ( - $as_echo "346. $at_setup_line: testing $at_desc ..." + $as_echo "489. $at_setup_line: testing $at_desc ..." $at_traceon @@ -177362,7 +219173,9 @@ cat >glr-regr16.y <<'_ATEOF' %{ # include # include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); static int lookahead_value = 0; # define USE(val) @@ -177376,10 +219189,11 @@ alt2: ; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -177420,39 +219234,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1531" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y +$as_echo "$at_srcdir/glr-regression.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1522" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1522" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y" "glr-regression.at:1531" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y +$as_echo "$at_srcdir/glr-regression.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y" "glr-regression.at:1522" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1522" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1531: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1522: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1531" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1522" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -177461,16 +219275,16 @@ at_status=$? at_failed=false $at_check_filter 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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1522" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1531: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1522: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1531" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1522" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -177479,7 +219293,7 @@ at_status=$? at_failed=false $at_check_filter 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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1522" $at_failed && at_fn_log_failure $at_traceon; } @@ -177487,64 +219301,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1531: bison -o glr-regr16.c glr-regr16.y" -at_fn_check_prepare_trace "glr-regression.at:1531" -( $at_check_trace; bison -o glr-regr16.c glr-regr16.y +$as_echo "$at_srcdir/glr-regression.at:1522: bison -fno-caret -o glr-regr16.c glr-regr16.y" +at_fn_check_prepare_trace "glr-regression.at:1522" +( $at_check_trace; bison -fno-caret -o glr-regr16.c glr-regr16.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr16.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr16.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:1531" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1522" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Werror" "glr-regression.at:1522" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1522" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr16.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1522: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1522" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:1522" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=error" "glr-regression.at:1522" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1522" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Wnone -Werror" "glr-regression.at:1522" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1522" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=none -Werror" "glr-regression.at:1522" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1522" $at_failed && at_fn_log_failure $at_traceon; } + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1534: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1534" +$as_echo "$at_srcdir/glr-regression.at:1523: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1523" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1534" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1523" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1534: \$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:1534" +$as_echo "$at_srcdir/glr-regression.at:1523: \$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:1523" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1534" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1523" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1536: \$PREPARSER ./glr-regr16" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr16" "glr-regression.at:1536" +$as_echo "$at_srcdir/glr-regression.at:1527: \$PREPARSER ./glr-regr16" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr16" "glr-regression.at:1527" ( $at_check_trace; $PREPARSER ./glr-regr16 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1536" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1527" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1536: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:1536" +$as_echo "$at_srcdir/glr-regression.at:1527: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:1527" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -177553,7 +219460,7 @@ 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:1536" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1527" $at_failed && at_fn_log_failure $at_traceon; } @@ -177563,13 +219470,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_346 -#AT_START_347 -at_fn_group_banner 347 'glr-regression.at:1547' \ - "Uninitialized location when reporting ambiguity" "" 22 +#AT_STOP_489 +#AT_START_490 +at_fn_group_banner 490 'glr-regression.at:1536' \ + "Uninitialized location when reporting ambiguity" "" 25 at_xfail=no ( - $as_echo "347. $at_setup_line: testing $at_desc ..." + $as_echo "490. $at_setup_line: testing $at_desc ..." $at_traceon @@ -177593,7 +219500,16 @@ cat >glr-regr17.y <<'_ATEOF' %union { int dummy; } %{ - static void yyerror (YYLTYPE const * const llocp, const char *msg); + #include + +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp); +# ifndef LOCATION_PRINT +# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) +# endif +#endif + +static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); %} @@ -177619,12 +219535,42 @@ empty2: ; %% # include -#include + + +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +/* Print *YYLOCP on YYO. */ +__attribute__((__unused__)) +static unsigned +location_print (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += fprintf (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += fprintf (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += fprintf (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += fprintf (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += fprintf (yyo, "-%d", end_col); + } + return res; +} +#endif + /* A C error reporting function. */ static -void yyerror (YYLTYPE const * const llocp, const char *msg) +void yyerror (YYLTYPE const * const llocp, const char *msg) { - YY_LOCATION_PRINT (stderr, (*llocp)); + LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } @@ -177641,10 +219587,14 @@ yylex (YYSTYPE *lvalp, YYLTYPE *llocp) return input[toknum++]; } +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) { - return yyparse () != 1; + (void) argc; + (void) argv; + return yyparse (); } _ATEOF @@ -177657,39 +219607,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:1609" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y +$as_echo "$at_srcdir/glr-regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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:1596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --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" 5>&- at_status=$? at_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:1609" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y" "glr-regression.at:1609" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y +$as_echo "$at_srcdir/glr-regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y" "glr-regression.at:1596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1609" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1609: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1596: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1609" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1596" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -177698,16 +219648,16 @@ at_status=$? at_failed=false $at_check_filter 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:1609" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1609: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1596: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1609" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1596" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -177716,7 +219666,7 @@ at_status=$? at_failed=false $at_check_filter 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:1609" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1596" $at_failed && at_fn_log_failure $at_traceon; } @@ -177724,64 +219674,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1609: bison -o glr-regr17.c glr-regr17.y" -at_fn_check_prepare_trace "glr-regression.at:1609" -( $at_check_trace; bison -o glr-regr17.c glr-regr17.y +$as_echo "$at_srcdir/glr-regression.at:1596: bison -fno-caret -o glr-regr17.c glr-regr17.y" +at_fn_check_prepare_trace "glr-regression.at:1596" +( $at_check_trace; bison -fno-caret -o glr-regr17.c glr-regr17.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr17.y: conflicts: 3 reduce/reduce +echo >>"$at_stderr"; $as_echo "glr-regr17.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr] " | \ $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:1609" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1596" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Werror" "glr-regression.at:1596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1596" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +glr-regr17.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1596: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1596" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:1596" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=error" "glr-regression.at:1596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1596" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Wnone -Werror" "glr-regression.at:1596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1596" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=none -Werror" "glr-regression.at:1596" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1596" $at_failed && at_fn_log_failure $at_traceon; } + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1612: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1612" +$as_echo "$at_srcdir/glr-regression.at:1597: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1597" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1612" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1597" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1612: \$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:1612" +$as_echo "$at_srcdir/glr-regression.at:1597: \$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:1597" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1612" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1597" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1614: \$PREPARSER ./glr-regr17" -at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr17" "glr-regression.at:1614" +$as_echo "$at_srcdir/glr-regression.at:1601: \$PREPARSER ./glr-regr17" +at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr17" "glr-regression.at:1601" ( $at_check_trace; $PREPARSER ./glr-regr17 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1614" +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1601" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:1614" +$as_echo "$at_srcdir/glr-regression.at:1601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:1601" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -177790,7 +219833,7 @@ echo >>"$at_stderr"; $as_echo "1.1-2.2: 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:1614" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1601" $at_failed && at_fn_log_failure $at_traceon; } @@ -177800,13 +219843,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_347 -#AT_START_348 -at_fn_group_banner 348 'glr-regression.at:1625' \ - "Missed %merge type warnings when LHS type is declared later" "" 22 +#AT_STOP_490 +#AT_START_491 +at_fn_group_banner 491 'glr-regression.at:1610' \ + "Missed %merge type warnings when LHS type is declared later" "" 25 at_xfail=no ( - $as_echo "348. $at_setup_line: testing $at_desc ..." + $as_echo "491. $at_setup_line: testing $at_desc ..." $at_traceon @@ -177824,7 +219867,9 @@ cat >glr-regr18.y <<'_ATEOF' %{ #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); %} @@ -177845,10 +219890,11 @@ sym3: %merge { $$ = 0; } ; %type sym3; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -177865,9 +219911,13 @@ int yylex (void) ; return res; } +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) { + (void) argc; + (void) argv; return yyparse (); } _ATEOF @@ -177877,20 +219927,20 @@ _ATEOF { set +x -$as_echo "$at_srcdir/glr-regression.at:1664: 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:1664" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y +$as_echo "$at_srcdir/glr-regression.at:1650: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -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 -fno-caret -o glr-regr18.c glr-regr18.y" "glr-regression.at:1650" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr18.c glr-regr18.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "glr-regr18.y:26.18-24: error: result type clash on merge function 'merge': != -glr-regr18.y:25.18-24: previous declaration -glr-regr18.y:27.13-19: error: result type clash on merge function 'merge': != -glr-regr18.y:26.18-24: previous declaration +echo >>"$at_stderr"; $as_echo "glr-regr18.y:28.18-24: error: result type clash on merge function 'merge': != +glr-regr18.y:27.18-24: previous declaration +glr-regr18.y:29.13-19: error: result type clash on merge function 'merge': != +glr-regr18.y:28.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:1664" +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1650" $at_failed && at_fn_log_failure $at_traceon; } @@ -177900,13 +219950,13 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_348 -#AT_START_349 -at_fn_group_banner 349 'glr-regression.at:1678' \ - "Ambiguity reports" " " 22 +#AT_STOP_491 +#AT_START_492 +at_fn_group_banner 492 'glr-regression.at:1659' \ + "Ambiguity reports" " " 25 at_xfail=no ( - $as_echo "349. $at_setup_line: testing $at_desc ..." + $as_echo "492. $at_setup_line: testing $at_desc ..." $at_traceon @@ -177924,7 +219974,9 @@ cat >input.y <<'_ATEOF' %{ #include #include - static void yyerror ( const char *msg); + #include + +static void yyerror (const char *msg); static int yylex (void); %} @@ -177939,10 +219991,11 @@ start: b: 'b'; d: /* nada. */; %% -#include + + /* A C error reporting function. */ static -void yyerror ( const char *msg) +void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } @@ -177959,11 +220012,16 @@ int yylex (void) ; return res; } +#include /* getenv. */ +#include /* strcmp. */ int -main (void) +main (int argc, char const* argv[]) { - yydebug = 1; - return !!yyparse (); + if (getenv("YYDEBUG") + || (argc == 2 + && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug")))) + yydebug |= 1; + return yyparse (); } _ATEOF @@ -177976,39 +220034,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:1712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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' "glr-regression.at:1712" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/glr-regression.at:1690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --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' "glr-regression.at:1690" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1712" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1690" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "glr-regression.at:1712" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/glr-regression.at:1690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "glr-regression.at:1690" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1712" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1690" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1712: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1690: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1712" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1690" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -178017,16 +220075,16 @@ at_status=$? at_failed=false $at_check_filter 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:1712" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1690" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/glr-regression.at:1712: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1690: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1712" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1690" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -178035,7 +220093,7 @@ at_status=$? at_failed=false $at_check_filter 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:1712" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1690" $at_failed && at_fn_log_failure $at_traceon; } @@ -178043,64 +220101,157 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1712: bison -o input.c input.y" -at_fn_check_prepare_trace "glr-regression.at:1712" -( $at_check_trace; bison -o input.c input.y +$as_echo "$at_srcdir/glr-regression.at:1690: bison -fno-caret -o input.c input.y" +at_fn_check_prepare_trace "glr-regression.at:1690" +( $at_check_trace; bison -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter -echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce +echo >>"$at_stderr"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $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:1712" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1690" +$at_failed && at_fn_log_failure +$at_traceon; } + +# Defining POSIXLY_CORRECT causes bison to complain if options are +# added after the grammar file name, so skip these checks in that +# case. +if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then + at_save_special_files + + # To avoid expanding it repeatedly, store specified stdout. + : >expout + + # Run with -Werror. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "glr-regression.at:1690" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +echo stderr:; tee stderr <"$at_stderr" +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1690" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Build expected stderr up to and including the "warnings being + # treated as errors" message. + cat >experr <<'_ATEOF' +input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +_ATEOF + + $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$} + {$1: error: $2\[-Werror=$3]}' experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1690: sed 's,.*/\$,,' stderr 1>&2" +at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1690" +( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +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 0 $at_status "$at_srcdir/glr-regression.at:1690" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check --warnings=error. + cp stderr experr + { set +x +$as_echo "$at_srcdir/glr-regression.at:1690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "glr-regression.at:1690" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +$at_diff experr "$at_stderr" || at_failed=: +$at_diff expout "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1690" +$at_failed && at_fn_log_failure +$at_traceon; } + + + # Now check -Wnone and --warnings=none by making sure that + # -Werror doesn't change the exit status when -Wnone or + # --warnings=none is specified. + { set +x +$as_echo "$at_srcdir/glr-regression.at:1690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "glr-regression.at:1690" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1690" +$at_failed && at_fn_log_failure +$at_traceon; } + + { set +x +$as_echo "$at_srcdir/glr-regression.at:1690: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "glr-regression.at:1690" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror +) >>"$at_stdout" 2>>"$at_stderr" 5>&- +at_status=$? at_failed=false +$at_check_filter +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:1690" $at_failed && at_fn_log_failure $at_traceon; } + at_restore_special_files +fi { set +x -$as_echo "$at_srcdir/glr-regression.at:1715: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1715" +$as_echo "$at_srcdir/glr-regression.at:1691: \$BISON_C_WORKS" +at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1691" ( $at_check_trace; $BISON_C_WORKS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1715" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1691" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1715: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" -at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "glr-regression.at:1715" +$as_echo "$at_srcdir/glr-regression.at:1691: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" +at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "glr-regression.at:1691" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1715" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1691" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1717: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "glr-regression.at:1717" -( $at_check_trace; $PREPARSER ./input +$as_echo "$at_srcdir/glr-regression.at:1749: \$PREPARSER ./input --debug" +at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "glr-regression.at:1749" +( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1717" +at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1749" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/glr-regression.at:1717: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "glr-regression.at:1717" +$as_echo "$at_srcdir/glr-regression.at:1749: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" +at_fn_check_prepare_trace "glr-regression.at:1749" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false @@ -178113,14 +220264,14 @@ Entering state 1 Reading a token: Next token is token 'b' () Shifting token 'b' () Entering state 3 -Reducing stack 0 by rule 3 (line 25): +Reducing stack 0 by rule 3 (line 27): \$1 = token 'b' () -> \$\$ = nterm b () Entering state 4 Reading a token: Next token is token 'c' () Shifting token 'c' () Entering state 6 -Reducing stack 0 by rule 4 (line 26): +Reducing stack 0 by rule 4 (line 28): -> \$\$ = nterm d () Entering state 7 Reading a token: Now at end of input. @@ -178163,7 +220314,7 @@ Cleanup: popping token 'a' () " | \ $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:1717" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1749" $at_failed && at_fn_log_failure $at_traceon; } @@ -178173,17 +220324,17 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_349 -#AT_START_350 -at_fn_group_banner 350 'push.at:24' \ - "Memory Leak for Early Deletion" " " 23 +#AT_STOP_492 +#AT_START_493 +at_fn_group_banner 493 'glr-regression.at:1760' \ + "Predicates" " " 25 at_xfail=no ( - $as_echo "350. $at_setup_line: testing $at_desc ..." + $as_echo "493. $at_setup_line: testing $at_desc ..." $at_traceon -# Requires Valgrind. +# FIXME: We need genuine test cases with uses of %?. cat >input.y <<'_ATEOF' %code top { @@ -178194,479 +220345,18 @@ cat >input.y <<'_ATEOF' #undef realloc } - -%{ - #include - #include - #define YYINITDEPTH 1 -static void yyerror ( const char *msg); -%} - -%define api.pure -%define api.push-pull push - -%% - -start: 'a' 'b' 'c' ; - -%% - -#include -/* A C error reporting function. */ -static -void yyerror ( const char *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', YY_NULL) == YYPUSH_MORE); - yypstate_delete (ps); - - ps = yypstate_new (); - assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE); - assert (yypush_parse (ps, 'b', YY_NULL) == YYPUSH_MORE); - yypstate_delete (ps); - - return 0; -} -_ATEOF - - - - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:73" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:73" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:73" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ - xml-tests/test.xml -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\ - \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ - xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73" -( $at_check_trace; $XSLTPROC \ - `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ - xml-tests/test.xml | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - rm -rf xml-tests expout - at_restore_special_files -fi -{ set +x -$as_echo "$at_srcdir/push.at:73: bison -o input.c input.y" -at_fn_check_prepare_trace "push.at:73" -( $at_check_trace; bison -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:73" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/push.at:74: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:74" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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: \$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:74" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:75: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:75" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -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:75: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "push.at:75" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:75" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_350 -#AT_START_351 -at_fn_group_banner 351 'push.at:83' \ - "Multiple impure instances" " " 23 -at_xfail=no -( - $as_echo "351. $at_setup_line: testing $at_desc ..." - $at_traceon - - - - - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - - -%{ - #include - #include -static void yyerror ( const char *msg); -static int yylex (void); -%} - -%define api.push-pull both - -%% - -start: ; - -%% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} -#include -static -int yylex (void) -{ - static char const input[] = ""; - static size_t toknum = 0; - int res; - ; - assert (toknum < sizeof input / sizeof input[0]); - res = input[toknum++]; - ; - return res; -} - -int -main (void) -{ - int i; - for (i = 0; i < 2; ++i) - { - yypstate *ps = yypstate_new (); - assert (ps); - assert (yypstate_new () == YY_NULL); - assert (yyparse () == 2); - yychar = 0; - assert (yypush_parse (ps) == 0); - assert (yypstate_new () == YY_NULL); - assert (yyparse () == 2); - yypstate_delete (ps); - } - - return 0; -} -_ATEOF - - - -if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - at_save_special_files - mkdir xml-tests - # Don't combine these Bison invocations 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:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:133" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - { set +x -$as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:133" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - cp xml-tests/test.output expout - { set +x -$as_echo "$at_srcdir/push.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' "push.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" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - sort xml-tests/test.dot > expout - { set +x -$as_echo "$at_srcdir/push.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 | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "push.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 | sort -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -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:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - rm -rf xml-tests expout - at_restore_special_files -fi -{ set +x -$as_echo "$at_srcdir/push.at:133: bison -o input.c input.y" -at_fn_check_prepare_trace "push.at:133" -( $at_check_trace; bison -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/push.at:133: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:133" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:133" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/push.at:133: \$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:133" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:133" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/push.at:133: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:133" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/push.at:133" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/push.at:133: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "push.at:133" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:133" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - - - -cat >input.y <<'_ATEOF' -%code top { -#include -/* We don't need perfect functions for these tests. */ -#undef malloc -#undef memcmp -#undef realloc -} - - -%{ - #include - #include -static void yyerror ( const char *msg); - -%} - -%define api.push-pull push - +%glr-parser +%expect-rr 1 %% - -start: ; - +// Exercise "%?{...}" and "%? {...}". +widget: + %? {new_syntax} "widget" id new_args { $$ = f($3, $4); } +| %?{!new_syntax} "widget" id old_args { $$ = f($3, $4); } +; +id:; +new_args:; +old_args:; %% -#include -/* A C error reporting function. */ -static -void yyerror ( const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} - - -int -main (void) -{ - int i; - for (i = 0; i < 2; ++i) - { - yypstate *ps = yypstate_new (); - assert (ps); - assert (yypstate_new () == YY_NULL); - ; - yychar = 0; - assert (yypush_parse (ps) == 0); - assert (yypstate_new () == YY_NULL); - ; - yypstate_delete (ps); - } - - return 0; -} _ATEOF @@ -178677,39 +220367,39 @@ if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then # Don't combine these Bison invocations 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:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; 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:134" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --report=all --report-file=xml-tests/test.output \ - --graph=xml-tests/test.dot -o input.c input.y +$as_echo "$at_srcdir/glr-regression.at:1779: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\ + --graph=xml-tests/test.dot input.y" +at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1779" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \ + --graph=xml-tests/test.dot input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:134" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1779" $at_failed && at_fn_log_failure $at_traceon; } { set +x -$as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" -at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y" "push.at:134" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --xml=xml-tests/test.xml -o input.c input.y +$as_echo "$at_srcdir/glr-regression.at:1779: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" +at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "glr-regression.at:1779" +( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:134" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1779" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x -$as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1779: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:134" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1779" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml @@ -178718,16 +220408,16 @@ at_status=$? at_failed=false $at_check_filter 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:134" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1779" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.dot > expout { set +x -$as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\ +$as_echo "$at_srcdir/glr-regression.at:1779: \$XSLTPROC \\ \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" -at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134" +at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1779" ( $at_check_trace; $XSLTPROC \ `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort @@ -178736,7 +220426,7 @@ at_status=$? at_failed=false $at_check_filter 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:134" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1779" $at_failed && at_fn_log_failure $at_traceon; } @@ -178744,114 +220434,15 @@ $at_traceon; } at_restore_special_files fi { set +x -$as_echo "$at_srcdir/push.at:134: bison -o input.c input.y" -at_fn_check_prepare_trace "push.at:134" -( $at_check_trace; bison -o input.c input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -at_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:134" -$at_failed && at_fn_log_failure -$at_traceon; } - - -{ set +x -$as_echo "$at_srcdir/push.at:134: \$BISON_C_WORKS" -at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:134" -( $at_check_trace; $BISON_C_WORKS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:134" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/push.at:134: \$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:134" -( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_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:134" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/push.at:134: \$PREPARSER ./input" -at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:134" -( $at_check_trace; $PREPARSER ./input -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo stderr:; tee stderr <"$at_stderr" -at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" -$at_failed && at_fn_log_failure -$at_traceon; } - -{ set +x -$as_echo "$at_srcdir/push.at:134: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" -at_fn_check_prepare_trace "push.at:134" -( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr +$as_echo "$at_srcdir/glr-regression.at:1779: bison -fno-caret input.y" +at_fn_check_prepare_trace "glr-regression.at:1779" +( $at_check_trace; bison -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:134" -$at_failed && at_fn_log_failure -$at_traceon; } - - - - - - - - set +x - $at_times_p && times >"$at_times_file" -) 5>&1 2>&1 7>&- | eval $at_tee_pipe -read at_status <"$at_status_file" -#AT_STOP_351 -#AT_START_352 -at_fn_group_banner 352 'push.at:144' \ - "Unsupported Skeletons" " " 23 -at_xfail=no -( - $as_echo "352. $at_setup_line: testing $at_desc ..." - $at_traceon - - - -cat >input.y <<'_ATEOF' -%glr-parser -%define api.push-pull push -%% -start: ; -_ATEOF - - - - -{ set +x -$as_echo "$at_srcdir/push.at:155: 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" "push.at:155" -( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y -) >>"$at_stdout" 2>>"$at_stderr" 5>&- -at_status=$? at_failed=false -$at_check_filter -echo >>"$at_stderr"; $as_echo "input.y:2.9-21: error: %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 1 $at_status "$at_srcdir/push.at:155" +at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1779" $at_failed && at_fn_log_failure $at_traceon; } @@ -178861,4 +220452,4 @@ $at_traceon; } $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" -#AT_STOP_352 +#AT_STOP_493 diff --git a/tests/testsuite.at b/tests/testsuite.at index 6f3a221..4f11078 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,6 +1,6 @@ -# Test suite for GNU Bison. -*- Autotest -*- +# Test suite for GNU Bison. -*- Autotest -*- -# Copyright (C) 2000-2004, 2006-2007, 2009-2013 Free Software +# Copyright (C) 2000-2004, 2006-2007, 2009-2015, 2018 Free Software # Foundation, Inc. # This program is free software: you can redistribute it and/or modify @@ -35,6 +35,9 @@ m4_include([sets.at]) # Testing grammar reduction. m4_include([reduce.at]) +# Testing conflicts detection and resolution. +m4_include([conflicts.at]) + # Testing that #lines are correct. m4_include([synclines.at]) @@ -44,8 +47,8 @@ m4_include([headers.at]) # Testing that user actions are properly performed. m4_include([actions.at]) -# Testing conflicts detection and resolution. -m4_include([conflicts.at]) +# Testing semantic types support. +m4_include([types.at]) # Fulling testing (compilation and execution of the parser) on calc. m4_include([calc.at]) @@ -60,17 +63,18 @@ m4_include([existing.at]) # Some old bugs. m4_include([regression.at]) +# Push parsing specific tests. +m4_include([push.at]) + # Some C++ specific tests. m4_include([c++.at]) # And some Java specific tests. m4_include([java.at]) +m4_include([javapush.at]) # GLR tests: # C++ types, simplified m4_include([cxx-type.at]) # Regression tests m4_include([glr-regression.at]) - -# Push parsing specific tests. -m4_include([push.at]) diff --git a/tests/torture.at b/tests/torture.at index 56a1fa8..bbf40cc 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -1,6 +1,6 @@ # Torturing Bison. -*- Autotest -*- -# Copyright (C) 2001-2002, 2004-2007, 2009-2013 Free Software +# Copyright (C) 2001-2002, 2004-2007, 2009-2015, 2018 Free Software # Foundation, Inc. # This program is free software: you can redistribute it and/or modify @@ -91,9 +91,9 @@ for my $size (1 .. $max) { use Text::Wrap; print wrap ("| ", " ", - (map { "\"$_\"" } (1 .. $size)), - " END \n"), - " { \$\$ = $size; }\n"; + (map { "\"$_\"" } (1 .. $size)), + " END \n"), + " { \$\$ = $size; }\n"; }; print ";\n"; @@ -115,12 +115,7 @@ yylex (void) } return inner++; } -int -main (void) -{ - yydebug = !!getenv ("YYDEBUG"); - return yyparse (); -} +]AT_MAIN_DEFINE[ EOF ]]) AT_BISON_OPTION_POPDEFS @@ -188,7 +183,7 @@ EOF use Text::Wrap; print wrap ("exp: ", " ", - (map { "\"$_\"" } (1 .. $max)), ";"), + (map { "\"$_\"" } (1 .. $max)), ";"), "\n"; print <<\EOF; @@ -204,13 +199,7 @@ yylex (void) assert (counter++ == MAX + 1); return 0; } - -int -main (void) -{ - yydebug = !!getenv ("YYDEBUG"); - return yyparse (); -} +]AT_MAIN_DEFINE[ EOF ]]) @@ -288,8 +277,8 @@ EOF print wrap ("%type ", - " ", - map { "n$_" } (1 .. $max)), + " ", + map { "n$_" } (1 .. $max)), "\n"; print "%token\n"; @@ -342,12 +331,7 @@ yylex (void) return counter++; } -int -main (void) -{ - yydebug = !!getenv ("YYDEBUG"); - return yyparse (); -} +]AT_MAIN_DEFINE[ EOF ]]) @@ -419,7 +403,7 @@ get_args (int argc, const char **argv) { int res; char *endp; - assert (argc == 2); + assert (argc == 2); (void) argc; res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); diff --git a/tests/types.at b/tests/types.at new file mode 100644 index 0000000..5c56a1c --- /dev/null +++ b/tests/types.at @@ -0,0 +1,275 @@ +# Value type. -*- Autotest -*- + +# Copyright (C) 2013-2015, 2018 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +AT_BANNER([[Value type tests.]]) + + +## ----------------------------------- ## +## %union vs. %define api.value.type. ## +## ----------------------------------- ## + +AT_SETUP([[%union vs. %define api.value.type]]) + +AT_DATA([[input.y]], +[[%union { int ival; } +%define api.value.type union-directive +%% +exp: %empty; +]]) + +AT_BISON_CHECK([[input.y]], [[1]], [[]], +[[input.y:2.9-22: error: '%union' and '%define api.value.type' cannot be used together +]]) + +AT_CLEANUP + +## ---------------------------------------- ## +## %yacc vs. %define api.value.type union. ## +## ---------------------------------------- ## + +AT_SETUP([[%yacc vs. %define api.value.type union]]) + +AT_DATA([[input.y]], +[[%yacc +%define api.value.type union +%% +exp: %empty; +]]) + +AT_BISON_CHECK([[input.y]], [[1]], [[]], +[[input.y:2.9-22: error: '%yacc' and '%define api.value.type "union"' cannot be used together +]]) + +AT_CLEANUP + + +## ---------------- ## +## api.value.type. ## +## ---------------- ## + +# _AT_TEST($1: BISON-DIRECTIVES, +# $2: MORE-BISON-DIRECTIVES, +# $3: PARSER-ACTION, +# $4: INPUT, +# $5: SCANNER-ACTION, +# $6: RESULT) +# -------------------------------------- +# Compile the grammar and check the expected result. +# BISON-DIRECTIVES are passed to AT_SETUP, contrary to MORE-BISON-DIRECTIVES. +m4_pushdef([_AT_TEST], +[ +AT_SETUP([$1]) +AT_KEYWORDS([api.value.type]) +AT_BISON_OPTION_PUSHDEFS([%debug $1 $2]) +AT_DATA_GRAMMAR([test.y], +[[%debug + +%code +{ +# include +# include +]AT_YYERROR_DECLARE[ +]AT_YYLEX_DECLARE[ +} + +]$1[ +]$2[ + +%% + +start: $3; + +%% +]AT_YYERROR_DEFINE[ +]AT_YYLEX_DEFINE([$4], [$5])[ +]AT_MAIN_DEFINE[ +]]) + +AT_FULL_COMPILE([[test]]) +AT_PARSER_CHECK([./test], 0, [$6 +], [stderr]) +AT_BISON_OPTION_POPDEFS +AT_CLEANUP +]) + +# AT_TEST($1: BISON-DIRECTIVES, +# $2: MORE-BISON-DIRECTIVES, +# $3: PARSER-ACTION, +# $4: INPUT, +# $5: SCANNER-ACTION, +# $6: RESULT) +# -------------------------------------- +# Check with and without %defines, to avoid regressions. It turns out +# that in that case yacc.c calls the set-up of the %union twice, +# because YYSTYPE is defined once in the header, and once in the +# implementation file (eventually it'd be better to include the header +# file, but that's another story). Unfortunately running these macros +# a second time doubled the side-effects and resulted in a double +# definition of the union members. +m4_pushdef([AT_TEST], +[_AT_TEST([$1], [$2], [$3], [$4], [$5], [$6]) + _AT_TEST([$1 %defines], [$2], [$3], [$4], [$5], [$6]) +]) + +m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]], + [# A built-in type. + AT_TEST([%skeleton "]b4_skel[" + %define api.value.type {double}], + [], + ['1' '2' { printf ("%2.1f\n", $1 + $2); }], + ["12"], + [AT_VAL = (res - '0') / 10.0], + [0.3]) + + # A typedef which looks like a Bison keyword, but it's using braces. + AT_TEST([%skeleton "]b4_skel[" + %define api.value.type {variant}], + [%code requires { typedef double variant; }], + ['1' '2' { printf ("%2.1f\n", $1 + $2); }], + ["12"], + [AT_VAL = (res - '0') / 10.0], + [0.3]) + + # A user defined struct. + AT_TEST([%skeleton "]b4_skel[" + %define api.value.type {struct foo}], + [%code requires { struct foo { float fval; int ival; }; }], + ['1' '2' + { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }], + ["12"], + [AT_VAL.ival = (res - '0') * 10; + AT_VAL.fval = (res - '0') / 10.f], + [30 0.3]) + + # A user defined struct that uses pointers. + AT_TEST([%skeleton "]b4_skel[" + %define api.value.type {struct bar}], + [%code requires + { + struct u + { + int ival; + }; + struct bar + { + struct u *up; + }; + } + %token ival> '1' '2' + %printer { ]AT_SKEL_CC_IF([[yyoutput << $$]], + [[fprintf (yyo, "%d", $$)]])[; } ival> + ], + ['1' '2' + { + printf ("%d %d\n", $1, $ival>2); + free ($1); + free ($2); + }], + ["12"], + [AT_VAL.up = (struct u *) malloc (sizeof *AT_VAL.up); + assert (AT_VAL.up); + AT_VAL.up->ival = res - '0';], + [1 2]) + + # A user defined union. + AT_TEST([%skeleton "]b4_skel[" + %define api.value.type {union foo}], + [%code requires { union foo { float fval; int ival; }; }], + ['1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }], + ["12"], + [if (res == '1') + AT_VAL.ival = 10; + else + AT_VAL.fval = .2f], + [10 0.2]) + + # A %union and a named %union. In C++ named %union is an error. + m4_foreach([b4_union], + [m4_bmatch(b4_skel, [\.cc$], + [[%union]], + [[%union], [%union foo], + [%define api.value.union.name foo; %union]])], + [AT_TEST([%skeleton "]b4_skel[" + ]b4_union[ { float fval; int ival; };], + [%token '1'; + %token '2';], + ['1' '2' { printf ("%d %2.1f\n", $1, $2); }], + ["12"], + [if (res == '1') + AT_VAL.ival = 10; + else + AT_VAL.fval = 0.2f], + [10 0.2])]) + + # A Bison-defined union. + # The tokens names are not available directly in C++, we use their + # user number to keep it simple between C and C++. + AT_TEST([%skeleton "]b4_skel[" + %define api.value.type union], + [%token ONE 101; + %token TWO 102 THREE 103; + %printer { ]AT_SKEL_CC_IF([[yyoutput << $$]], + [[fprintf (yyo, "%d", $$)]])[; } + %printer { ]AT_SKEL_CC_IF([[yyoutput << $$]], + [[fprintf (yyo, "%f", $$)]])[; } + ], + [ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }], + [{ 101, 102, 103, EOF }], + [if (res == 101) + AT_VAL.ONE = 10; + else if (res == 102) + AT_VAL.TWO = .2f; + else if (res == 103) + AT_VAL.THREE = 3.3f], + [10 0.2 3.3]) + + # A Bison-defined variant, for lalr1.cc only. + m4_if(b4_skel, [lalr1.cc], [ + AT_TEST([%skeleton "]b4_skel[" + %define api.value.type variant], + [%token '1'; + %token '2';], + ['1' '2' { std::cout << $1 << ", " << $2 << '\n'; }], + ["12"], + [if (res == '1') + AT_VAL.build(10); + else + AT_VAL.build("two");], + [10, two])]) +]) + +m4_popdef([AT_TEST]) +m4_popdef([_AT_TEST]) + + +## ------------------- ## +## C++: Named %union. ## +## ------------------- ## + +m4_foreach([b4_skel], [[lalr1.cc], [glr.cc]], +[AT_SETUP([b4_skel: Named %union]) +AT_DATA([input.y], +[%skeleton "]b4_skel[" +%union foo { float fval; int ival; }; +%% +exp: %empty; +]) +AT_BISON_CHECK([input.y], 1, [], +[[input.y:2.8-10: error: named %union is invalid in C++ +]]) +AT_CLEANUP +]) -- 2.7.4